From: Phil Sutter Date: Wed, 6 Nov 2024 14:18:36 +0000 (+0100) Subject: tests: iptables-test: Fix for 'make distcheck' X-Git-Tag: v1.8.11~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55ac47847806c248fe6385f0f273e9e1017ea7ee;p=thirdparty%2Fiptables.git 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 --- 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()