1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 01:55:22 +03:00

test: Add cmdline field to configure extra kernel command line args

Configuring extra cmdline arguments as a list is much nicer than
having to pass the --kernel-command-line-extra argument manually.
This commit is contained in:
Daan De Meyer 2024-05-12 11:13:58 +02:00
parent 348f5017a4
commit 31c797e03d
3 changed files with 16 additions and 10 deletions

View File

@ -3,15 +3,14 @@
integration_tests += [
integration_test_template + {
'name' : fs.name(meson.current_source_dir()),
'mkosi-args' : integration_test_template['mkosi-args'] + [
'''--kernel-command-line-extra=
frobnicate!
'cmdline' : integration_test_template['cmdline'] + [
'''
systemd.setenv=TEST_CMDLINE_NEWLINE=foo
''',
'''
systemd.setenv=TEST_CMDLINE_NEWLINE=bar
''',
''',
],
},
]

View File

@ -3,9 +3,7 @@
integration_tests += [
integration_test_template + {
'name' : fs.name(meson.current_source_dir()),
'mkosi-args' : integration_test_template['mkosi-args'] + [
'--kernel-command-line-extra=selinux=1 lsm=selinux'
],
'cmdline' : integration_test_template['cmdline'] + ['selinux=1', 'lsm=selinux'],
# FIXME; Figure out why reboot sometimes hangs with 'linux' firmware.
'firmware' : 'uefi',
},

View File

@ -287,6 +287,7 @@ integration_test_template = {
'memory-accounting' : 'no',
'command' : testdata_dir / 'units/%N.sh',
},
'cmdline' : [],
}
testdata_subdirs = [
'auxv',
@ -399,7 +400,15 @@ foreach integration_test : integration_tests
integration_test_args += ['--slow']
endif
integration_test_args += ['--'] + integration_test['mkosi-args']
integration_test_args += ['--']
if integration_test['cmdline'].length() > 0
integration_test_args += [
'--kernel-command-line-extra=@0@'.format(' '.join(integration_test['cmdline']))
]
endif
integration_test_args += integration_test['mkosi-args']
integration_test_env = {}