From 7fb4ee7aa5b6ffdf2e1e8e50a18630aa30f16505 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 9 Jul 2021 14:44:38 +0200 Subject: [PATCH 1/3] test: bump the test timeout to give ldconfig.service enough time to finish Sometimes the ldconfig.service might take a bit longer to finish, causing spurious test timeouts: ``` [ 1025.858923] systemd[24]: ldconfig.service: Executing: /sbin/ldconfig -X ... [ 1043.883620] systemd[1]: ldconfig.service: Main process exited, code=exited, status=0/SUCCESS (success) ... Trying to halt container. Send SIGTERM again to trigger immediate termination. Container TEST-52-HONORFIRSTSHUTDOWN terminated by signal KILL. E: Test timed out after 20s ``` --- test/TEST-52-HONORFIRSTSHUTDOWN/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh b/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh index 41c7e91917..6b77693346 100755 --- a/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh +++ b/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh @@ -11,7 +11,7 @@ TEST_NO_QEMU=1 # Using timeout because if the test fails it can loop. # The reason is because the poweroff executed by end.service # could turn into a reboot if the test fails. -NSPAWN_TIMEOUT=20 +NSPAWN_TIMEOUT=60 # Remove this file if it exists. This is used along with # the make target "finish". Since concrete confirmation is From e68e473ba2d6383155c49337c3c5f2c0d3fb0b5f Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 9 Jul 2021 14:59:11 +0200 Subject: [PATCH 2/3] test: strip binaries by default Since 23f8e01 we always kept binaries unstripped, since $STRIP_BINARIES is unset by default. --- test/test-functions | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test-functions b/test/test-functions index bef87ca91b..c6b8d4cd59 100644 --- a/test/test-functions +++ b/test/test-functions @@ -35,6 +35,7 @@ QEMU_MEM="${QEMU_MEM:-512M}" # To force creating a new image from scratch (eg: to encrypt it), also define # TEST_FORCE_NEWIMAGE=1 in the test setup script. IMAGE_NAME=${IMAGE_NAME:-default} +STRIP_BINARIES="${STRIP_BINARIES:-yes}" TEST_REQUIRE_INSTALL_TESTS="${TEST_REQUIRE_INSTALL_TESTS:-1}" TEST_PARALLELIZE="${TEST_PARALLELIZE:-0}" LOOPDEV= From 7e8cfa4bb6360740528c3c7c152db853f095af8b Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 9 Jul 2021 15:22:41 +0200 Subject: [PATCH 3/3] test: make the strace check a bit more clever We still sometimes try to grep an empty strace log because strace is not yet properly initialized. Let's make the check a bit clever and wait until strace is attached to PID 1 by checking the `TracerPid` field in `/proc/1/status`. --- test/units/testsuite-36.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/units/testsuite-36.sh b/test/units/testsuite-36.sh index 94fd927a5d..b684011785 100755 --- a/test/units/testsuite-36.sh +++ b/test/units/testsuite-36.sh @@ -34,8 +34,9 @@ journalCursorFile="jounalCursorFile" startStrace() { coproc strace -qq -p 1 -o "$straceLog" -e set_mempolicy -s 1024 ${1:+"$1"} - # Wait for strace to properly "initialize" - sleep $sleepAfterStart + # Wait for strace to properly "initialize", i.e. until PID 1 has the TracerPid + # field set to the current strace's PID + while ! awk -v spid="$COPROC_PID" '/^TracerPid:/ {exit !($2 == spid);}' /proc/1/status; do sleep 0.1; done } stopStrace() {