mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
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
This commit is contained in:
parent
2dbfb4f9f2
commit
4f3d8def18
@ -594,12 +594,6 @@ run_qemu() {
|
||||
fi
|
||||
qemu_options+=(${QEMU_OPTIONS_ARRAY:+"${QEMU_OPTIONS_ARRAY[@]}"})
|
||||
|
||||
if [[ -n "${KERNEL_APPEND:=}" ]]; then
|
||||
local user_kernel_append
|
||||
readarray user_kernel_append <<< "$KERNEL_APPEND"
|
||||
kernel_params+=("${user_kernel_append[@]}")
|
||||
fi
|
||||
|
||||
if [[ -n "$INITRD" ]]; then
|
||||
if [[ -n "$INITRD_EXTRA" ]]; then
|
||||
# An addition initrd has been specified, let's combine it with the main one.
|
||||
@ -634,7 +628,7 @@ run_qemu() {
|
||||
qemu_cmd=(timeout --foreground "$QEMU_TIMEOUT" "$QEMU_BIN")
|
||||
fi
|
||||
|
||||
(set -x; "${qemu_cmd[@]}" "${qemu_options[@]}" -append "${kernel_params[*]}" |& tee "${TESTDIR:?}/console.log")
|
||||
(set -x; "${qemu_cmd[@]}" "${qemu_options[@]}" -append "${kernel_params[*]} ${KERNEL_APPEND:-}" |& tee "${TESTDIR:?}/console.log")
|
||||
rc=$?
|
||||
if [ "$rc" -eq 124 ] && [ "$QEMU_TIMEOUT" != "infinity" ]; then
|
||||
derror "Test timed out after ${QEMU_TIMEOUT}s"
|
||||
@ -679,12 +673,6 @@ run_nspawn() {
|
||||
nspawn_options+=("${user_nspawn_arguments[@]}")
|
||||
fi
|
||||
|
||||
if [[ -n "${KERNEL_APPEND:=}" ]]; then
|
||||
local user_kernel_append
|
||||
readarray user_kernel_append <<< "$KERNEL_APPEND"
|
||||
kernel_params+=("${user_kernel_append[@]}")
|
||||
fi
|
||||
|
||||
if [[ "$UNIFIED_CGROUP_HIERARCHY" = "hybrid" ]]; then
|
||||
dwarn "nspawn doesn't support SYSTEMD_NSPAWN_UNIFIED_HIERARCHY=hybrid, skipping"
|
||||
exit
|
||||
@ -703,7 +691,9 @@ run_nspawn() {
|
||||
nspawn_cmd+=("$SYSTEMD_NSPAWN")
|
||||
fi
|
||||
|
||||
(set -x; "${nspawn_cmd[@]}" "${nspawn_options[@]}" "${kernel_params[@]}" |& tee "${TESTDIR:?}/console.log")
|
||||
# Word splitting here is intentional
|
||||
# shellcheck disable=SC2086
|
||||
(set -x; "${nspawn_cmd[@]}" "${nspawn_options[@]}" "${kernel_params[@]}" ${KERNEL_APPEND:-} |& tee "${TESTDIR:?}/console.log")
|
||||
rc=$?
|
||||
if [ "$rc" -eq 124 ] && [ "$NSPAWN_TIMEOUT" != "infinity" ]; then
|
||||
derror "Test timed out after ${NSPAWN_TIMEOUT}s"
|
||||
|
Loading…
Reference in New Issue
Block a user