diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-05-12 10:50:47 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-05-14 12:43:28 +0200 |
commit | 348f5017a40a518b041df0ed7071da8d5482ce5c (patch) | |
tree | 45d10213029071fd6e3f7cd1a188a2172b8938a1 /test/integration-test-wrapper.py | |
parent | TEST-46-HOMED: Simplify service unit (diff) | |
download | systemd-348f5017a40a518b041df0ed7071da8d5482ce5c.tar.xz systemd-348f5017a40a518b041df0ed7071da8d5482ce5c.zip |
test: Generate basic testsuite services with meson
Most of these are identical, let's just generate from a meson
template.
Diffstat (limited to 'test/integration-test-wrapper.py')
-rwxr-xr-x | test/integration-test-wrapper.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py index c762cc7ab7..14afc0f9c5 100755 --- a/test/integration-test-wrapper.py +++ b/test/integration-test-wrapper.py @@ -43,6 +43,7 @@ def main(): parser.add_argument('--meson-source-dir', required=True, type=Path) parser.add_argument('--meson-build-dir', required=True, type=Path) parser.add_argument('--name', required=True) + parser.add_argument('--unit', required=True) parser.add_argument('--storage', required=True) parser.add_argument('--firmware', required=True) parser.add_argument('--slow', action=argparse.BooleanOptionalAction) @@ -58,13 +59,10 @@ def main(): exit(77) name = args.name + (f"-{i}" if (i := os.getenv("MESON_TEST_ITERATION")) else "") - unit = f"{args.name}.service" dropin = textwrap.dedent( """\ [Unit] - After=multi-user.target network.target - Requires=multi-user.target SuccessAction=exit SuccessActionExitStatus=123 @@ -121,7 +119,7 @@ def main(): else [] ), '--credential', - f"systemd.unit-dropin.{unit}={shlex.quote(dropin)}", + f"systemd.unit-dropin.{args.unit}={shlex.quote(dropin)}", '--runtime-network=none', '--runtime-scratch=no', '--append', @@ -130,7 +128,7 @@ def main(): ' '.join([ 'systemd.hostname=H', f"SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/{args.name}.units:/usr/lib/systemd/tests/testdata/units:", - f"systemd.unit={unit}", + f"systemd.unit={args.unit}", 'systemd.mask=systemd-networkd-wait-online.service', *( [ @@ -183,7 +181,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 {unit} -p info"] + ops += [f"journalctl --file {journal_file} --no-hostname -o short-monotonic -u {args.unit} -p info"] print("Test failed, relevant logs can be viewed with: \n\n" f"{(' && '.join(ops))}\n", file=sys.stderr) |