Skip to content

Commit

Permalink
system tests: timeoutize quadlet, systemd
Browse files Browse the repository at this point in the history
Run $QUADLET and all systemctl/journalctl commands using 'timeout'.
Nothing should ever, ever take more than the default 2 minutes.

Followup to containers#18514, in which quadlet tests are found to be
taking 9-10 minutes.

Signed-off-by: Ed Santiago <[email protected]>
  • Loading branch information
edsantiago committed May 9, 2023
1 parent d49a537 commit d24bec0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion test/system/252-quadlet.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions test/system/helpers.systemd.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit d24bec0

Please sign in to comment.