pasta udp tests: new bytecheck helper

...for debugging #24147, because "md5sum mismatch" is not
the best way to troubleshoot bytestream differences.

socat is run on the container, so this requires building a
new testimage (20241011). Bump to new CI VMs[1] which include it.

 [1] https://github.com/containers/automation_images/pull/389

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2024-10-09 18:01:54 -06:00
parent b65f3b19a5
commit 67e39c1ec5
9 changed files with 42 additions and 12 deletions

View File

@ -33,7 +33,7 @@ env:
DEBIAN_NAME: "debian-13" DEBIAN_NAME: "debian-13"
# Image identifiers # Image identifiers
IMAGE_SUFFIX: "c20241015t085508z-f40f39d13" IMAGE_SUFFIX: "c20241016t144444z-f40f39d13"
# EC2 images # EC2 images
FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}" FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}"

View File

@ -12,7 +12,7 @@ ME=$(basename $0)
PODMAN_TEST_IMAGE_REGISTRY=${PODMAN_TEST_IMAGE_REGISTRY:-"quay.io"} PODMAN_TEST_IMAGE_REGISTRY=${PODMAN_TEST_IMAGE_REGISTRY:-"quay.io"}
PODMAN_TEST_IMAGE_USER=${PODMAN_TEST_IMAGE_USER:-"libpod"} PODMAN_TEST_IMAGE_USER=${PODMAN_TEST_IMAGE_USER:-"libpod"}
PODMAN_TEST_IMAGE_NAME=${PODMAN_TEST_IMAGE_NAME:-"testimage"} PODMAN_TEST_IMAGE_NAME=${PODMAN_TEST_IMAGE_NAME:-"testimage"}
PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20240123"} PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20241011"}
PODMAN_TEST_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG" PODMAN_TEST_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG"
IMAGE=$PODMAN_TEST_IMAGE_FQN IMAGE=$PODMAN_TEST_IMAGE_FQN

View File

@ -10,7 +10,7 @@ var (
NGINX_IMAGE = "quay.io/libpod/alpine_nginx:latest" //nolint:revive,stylecheck NGINX_IMAGE = "quay.io/libpod/alpine_nginx:latest" //nolint:revive,stylecheck
BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck
REGISTRY_IMAGE = "quay.io/libpod/registry:2.8.2" //nolint:revive,stylecheck REGISTRY_IMAGE = "quay.io/libpod/registry:2.8.2" //nolint:revive,stylecheck
CITEST_IMAGE = "quay.io/libpod/testimage:20240123" //nolint:revive,stylecheck CITEST_IMAGE = "quay.io/libpod/testimage:20241011" //nolint:revive,stylecheck
SYSTEMD_IMAGE = "quay.io/libpod/systemd-image:20240124" //nolint:revive,stylecheck SYSTEMD_IMAGE = "quay.io/libpod/systemd-image:20240124" //nolint:revive,stylecheck
CIRROS_IMAGE = "quay.io/libpod/cirros:latest" //nolint:revive,stylecheck CIRROS_IMAGE = "quay.io/libpod/cirros:latest" //nolint:revive,stylecheck
) )

View File

@ -10,7 +10,7 @@ var (
NGINX_IMAGE = "quay.io/lsm5/alpine_nginx-aarch64:latest" //nolint:revive,stylecheck NGINX_IMAGE = "quay.io/lsm5/alpine_nginx-aarch64:latest" //nolint:revive,stylecheck
BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck
REGISTRY_IMAGE = "quay.io/libpod/registry:2.8.2" //nolint:revive,stylecheck REGISTRY_IMAGE = "quay.io/libpod/registry:2.8.2" //nolint:revive,stylecheck
CITEST_IMAGE = "quay.io/libpod/testimage:20240123" //nolint:revive,stylecheck CITEST_IMAGE = "quay.io/libpod/testimage:20241011" //nolint:revive,stylecheck
SYSTEMD_IMAGE = "quay.io/libpod/systemd-image:20240124" //nolint:revive,stylecheck SYSTEMD_IMAGE = "quay.io/libpod/systemd-image:20240124" //nolint:revive,stylecheck
CIRROS_IMAGE = "quay.io/libpod/cirros:latest" //nolint:revive,stylecheck CIRROS_IMAGE = "quay.io/libpod/cirros:latest" //nolint:revive,stylecheck
) )

View File

@ -9,6 +9,6 @@ var (
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, NGINX_IMAGE, REDIS_IMAGE, INFRA_IMAGE, CITEST_IMAGE} CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, NGINX_IMAGE, REDIS_IMAGE, INFRA_IMAGE, CITEST_IMAGE}
NGINX_IMAGE = "quay.io/libpod/alpine_nginx-ppc64le:latest" NGINX_IMAGE = "quay.io/libpod/alpine_nginx-ppc64le:latest"
BB_GLIBC = "docker.io/ppc64le/busybox:glibc" BB_GLIBC = "docker.io/ppc64le/busybox:glibc"
CITEST_IMAGE = "quay.io/libpod/testimage:20240123" CITEST_IMAGE = "quay.io/libpod/testimage:20241011"
REGISTRY_IMAGE string REGISTRY_IMAGE string
) )

View File

@ -45,9 +45,9 @@ function setup_file() {
local results="$output" local results="$output"
# FIXME! This needs to be fiddled with every time we bump testimage. # FIXME! This needs to be fiddled with every time we bump testimage.
local size=11 local size=12
if [[ "$(uname -m)" = "aarch64" ]]; then if [[ "$(uname -m)" = "aarch64" ]]; then
size=13 size=14
fi fi
# FIXME: we can't check exact RawSize or Size because every CI system # FIXME: we can't check exact RawSize or Size because every CI system

View File

@ -174,10 +174,14 @@ function pasta_test_do() {
fi fi
# socat options for second <address> in server ("STDOUT" or "EXEC"), # socat options for second <address> in server ("STDOUT" or "EXEC"),
local recvhelper=
if [ "${bytes}" = "1" ]; then if [ "${bytes}" = "1" ]; then
recv="STDOUT" recv="STDOUT"
else else
recv="EXEC:md5sum" # To ease debugging in case of problems, use a helper that
# gives us byte count, hash, and first/last few bytes
recvhelper=/home/podman/bytecheck
recv="EXEC:$recvhelper"
fi fi
# and port forwarding configuration for Podman and pasta. # and port forwarding configuration for Podman and pasta.
@ -202,7 +206,8 @@ function pasta_test_do() {
# Fill in file for data transfer tests, and expected output strings # Fill in file for data transfer tests, and expected output strings
if [ "${bytes}" != "1" ]; then if [ "${bytes}" != "1" ]; then
dd if=/dev/urandom bs=${bytes} count=1 of="${XFER_FILE}" dd if=/dev/urandom bs=${bytes} count=1 of="${XFER_FILE}"
local expect="$(cat "${XFER_FILE}" | md5sum)" run_podman run -i --rm $IMAGE $recvhelper < ${XFER_FILE}
local expect="$output"
else else
printf "x" > "${XFER_FILE}" printf "x" > "${XFER_FILE}"
local expect="$(for i in $(seq ${seq}); do printf "x"; done)" local expect="$(for i in $(seq ${seq}); do printf "x"; done)"

View File

@ -79,6 +79,31 @@ fi
EOF EOF
chmod 755 healthcheck chmod 755 healthcheck
# Another helper; used in pasta tests for comparing bytestream data
cat >bytecheck <<'EOF'
#!/bin/sh
#
# Helper script for comparing bytestream data. Shows data size,
# md5sum, and first/last eight bytes. Because plain md5sum is
# not very helpful in identifying where things went wrong.
#
# Reads stream from stdin, writes summary to stdout
#
tmpfile=`mktemp bytecheck.XXXXXXX`
cat >$tmpfile
size=`stat -c %s $tmpfile`
hash=`md5sum <$tmpfile`
odl=`head -c8 $tmpfile | od -An -tx1`
odr=`tail -c8 $tmpfile | od -An -tx1`
rm -f $tmpfile
echo size=$size hash=$hash head=$odl tail=$odr
EOF
chmod 755 bytecheck
# alpine because it's small and light and reliable # alpine because it's small and light and reliable
# - check for updates @ https://hub.docker.com/_/alpine # - check for updates @ https://hub.docker.com/_/alpine
# busybox-extras provides httpd needed in 500-networking.bats # busybox-extras provides httpd needed in 500-networking.bats
@ -94,9 +119,9 @@ chmod 755 healthcheck
# #
cat >Containerfile1 <<EOF cat >Containerfile1 <<EOF
ARG REPO=please-override-repo ARG REPO=please-override-repo
FROM docker.io/\${REPO}/alpine:3.19.0 FROM docker.io/\${REPO}/alpine:3.20.3
RUN apk add busybox-extras iproute2 socat RUN apk add busybox-extras iproute2 socat
ADD testimage-id healthcheck pause /home/podman/ ADD testimage-id healthcheck pause bytecheck /home/podman/
RUN rm -f /var/cache/apk/* RUN rm -f /var/cache/apk/*
EOF EOF

View File

@ -14,7 +14,7 @@ PODMAN_RUNTIME=
PODMAN_TEST_IMAGE_REGISTRY=${PODMAN_TEST_IMAGE_REGISTRY:-"quay.io"} PODMAN_TEST_IMAGE_REGISTRY=${PODMAN_TEST_IMAGE_REGISTRY:-"quay.io"}
PODMAN_TEST_IMAGE_USER=${PODMAN_TEST_IMAGE_USER:-"libpod"} PODMAN_TEST_IMAGE_USER=${PODMAN_TEST_IMAGE_USER:-"libpod"}
PODMAN_TEST_IMAGE_NAME=${PODMAN_TEST_IMAGE_NAME:-"testimage"} PODMAN_TEST_IMAGE_NAME=${PODMAN_TEST_IMAGE_NAME:-"testimage"}
PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20240123"} PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20241011"}
PODMAN_TEST_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG" PODMAN_TEST_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG"
# Larger image containing systemd tools. # Larger image containing systemd tools.