From e92824f6adc144eed43243471b1849941d4275ec Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Fri, 1 Mar 2024 00:15:14 +0530 Subject: [PATCH 1/2] feat: allow op-test usage from anywhere Currently, if a symlink to 'op-test' is created somewhere (such as in /usr/local/bin/), it fails to start with following error: ``` $ cd /usr/local/bin $ ln -sv PATH_TO_op-test/op-test $ $ op-test --help Traceback (most recent call last): File "/tmp/./op-test2", line 125, in OpTestConfiguration.conf = OpTestConfiguration.OpTestConfiguration() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/op-test/OpTestConfiguration.py", line 492, in __init__ for dirname in (next(os.walk(os.path.join(self.basedir, 'addons')))[1]): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ StopIteration ``` This is because, `self.basedir` is pointing to the current working directory or path of the symlink (sys.argv[0]), and it didn't find self.basedir/'addons' folder. Solve this by ensuring `self.basedir` points to the directory containing the op-test script. This enables us to install op-test symlink in somewhere like `/usr/local/bin`, and thus being able to run it from anywhere. Signed-off-by: Aditya Gupta --- OpTestConfiguration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpTestConfiguration.py b/OpTestConfiguration.py index e97a8f16d..3c5ac4a1c 100644 --- a/OpTestConfiguration.py +++ b/OpTestConfiguration.py @@ -472,7 +472,7 @@ def __init__(self): self.cronus = OpTestCronus(self) self.args = [] self.remaining_args = [] - self.basedir = os.path.dirname(sys.argv[0]) + self.basedir = os.path.abspath(os.path.dirname(__file__)) self.signal_ready = False # indicator for properly initialized self.atexit_ready = False # indicator for properly initialized self.aes_print_helpers = True # Need state for locker_wait From a4af720aca89e36a96f89e505cb70a9cf5743c3c Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Thu, 14 Mar 2024 12:11:04 +0530 Subject: [PATCH 2/2] readme: update fwts link to point to github repository Older link `git://kernel.ubuntu.com/hwe/fwts.git` is not working anymore, and even ubuntu's official wiki about FirmwareTestSuite now gives the source link pointing to github.com/fwts/fwts. Replace the fwts github repository link to github.com link Signed-off-by: Aditya Gupta --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 351d56477..23a0af797 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ After cloning FWTS see the README for pre-reqs and how-to, be sure to 'make install' after building to get the proper paths setup. -git clone git://kernel.ubuntu.com/hwe/fwts.git +git clone https://github.com/fwts/fwts It must also have (package names for Debian/Ubuntu systems):