]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
kselftest: Move ksft helper module to common directory
authorNĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Fri, 5 Jul 2024 23:29:55 +0000 (19:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Jul 2024 08:59:06 +0000 (10:59 +0200)
Move the ksft python module, which provides generic helpers for
kselftests, to a common directory so it can be more easily shared
between different tests.

Signed-off-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240705-dev-err-log-selftest-v2-2-163b9cd7b3c1@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/Makefile
tools/testing/selftests/devices/probe/Makefile
tools/testing/selftests/devices/probe/test_discoverable_devices.py
tools/testing/selftests/kselftest/ksft.py [moved from tools/testing/selftests/devices/probe/ksft.py with 100% similarity]

index 37214201d9741608eb726d7c0c240a95c75066f7..7bd78b9f5cdd1fce23155fdb2348049fa44e8779 100644 (file)
@@ -251,6 +251,7 @@ ifdef INSTALL_PATH
        install -m 744 kselftest/runner.sh $(INSTALL_PATH)/kselftest/
        install -m 744 kselftest/prefix.pl $(INSTALL_PATH)/kselftest/
        install -m 744 kselftest/ktap_helpers.sh $(INSTALL_PATH)/kselftest/
+       install -m 744 kselftest/ksft.py $(INSTALL_PATH)/kselftest/
        install -m 744 run_kselftest.sh $(INSTALL_PATH)/
        rm -f $(TEST_LIST)
        @ret=1; \
index 7a6eaa031cfe7ba26e90dadcc332c63267bee739..f630108c3fdf1969b789a58e5389040aa6f7fa9c 100644 (file)
@@ -1,4 +1,4 @@
 TEST_PROGS := test_discoverable_devices.py
-TEST_FILES := boards ksft.py
+TEST_FILES := boards
 
 include ../../lib.mk
index 8f2200540a1fd67b2c3140b9255e0d441054dfc0..d94a74b8a054874f862fa27a1e527f3dbde84d34 100755 (executable)
 
 import argparse
 import glob
-import ksft
 import os
 import re
 import sys
 import yaml
 
+# Allow ksft module to be imported from different directory
+this_dir = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(this_dir, "../../kselftest/"))
+
+import ksft
+
 pci_controllers = []
 usb_controllers = []