public inbox for kernelci@lists.linux.dev
 help / color / mirror / Atom feed
From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Shuah Khan <shuah@kernel.org>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: kernel@collabora.com, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernelci@lists.linux.dev,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>
Subject: [PATCH v2 2/3] kselftest: Move ksft helper module to common directory
Date: Fri, 05 Jul 2024 19:29:55 -0400	[thread overview]
Message-ID: <20240705-dev-err-log-selftest-v2-2-163b9cd7b3c1@collabora.com> (raw)
In-Reply-To: <20240705-dev-err-log-selftest-v2-0-163b9cd7b3c1@collabora.com>

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>
---
 tools/testing/selftests/Makefile                                   | 1 +
 tools/testing/selftests/devices/probe/Makefile                     | 2 +-
 tools/testing/selftests/devices/probe/test_discoverable_devices.py | 7 ++++++-
 tools/testing/selftests/{devices/probe => kselftest}/ksft.py       | 0
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 37214201d974..7bd78b9f5cdd 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -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;	\
diff --git a/tools/testing/selftests/devices/probe/Makefile b/tools/testing/selftests/devices/probe/Makefile
index 7a6eaa031cfe..f630108c3fdf 100644
--- a/tools/testing/selftests/devices/probe/Makefile
+++ b/tools/testing/selftests/devices/probe/Makefile
@@ -1,4 +1,4 @@
 TEST_PROGS := test_discoverable_devices.py
-TEST_FILES := boards ksft.py
+TEST_FILES := boards
 
 include ../../lib.mk
diff --git a/tools/testing/selftests/devices/probe/test_discoverable_devices.py b/tools/testing/selftests/devices/probe/test_discoverable_devices.py
index 8f2200540a1f..d94a74b8a054 100755
--- a/tools/testing/selftests/devices/probe/test_discoverable_devices.py
+++ b/tools/testing/selftests/devices/probe/test_discoverable_devices.py
@@ -16,12 +16,17 @@
 
 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 = []
 
diff --git a/tools/testing/selftests/devices/probe/ksft.py b/tools/testing/selftests/kselftest/ksft.py
similarity index 100%
rename from tools/testing/selftests/devices/probe/ksft.py
rename to tools/testing/selftests/kselftest/ksft.py

-- 
2.45.2


  parent reply	other threads:[~2024-07-05 23:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05 23:29 [PATCH v2 0/3] kselftest: Add test to report device log errors Nícolas F. R. A. Prado
2024-07-05 23:29 ` [PATCH v2 1/3] kselftest: devices: Move discoverable devices test to subdirectory Nícolas F. R. A. Prado
2024-07-05 23:29 ` Nícolas F. R. A. Prado [this message]
2024-07-05 23:29 ` [PATCH v2 3/3] kselftest: devices: Add test to detect device error logs Nícolas F. R. A. Prado
2024-07-10 13:11 ` [PATCH v2 0/3] kselftest: Add test to report device log errors Greg Kroah-Hartman
2024-07-10 21:49   ` Shuah Khan
2024-07-11 19:53     ` Shuah Khan
2024-07-11 21:44       ` Nícolas F. R. A. Prado
2024-07-11 21:56         ` Shuah Khan
2024-07-12  8:59           ` Greg Kroah-Hartman
2024-07-12 17:48         ` Bird, Tim
2024-07-12 20:51           ` Nícolas F. R. A. Prado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240705-dev-err-log-selftest-v2-2-163b9cd7b3c1@collabora.com \
    --to=nfraprado@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@collabora.com \
    --cc=kernelci@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox