]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Add cmdline field to configure extra kernel command line args
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 12 May 2024 09:13:58 +0000 (11:13 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 14 May 2024 10:43:28 +0000 (12:43 +0200)
Configuring extra cmdline arguments as a list is much nicer than
having to pass the --kernel-command-line-extra argument manually.

test/TEST-02-UNITTESTS/meson.build
test/TEST-06-SELINUX/meson.build
test/meson.build

index 8da5555842848909a9295a2b61675f4b06a57613..b0003391b5c3a991287edd552cd2b10fb464cc76 100644 (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
-
-''',
+                        ''',
                 ],
         },
 ]
index ec4b502b942e49456b8cae4f8d130e81f19bff1b..dd1dfb0bafe56fd18a7a9b2900e0fb8aea87483c 100644 (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',
         },
index fab802a66d7ca34a9e382ec849a3866e50e7787f..61aa01089a9d84c03425c00f10ef43f2404df2cc 100644 (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 = {}