test: Enable TEST-08-INITRD on mkosi
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'enabled' : false,
|
||||
'cmdline' : integration_test_template['cmdline'] + [
|
||||
'rd.systemd.wants=initrd-run-mount.service',
|
||||
],
|
||||
'exit-code' : 124,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -47,6 +47,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('--exit-code', required=True, type=int)
|
||||
parser.add_argument('mkosi_args', nargs="*")
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -148,13 +149,12 @@ def main():
|
||||
|
||||
result = subprocess.run(cmd)
|
||||
|
||||
# Return code 123 is the expected success code
|
||||
if result.returncode in (123, 77):
|
||||
if result.returncode in (args.exit_code, 77):
|
||||
# Do not keep journal files for tests that don't fail.
|
||||
if journal_file:
|
||||
journal_file.unlink(missing_ok=True)
|
||||
|
||||
exit(0 if result.returncode == 123 else 77)
|
||||
exit(0 if result.returncode == args.exit_code else 77)
|
||||
|
||||
if journal_file:
|
||||
ops = []
|
||||
|
||||
@@ -292,6 +292,7 @@ integration_test_template = {
|
||||
'cmdline' : [],
|
||||
'credentials' : [],
|
||||
'qemu-args' : [],
|
||||
'exit-code' : 123,
|
||||
}
|
||||
testdata_subdirs = [
|
||||
'auxv',
|
||||
@@ -384,6 +385,7 @@ foreach integration_test : integration_tests
|
||||
'--name', integration_test['name'],
|
||||
'--storage', integration_test['storage'],
|
||||
'--firmware', integration_test['firmware'],
|
||||
'--exit-code', integration_test['exit-code'].to_string(),
|
||||
]
|
||||
|
||||
if 'unit' in integration_test
|
||||
|
||||
Reference in New Issue
Block a user