diff options
author | Phil Sutter <phil@nwl.cc> | 2024-11-06 15:18:36 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2024-11-06 16:09:52 +0100 |
commit | 55ac47847806c248fe6385f0f273e9e1017ea7ee (patch) | |
tree | 1dbc9df1037c5231efbe00a88f7fe9797f263db8 | |
parent | 2393d33d4c44c25faf7784414abe546baccf71e4 (diff) |
tests: iptables-test: Fix for 'make distcheck'
This was a tricky one: Since called from VPATH topdir, extensions/ do
not contain test files at all. The script consequently passed since 0
tests failed (of 0 in total).
Fix this by introducing TESTS_PATH which is extensions/ below the directory
of the running iptables-test.py. Keep EXTENSIONS_PATH as-is: The built
extensions are indeed there and XTABLES_LIBDIR must point to them.
Signed-off-by: Phil Sutter <phil@nwl.cc>
-rwxr-xr-x | iptables-test.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/iptables-test.py b/iptables-test.py index 141fec7b..66db5521 100755 --- a/iptables-test.py +++ b/iptables-test.py @@ -30,6 +30,7 @@ EBTABLES_SAVE = "ebtables-save" #IP6TABLES_SAVE = ['xtables-save','-6'] EXTENSIONS_PATH = "extensions" +TESTS_PATH = os.path.join(os.path.dirname(sys.argv[0]), "extensions") LOGFILE="/tmp/iptables-test.log" log_file = None @@ -558,7 +559,7 @@ def show_missing(): ''' Show the list of missing test files ''' - file_list = os.listdir(EXTENSIONS_PATH) + file_list = os.listdir(TESTS_PATH) testfiles = [i for i in file_list if i.endswith('.t')] libfiles = [i for i in file_list if i.startswith('lib') and i.endswith('.c')] @@ -669,8 +670,8 @@ def main(): if args.filename: file_list = args.filename else: - file_list = [os.path.join(EXTENSIONS_PATH, i) - for i in os.listdir(EXTENSIONS_PATH) + file_list = [os.path.join(TESTS_PATH, i) + for i in os.listdir(TESTS_PATH) if i.endswith('.t')] file_list.sort() |