From: Frantisek Sumsal Date: Wed, 17 May 2023 07:05:04 +0000 (+0200) Subject: test: mangle the machine ID only for the QEMU test part X-Git-Tag: v254-rc1~456 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c01f0184b94728119833e86304097cb505655cd0;p=thirdparty%2Fsystemd.git test: mangle the machine ID only for the QEMU test part systemd-nspawn doesn't like invalid machine IDs and refuses to boot with one: TEST-74-AUX-UTILS RUN: Tests for auxiliary utilities ... Spawning container TEST-74-AUX-UTILS--3 on /var/tmp/systemd-test-TEST-74-AUX-UTILS_3/root. Press Ctrl-] three times within 1s to kill container. Failed to read machine ID from container image: Structure needs cleaning E: nspawn failed with exit code 1 Follow-up to b4d42a82eb. --- diff --git a/test/TEST-74-AUX-UTILS/test.sh b/test/TEST-74-AUX-UTILS/test.sh index 6b7c2510496..1e360658ed5 100755 --- a/test/TEST-74-AUX-UTILS/test.sh +++ b/test/TEST-74-AUX-UTILS/test.sh @@ -10,7 +10,11 @@ TEST_DESCRIPTION="Tests for auxiliary utilities" test_append_files() { local workspace="${1:?}" - printf "556f48e837bc4424a710fa2e2c9d3e3c\ne3d\n" >"$workspace/etc/machine-id" + if ! get_bool "${TEST_PREFER_NSPAWN:-}" && ! get_bool "${TEST_NO_QEMU:-}"; then + # Check if we can correctly boot with an invalid machine ID only if we run + # the QEMU test, as nspawn refuses the invalid machine ID with -EUCLEAN + printf "556f48e837bc4424a710fa2e2c9d3e3c\ne3d\n" >"$workspace/etc/machine-id" + fi } do_test "$@"