Skip to content

Commit 0e7b7bd

Browse files
nfrapradogregkh
authored andcommitted
kselftest: Move ksft helper module to common directory
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 <[email protected]> Acked-by: Shuah Khan <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0debb20 commit 0e7b7bd

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

tools/testing/selftests/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ ifdef INSTALL_PATH
251251
install -m 744 kselftest/runner.sh $(INSTALL_PATH)/kselftest/
252252
install -m 744 kselftest/prefix.pl $(INSTALL_PATH)/kselftest/
253253
install -m 744 kselftest/ktap_helpers.sh $(INSTALL_PATH)/kselftest/
254+
install -m 744 kselftest/ksft.py $(INSTALL_PATH)/kselftest/
254255
install -m 744 run_kselftest.sh $(INSTALL_PATH)/
255256
rm -f $(TEST_LIST)
256257
@ret=1; \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
TEST_PROGS := test_discoverable_devices.py
2-
TEST_FILES := boards ksft.py
2+
TEST_FILES := boards
33

44
include ../../lib.mk

tools/testing/selftests/devices/probe/test_discoverable_devices.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@
1616

1717
import argparse
1818
import glob
19-
import ksft
2019
import os
2120
import re
2221
import sys
2322
import yaml
2423

24+
# Allow ksft module to be imported from different directory
25+
this_dir = os.path.dirname(os.path.realpath(__file__))
26+
sys.path.append(os.path.join(this_dir, "../../kselftest/"))
27+
28+
import ksft
29+
2530
pci_controllers = []
2631
usb_controllers = []
2732

0 commit comments

Comments
 (0)