From 38d072a17567f762d70025abb61a80716e04c8bd Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 28 Mar 2024 15:15:06 +0100 Subject: [PATCH] test: bump the container boot timeout when running w/o acceleration With plain QEMU on a saturated AWS region we might just barely miss the timeout window, causing unexpected test fails: [ 688.681324] systemd-nspawn[1332]: [ OK ] Finished systemd-user-sessions.service. [ 689.451267] systemd-nspawn[1332]: [ OK ] Started console-getty.service. [ 689.572874] systemd-nspawn[1332]: [ OK ] Reached target getty.target. [ 693.634609] testsuite-74.sh[1223]: + at_exit [ 693.634609] testsuite-74.sh[1223]: + rm -fv -- /tmp/test-dump /tmp/test-usr-dump /tmp/make-dump [ 693.838395] testsuite-74.sh[1502]: removed '/tmp/test-dump' [ 693.838395] testsuite-74.sh[1502]: removed '/tmp/test-usr-dump' [ 693.838395] testsuite-74.sh[1502]: removed '/tmp/make-dump' [ 693.951114] testsuite-74.sh[670]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/testsuite-74.coredump.sh failed' [ 693.951114] testsuite-74.sh[670]: Subtest /usr/lib/systemd/tests/testdata/units/testsuite-74.coredump.sh failed [ 693.951114] testsuite-74.sh[670]: + return 1 [ 694.659094] systemd[1]: testsuite-74.service: Main process exited, code=exited, status=1/FAILURE [ 694.719563] systemd[1]: testsuite-74.service: Failed with result 'exit-code'. [ 694.882069] systemd[1]: Failed to start testsuite-74.service. [ 695.574445] systemd[1]: Reached target testsuite.target. [ 696.174844] systemd[1]: Starting end.service... [ 699.509408] systemd-nspawn[1332]: [ 699.509408] systemd-nspawn[1332]: CentOS Stream 9 [ 699.509408] systemd-nspawn[1332]: Kernel 5.14.0-432.el9.x86_64 on an x86_64 (pts/0) [ 699.509408] systemd-nspawn[1332]: Also, move the rest of container the setup for the user xattrs test into the condition, since doing it without the actual test is pretty pointless. --- test/units/testsuite-74.coredump.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/test/units/testsuite-74.coredump.sh b/test/units/testsuite-74.coredump.sh index 6552643ee9..f48607c0db 100755 --- a/test/units/testsuite-74.coredump.sh +++ b/test/units/testsuite-74.coredump.sh @@ -77,24 +77,26 @@ rm -fv /run/systemd/coredump.conf.d/99-external.conf # Wait a bit for the coredumps to get processed timeout 30 bash -c "while [[ \$(coredumpctl list -q --no-legend $CORE_TEST_BIN | wc -l) -lt 4 ]]; do sleep 1; done" -# Make sure we can forward crashes back to containers -CONTAINER="testsuite-74-container" - -mkdir -p "/var/lib/machines/$CONTAINER" -mkdir -p "/run/systemd/system/systemd-nspawn@$CONTAINER.service.d" -# Bind-mounting /etc into the container kinda defeats the purpose of --volatile=, -# but we need the ASan-related overrides scattered across /etc -cat > "/run/systemd/system/systemd-nspawn@$CONTAINER.service.d/override.conf" << EOF +if cgroupfs_supports_user_xattrs; then + # Make sure we can forward crashes back to containers + CONTAINER="testsuite-74-container" + + mkdir -p "/var/lib/machines/$CONTAINER" + mkdir -p "/run/systemd/system/systemd-nspawn@$CONTAINER.service.d" + # Bind-mounting /etc into the container kinda defeats the purpose of --volatile=, + # but we need the ASan-related overrides scattered across /etc + cat > "/run/systemd/system/systemd-nspawn@$CONTAINER.service.d/override.conf" <