test: don't pre-process $KERNEL_APPEND
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 9 Nov 2023 14:33:31 +0000 (15:33 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 9 Nov 2023 16:31:12 +0000 (16:31 +0000)
commit4f3d8def186bf22013723416701cc8b9bc76fc26
treee1364c141983ef833b7cbb624bc0290b97999e79
parent2dbfb4f9f2acd498206f6686d9f13c71813244cd
test: don't pre-process $KERNEL_APPEND

Let's just rely on the word splitting done by bash instead of messing
with that ourselves, as it's just adding extra complexity to appease one
ShellCheck check. Also, this apparently never worked for the nspawn
stuff anyway, since I forgot to set $IFS to an appropriate value, so it
always put all arguments from $KERNEL_APPEND into a single array item
with an extra newline, which then made systemd sad:

~# readarray arr <<< "foo bar baz"; for i in "${arr[@]}"; do echo "'$i'"; done
'foo bar baz
'
~# make -C test/TEST-45-TIMEDATE/ clean setup run BUILD_DIR=$PWD/build TEST_NO_QEMU=1 KERNEL_APPEND="systemd.log_level=console"
...
~# journalctl -o short-monotonic --no-hostname --file /var/tmp/systemd-tests/systemd-test.XaDX67/system.journal --grep "Failed to parse" -p info --no-pager
[551138.986882] systemd-tmpfiles[21]: Failed to parse log level 'console
[551138.987179] systemd-remount-fs[20]: Failed to parse log level 'console
[551138.993125] systemd-sysusers[23]: Failed to parse log level 'console
[551138.998685] journalctl[29]: Failed to parse log level 'console

Resolves: #29945
test/test-functions