From: Daan De Meyer Date: Sat, 11 May 2024 17:40:03 +0000 (+0200) Subject: test: Simplify argument/variable names X-Git-Tag: v256-rc2~18^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f483e083139af72fc478f51422c97d6a0b96ce42;p=thirdparty%2Fsystemd.git test: Simplify argument/variable names --- diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py index 6e2c0aede72..c762cc7ab73 100755 --- a/test/integration-test-wrapper.py +++ b/test/integration-test-wrapper.py @@ -42,7 +42,7 @@ def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('--meson-source-dir', required=True, type=Path) parser.add_argument('--meson-build-dir', required=True, type=Path) - parser.add_argument('--test-name', required=True) + parser.add_argument('--name', required=True) parser.add_argument('--storage', required=True) parser.add_argument('--firmware', required=True) parser.add_argument('--slow', action=argparse.BooleanOptionalAction) @@ -50,15 +50,15 @@ def main(): args = parser.parse_args() if not bool(int(os.getenv("SYSTEMD_INTEGRATION_TESTS", "0"))): - print(f"SYSTEMD_INTEGRATION_TESTS=1 not found in environment, skipping {args.test_name}", file=sys.stderr) + print(f"SYSTEMD_INTEGRATION_TESTS=1 not found in environment, skipping {args.name}", file=sys.stderr) exit(77) if args.slow and not bool(int(os.getenv("SYSTEMD_SLOW_TESTS", "0"))): - print(f"SYSTEMD_SLOW_TESTS=1 not found in environment, skipping {args.test_name}", file=sys.stderr) + print(f"SYSTEMD_SLOW_TESTS=1 not found in environment, skipping {args.name}", file=sys.stderr) exit(77) - name = args.test_name + (f"-{i}" if (i := os.getenv("MESON_TEST_ITERATION")) else "") - test_unit = f"{args.test_name}.service" + name = args.name + (f"-{i}" if (i := os.getenv("MESON_TEST_ITERATION")) else "") + unit = f"{args.name}.service" dropin = textwrap.dedent( """\ @@ -121,7 +121,7 @@ def main(): else [] ), '--credential', - f"systemd.unit-dropin.{test_unit}={shlex.quote(dropin)}", + f"systemd.unit-dropin.{unit}={shlex.quote(dropin)}", '--runtime-network=none', '--runtime-scratch=no', '--append', @@ -129,8 +129,8 @@ def main(): '--kernel-command-line-extra', ' '.join([ 'systemd.hostname=H', - f"SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/{args.test_name}.units:/usr/lib/systemd/tests/testdata/units:", - f"systemd.unit={test_unit}", + f"SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/{args.name}.units:/usr/lib/systemd/tests/testdata/units:", + f"systemd.unit={unit}", 'systemd.mask=systemd-networkd-wait-online.service', *( [ @@ -183,7 +183,7 @@ def main(): ops += [f"gh run download {id} --name {artifact} -D ci/{artifact}"] journal_file = Path(f"ci/{artifact}/test/journal/{name}.journal") - ops += [f"journalctl --file {journal_file} --no-hostname -o short-monotonic -u {test_unit} -p info"] + ops += [f"journalctl --file {journal_file} --no-hostname -o short-monotonic -u {unit} -p info"] print("Test failed, relevant logs can be viewed with: \n\n" f"{(' && '.join(ops))}\n", file=sys.stderr) diff --git a/test/meson.build b/test/meson.build index 26fbd562829..73b72281ca9 100644 --- a/test/meson.build +++ b/test/meson.build @@ -370,7 +370,7 @@ foreach integration_test : integration_tests integration_test_args = [ '--meson-source-dir', meson.project_source_root(), '--meson-build-dir', meson.project_build_root(), - '--test-name', integration_test['name'], + '--name', integration_test['name'], '--storage', integration_test['storage'], '--firmware', integration_test['firmware'], ]