From d24bec0d038286e6f60f8fd08a3a0a1ab60f2eb4 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 9 May 2023 07:02:05 -0600 Subject: [PATCH] system tests: timeoutize quadlet, systemd Run $QUADLET and all systemctl/journalctl commands using 'timeout'. Nothing should ever, ever take more than the default 2 minutes. Followup to #18514, in which quadlet tests are found to be taking 9-10 minutes. Signed-off-by: Ed Santiago --- test/system/252-quadlet.bats | 4 +++- test/system/helpers.systemd.bash | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/system/252-quadlet.bats b/test/system/252-quadlet.bats index e1fc162ab7..290f4077c4 100644 --- a/test/system/252-quadlet.bats +++ b/test/system/252-quadlet.bats @@ -52,7 +52,9 @@ function run_quadlet() { cp $sourcefile $quadlet_tmpdir/ echo "$_LOG_PROMPT $QUADLET $_DASHUSER $UNIT_DIR" - QUADLET_UNIT_DIRS="$quadlet_tmpdir" run $QUADLET $_DASHUSER $UNIT_DIR + QUADLET_UNIT_DIRS="$quadlet_tmpdir" run \ + timeout --foreground -v --kill=10 $PODMAN_TIMEOUT \ + $QUADLET $_DASHUSER $UNIT_DIR echo "$output" assert $status -eq 0 "Failed to convert quadlet file: $sourcefile" is "$output" "" "quadlet should report no errors" diff --git a/test/system/helpers.systemd.bash b/test/system/helpers.systemd.bash index c8a888bcc5..f4aebff910 100644 --- a/test/system/helpers.systemd.bash +++ b/test/system/helpers.systemd.bash @@ -22,15 +22,15 @@ fi mkdir -p $UNIT_DIR systemctl() { - command systemctl $_DASHUSER "$@" + timeout --foreground -v --kill=10 $PODMAN_TIMEOUT systemctl $_DASHUSER "$@" } journalctl() { - command journalctl $_DASHUSER "$@" + timeout --foreground -v --kill=10 $PODMAN_TIMEOUT journalctl $_DASHUSER "$@" } systemd-run() { - command systemd-run $_DASHUSER "$@"; + timeout --foreground -v --kill=10 $PODMAN_TIMEOUT systemd-run $_DASHUSER "$@"; } install_kube_template() {