mirror of
https://github.com/systemd/systemd.git
synced 2025-03-23 10:50:16 +03:00
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.
This commit is contained in:
parent
14aea4a9f5
commit
1e5a1bbe02
@ -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,
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -7,5 +7,6 @@ integration_tests += [
|
||||
'rd.systemd.wants=initrd-run-mount.service',
|
||||
],
|
||||
'exit-code' : 124,
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -6,5 +6,6 @@ integration_tests += [
|
||||
'timeout' : 3600,
|
||||
'priority' : 50,
|
||||
'slow' : true,
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -20,5 +20,6 @@ integration_tests += [
|
||||
'mkosi-args' : integration_test_template['mkosi-args'] + [
|
||||
'--runtime-size=11G',
|
||||
],
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -3,6 +3,7 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -6,5 +6,6 @@ integration_tests += [
|
||||
'configuration' : integration_test_template['configuration'] + {
|
||||
'memory-accounting' : 'yes',
|
||||
},
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -6,5 +6,6 @@ integration_tests += [
|
||||
'mkosi-args' : integration_test_template['mkosi-args'] + [
|
||||
'--configure-script', meson.current_source_dir() / 'mkosi.configure',
|
||||
],
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -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,
|
||||
},
|
||||
]
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -33,6 +33,7 @@ foreach testcase : [
|
||||
'--configure-script', files('@0@.configure'.format(testcase)),
|
||||
],
|
||||
'priority' : 10,
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
endforeach
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -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,
|
||||
},
|
||||
]
|
||||
|
@ -6,5 +6,6 @@ integration_tests += [
|
||||
'unit' : files('TEST-82-SOFTREBOOT.service'),
|
||||
'cmdline' : ['systemd.set_credential=kernelcmdlinecred:uff'],
|
||||
'storage' : 'persistent',
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -3,5 +3,6 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user