From 120a77e39424d3921615cdf7c970f3b6c553123d Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 18 Oct 2022 10:24:46 -0600 Subject: [PATCH] testimage: add iproute2 & socat, for pasta networking PR #16141 introduces a new network type, "pasta". Its tests rely on running 'ip -j' and socat in the container. Add them. Also: bump to alpine 3.16.2 (from 3.16.0) Also: clean up apk cache, this saves us 2MB+ in the image Also (unrelated): clean up two broken uses of '$(< ...)' that are causing tests to blow up under bats 1.8 on my laptop New testimage is 20221018 and, sigh, is 12.7MB (up 4MB). Signed-off-by: Ed Santiago --- test/system/260-sdnotify.bats | 2 ++ test/system/270-socket-activation.bats | 2 +- test/system/build-testimage | 7 +++++-- test/system/helpers.bash | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/system/260-sdnotify.bats b/test/system/260-sdnotify.bats index c4724d6052..970a2e3c7c 100644 --- a/test/system/260-sdnotify.bats +++ b/test/system/260-sdnotify.bats @@ -41,7 +41,9 @@ function teardown() { function _start_socat() { _SOCAT_LOG="$PODMAN_TMPDIR/socat.log" + # Reset socat logfile to empty rm -f $_SOCAT_LOG + touch $_SOCAT_LOG # Execute in subshell so we can close fd3 (which BATS uses). # This is a superstitious ritual to try to avoid leaving processes behind, # and thus prevent CI hangs. diff --git a/test/system/270-socket-activation.bats b/test/system/270-socket-activation.bats index 6d582be180..a8ae234331 100644 --- a/test/system/270-socket-activation.bats +++ b/test/system/270-socket-activation.bats @@ -101,7 +101,7 @@ function teardown() { die "Pause pid file does not exist: $pause_pid_file" fi - echo "kill -9 $(< pause_pid_file)" + echo "kill -9 $(< $pause_pid_file) [pause process]" kill -9 $(< $pause_pid_file) run curl -s --max-time 3 --unix-socket $SERVICE_SOCK_ADDR $_PING diff --git a/test/system/build-testimage b/test/system/build-testimage index a0d831abb5..dcde2adfcc 100755 --- a/test/system/build-testimage +++ b/test/system/build-testimage @@ -61,6 +61,8 @@ chmod 755 pause # alpine because it's small and light and reliable # - check for updates @ https://hub.docker.com/_/alpine # busybox-extras provides httpd needed in 500-networking.bats +# iproute2 provides JSON output (not in busybox) for 505-networking-pasta.bats +# socat offers convenient UDP test termination in 505-networking-pasta.bats # # Two Containerfiles, because we have to do the image build in two parts, # which I think are easier to describe in reverse order: @@ -71,9 +73,10 @@ chmod 755 pause # cat >Containerfile1 <Containerfile2 <