lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240613-kselftest-discoverable-probe-mt8195-kci-v1-1-7b396a9b032d@collabora.com>
Date: Thu, 13 Jun 2024 11:14:51 -0400
From: Nícolas F. R. A. Prado <nfraprado@...labora.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
 Shuah Khan <shuah@...nel.org>
Cc: kernel@...labora.com, linux-usb@...r.kernel.org, 
 linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org, 
 kernelci@...ts.linux.dev, 
 Nícolas F. R. A. Prado <nfraprado@...labora.com>
Subject: [PATCH 1/2] kselftest: devices: Allow specifying boards directory
 through parameter

Add support for a --boards-dir parameter through which the directory in
which the board files will be searched for can be specified. The
'boards' subdirectory is still used as default when the parameter is not
specified.

This allows more easily running the test with board files supplied by an
external repository like
https://github.com/kernelci/platform-test-parameters.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@...labora.com>
---
 .../testing/selftests/devices/test_discoverable_devices.py  | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/devices/test_discoverable_devices.py b/tools/testing/selftests/devices/test_discoverable_devices.py
index fbae8deb593d..19f28ea774f4 100755
--- a/tools/testing/selftests/devices/test_discoverable_devices.py
+++ b/tools/testing/selftests/devices/test_discoverable_devices.py
@@ -14,6 +14,7 @@
 # the description and examples of the file structure and vocabulary.
 #
 
+import argparse
 import glob
 import ksft
 import os
@@ -296,14 +297,24 @@ def run_test(yaml_file):
         parse_device_tree_node(device_tree)
 
 
+parser = argparse.ArgumentParser()
+parser.add_argument(
+    "--boards-dir", default="boards", help="Directory containing the board YAML files"
+)
+args = parser.parse_args()
+
 find_pci_controller_dirs()
 find_usb_controller_dirs()
 
 ksft.print_header()
 
+if not os.path.exists(args.boards_dir):
+    ksft.print_msg(f"Boards directory '{args.boards_dir}' doesn't exist")
+    ksft.exit_fail()
+
 board_file = ""
 for board_filename in get_board_filenames():
-    full_board_filename = os.path.join("boards", board_filename + ".yaml")
+    full_board_filename = os.path.join(args.boards_dir, board_filename + ".yaml")
 
     if os.path.exists(full_board_filename):
         board_file = full_board_filename

-- 
2.45.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ