diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-05-28 15:54:35 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-05-29 14:10:50 +0200 |
commit | 1e5a1bbe0208fd6e26bd74377cf7eb488d158045 (patch) | |
tree | 6f6f7dd98a9d1cb0a6897df04bd71561b827ea93 /test | |
parent | mkosi: Disable iscsi service and socket (diff) | |
download | systemd-1e5a1bbe0208fd6e26bd74377cf7eb488d158045.tar.xz systemd-1e5a1bbe0208fd6e26bd74377cf7eb488d158045.zip |
test: Run tests that don't need a vm in systemd-nspawn
If we're not running the test as root, stick to using a virtual
machine, as mkosi can't do rootless nspawn yet.
Diffstat (limited to 'test')
25 files changed, 31 insertions, 2 deletions
diff --git a/test/TEST-06-SELINUX/meson.build b/test/TEST-06-SELINUX/meson.build index dd1dfb0baf..7a850beb81 100644 --- a/test/TEST-06-SELINUX/meson.build +++ b/test/TEST-06-SELINUX/meson.build @@ -6,6 +6,7 @@ integration_tests += [ 'cmdline' : integration_test_template['cmdline'] + ['selinux=1', 'lsm=selinux'], # FIXME; Figure out why reboot sometimes hangs with 'linux' firmware. 'firmware' : 'uefi', + 'vm' : true, }, ] diff --git a/test/TEST-08-INITRD/meson.build b/test/TEST-08-INITRD/meson.build index 34edec0d35..dcbfe20134 100644 --- a/test/TEST-08-INITRD/meson.build +++ b/test/TEST-08-INITRD/meson.build @@ -7,5 +7,6 @@ integration_tests += [ 'rd.systemd.wants=initrd-run-mount.service', ], 'exit-code' : 124, + 'vm' : true, }, ] diff --git a/test/TEST-13-NSPAWN/meson.build b/test/TEST-13-NSPAWN/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-13-NSPAWN/meson.build +++ b/test/TEST-13-NSPAWN/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-17-UDEV/meson.build b/test/TEST-17-UDEV/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-17-UDEV/meson.build +++ b/test/TEST-17-UDEV/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-21-DFUZZER/meson.build b/test/TEST-21-DFUZZER/meson.build index 3373df297c..29c8e434ca 100644 --- a/test/TEST-21-DFUZZER/meson.build +++ b/test/TEST-21-DFUZZER/meson.build @@ -6,5 +6,6 @@ integration_tests += [ 'timeout' : 3600, 'priority' : 50, 'slow' : true, + 'vm' : true, }, ] diff --git a/test/TEST-24-CRYPTSETUP/meson.build b/test/TEST-24-CRYPTSETUP/meson.build index ec621d5068..cef370bd65 100644 --- a/test/TEST-24-CRYPTSETUP/meson.build +++ b/test/TEST-24-CRYPTSETUP/meson.build @@ -20,5 +20,6 @@ integration_tests += [ 'mkosi-args' : integration_test_template['mkosi-args'] + [ '--runtime-size=11G', ], + 'vm' : true, }, ] diff --git a/test/TEST-29-PORTABLE/meson.build b/test/TEST-29-PORTABLE/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-29-PORTABLE/meson.build +++ b/test/TEST-29-PORTABLE/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-30-ONCLOCKCHANGE/meson.build b/test/TEST-30-ONCLOCKCHANGE/meson.build index 174ec42867..cd0f1f6574 100644 --- a/test/TEST-30-ONCLOCKCHANGE/meson.build +++ b/test/TEST-30-ONCLOCKCHANGE/meson.build @@ -3,6 +3,7 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-31-DEVICE-ENUMERATION/meson.build b/test/TEST-31-DEVICE-ENUMERATION/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-31-DEVICE-ENUMERATION/meson.build +++ b/test/TEST-31-DEVICE-ENUMERATION/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-32-OOMPOLICY/meson.build b/test/TEST-32-OOMPOLICY/meson.build index 2b832a8f6d..b715c0dd26 100644 --- a/test/TEST-32-OOMPOLICY/meson.build +++ b/test/TEST-32-OOMPOLICY/meson.build @@ -6,5 +6,6 @@ integration_tests += [ 'configuration' : integration_test_template['configuration'] + { 'memory-accounting' : 'yes', }, + 'vm' : true, }, ] diff --git a/test/TEST-36-NUMAPOLICY/meson.build b/test/TEST-36-NUMAPOLICY/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-36-NUMAPOLICY/meson.build +++ b/test/TEST-36-NUMAPOLICY/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-38-FREEZER/meson.build b/test/TEST-38-FREEZER/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-38-FREEZER/meson.build +++ b/test/TEST-38-FREEZER/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-50-DISSECT/meson.build b/test/TEST-50-DISSECT/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-50-DISSECT/meson.build +++ b/test/TEST-50-DISSECT/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-53-ISSUE-16347/meson.build b/test/TEST-53-ISSUE-16347/meson.build index 8d6df66cb0..4c764a21c3 100644 --- a/test/TEST-53-ISSUE-16347/meson.build +++ b/test/TEST-53-ISSUE-16347/meson.build @@ -6,5 +6,6 @@ integration_tests += [ 'mkosi-args' : integration_test_template['mkosi-args'] + [ '--configure-script', meson.current_source_dir() / 'mkosi.configure', ], + 'vm' : true, }, ] diff --git a/test/TEST-55-OOMD/meson.build b/test/TEST-55-OOMD/meson.build index 71014a3158..adc0509786 100644 --- a/test/TEST-55-OOMD/meson.build +++ b/test/TEST-55-OOMD/meson.build @@ -5,6 +5,7 @@ integration_tests += [ 'name' : fs.name(meson.current_source_dir()), 'credentials' : integration_test_template['credentials'] + [ files('systemd.unit-dropin.init.scope'), - ] + ], + 'vm' : true, }, ] diff --git a/test/TEST-62-RESTRICT-IFACES/meson.build b/test/TEST-62-RESTRICT-IFACES/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-62-RESTRICT-IFACES/meson.build +++ b/test/TEST-62-RESTRICT-IFACES/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-64-UDEV-STORAGE/meson.build b/test/TEST-64-UDEV-STORAGE/meson.build index 3c206d9f54..363104d861 100644 --- a/test/TEST-64-UDEV-STORAGE/meson.build +++ b/test/TEST-64-UDEV-STORAGE/meson.build @@ -33,6 +33,7 @@ foreach testcase : [ '--configure-script', files('@0@.configure'.format(testcase)), ], 'priority' : 10, + 'vm' : true, }, ] endforeach diff --git a/test/TEST-66-DEVICE-ISOLATION/meson.build b/test/TEST-66-DEVICE-ISOLATION/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-66-DEVICE-ISOLATION/meson.build +++ b/test/TEST-66-DEVICE-ISOLATION/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-67-INTEGRITY/meson.build b/test/TEST-67-INTEGRITY/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-67-INTEGRITY/meson.build +++ b/test/TEST-67-INTEGRITY/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-70-TPM2/meson.build b/test/TEST-70-TPM2/meson.build index 4e0bf90874..d84c2b7838 100644 --- a/test/TEST-70-TPM2/meson.build +++ b/test/TEST-70-TPM2/meson.build @@ -7,5 +7,6 @@ integration_tests += [ 'wants' : '@0@ tpm2.target'.format(integration_test_template['configuration']['wants']), 'after' : '@0@ tpm2.target'.format(integration_test_template['configuration']['after']), }, + 'vm' : true, }, ] diff --git a/test/TEST-82-SOFTREBOOT/meson.build b/test/TEST-82-SOFTREBOOT/meson.build index a9b26ffd84..a7c1bf0bd5 100644 --- a/test/TEST-82-SOFTREBOOT/meson.build +++ b/test/TEST-82-SOFTREBOOT/meson.build @@ -6,5 +6,6 @@ integration_tests += [ 'unit' : files('TEST-82-SOFTREBOOT.service'), 'cmdline' : ['systemd.set_credential=kernelcmdlinecred:uff'], 'storage' : 'persistent', + 'vm' : true, }, ] diff --git a/test/TEST-83-BTRFS/meson.build b/test/TEST-83-BTRFS/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-83-BTRFS/meson.build +++ b/test/TEST-83-BTRFS/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/TEST-84-STORAGETM/meson.build b/test/TEST-84-STORAGETM/meson.build index 8dec5f37e7..77370ce458 100644 --- a/test/TEST-84-STORAGETM/meson.build +++ b/test/TEST-84-STORAGETM/meson.build @@ -3,5 +3,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), + 'vm' : true, }, ] diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py index c84296d816..5b098a3e01 100755 --- a/test/integration-test-wrapper.py +++ b/test/integration-test-wrapper.py @@ -48,6 +48,7 @@ def main(): parser.add_argument('--storage', required=True) parser.add_argument('--firmware', required=True) parser.add_argument('--slow', action=argparse.BooleanOptionalAction) + parser.add_argument('--vm', action=argparse.BooleanOptionalAction) parser.add_argument('--exit-code', required=True, type=int) parser.add_argument('mkosi_args', nargs="*") args = parser.parse_args() @@ -145,7 +146,7 @@ def main(): ), ]), '--credential', f"journal.storage={'persistent' if sys.stderr.isatty() else args.storage}", - 'qemu', + 'qemu' if args.vm or os.getuid() != 0 else 'boot', ] result = subprocess.run(cmd) diff --git a/test/meson.build b/test/meson.build index 5c15ade344..92edd079b4 100644 --- a/test/meson.build +++ b/test/meson.build @@ -293,6 +293,7 @@ integration_test_template = { 'credentials' : [], 'qemu-args' : [], 'exit-code' : 123, + 'vm' : false, } testdata_subdirs = [ 'auxv', @@ -407,6 +408,10 @@ foreach integration_test : integration_tests integration_test_args += ['--slow'] endif + if integration_test['vm'] + integration_test_args += ['--vm'] + endif + if not mkosi.found() continue endif |