mirror of
https://github.com/containers/podman.git
synced 2025-07-04 10:10:32 +08:00
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:
@ -33,7 +33,7 @@ env:
|
||||
DEBIAN_NAME: "debian-13"
|
||||
|
||||
# Image identifiers
|
||||
IMAGE_SUFFIX: "c20241015t085508z-f40f39d13"
|
||||
IMAGE_SUFFIX: "c20241016t144444z-f40f39d13"
|
||||
|
||||
# EC2 images
|
||||
FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}"
|
||||
|
@ -12,7 +12,7 @@ ME=$(basename $0)
|
||||
PODMAN_TEST_IMAGE_REGISTRY=${PODMAN_TEST_IMAGE_REGISTRY:-"quay.io"}
|
||||
PODMAN_TEST_IMAGE_USER=${PODMAN_TEST_IMAGE_USER:-"libpod"}
|
||||
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"
|
||||
|
||||
IMAGE=$PODMAN_TEST_IMAGE_FQN
|
||||
|
@ -10,7 +10,7 @@ var (
|
||||
NGINX_IMAGE = "quay.io/libpod/alpine_nginx:latest" //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
|
||||
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
|
||||
CIRROS_IMAGE = "quay.io/libpod/cirros:latest" //nolint:revive,stylecheck
|
||||
)
|
||||
|
@ -10,7 +10,7 @@ var (
|
||||
NGINX_IMAGE = "quay.io/lsm5/alpine_nginx-aarch64:latest" //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
|
||||
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
|
||||
CIRROS_IMAGE = "quay.io/libpod/cirros:latest" //nolint:revive,stylecheck
|
||||
)
|
||||
|
@ -9,6 +9,6 @@ var (
|
||||
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, NGINX_IMAGE, REDIS_IMAGE, INFRA_IMAGE, CITEST_IMAGE}
|
||||
NGINX_IMAGE = "quay.io/libpod/alpine_nginx-ppc64le:latest"
|
||||
BB_GLIBC = "docker.io/ppc64le/busybox:glibc"
|
||||
CITEST_IMAGE = "quay.io/libpod/testimage:20240123"
|
||||
CITEST_IMAGE = "quay.io/libpod/testimage:20241011"
|
||||
REGISTRY_IMAGE string
|
||||
)
|
||||
|
@ -45,9 +45,9 @@ function setup_file() {
|
||||
local results="$output"
|
||||
|
||||
# FIXME! This needs to be fiddled with every time we bump testimage.
|
||||
local size=11
|
||||
local size=12
|
||||
if [[ "$(uname -m)" = "aarch64" ]]; then
|
||||
size=13
|
||||
size=14
|
||||
fi
|
||||
|
||||
# FIXME: we can't check exact RawSize or Size because every CI system
|
||||
|
@ -174,10 +174,14 @@ function pasta_test_do() {
|
||||
fi
|
||||
|
||||
# socat options for second <address> in server ("STDOUT" or "EXEC"),
|
||||
local recvhelper=
|
||||
if [ "${bytes}" = "1" ]; then
|
||||
recv="STDOUT"
|
||||
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
|
||||
|
||||
# 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
|
||||
if [ "${bytes}" != "1" ]; then
|
||||
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
|
||||
printf "x" > "${XFER_FILE}"
|
||||
local expect="$(for i in $(seq ${seq}); do printf "x"; done)"
|
||||
|
@ -79,6 +79,31 @@ fi
|
||||
EOF
|
||||
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
|
||||
# - check for updates @ https://hub.docker.com/_/alpine
|
||||
# busybox-extras provides httpd needed in 500-networking.bats
|
||||
@ -94,9 +119,9 @@ chmod 755 healthcheck
|
||||
#
|
||||
cat >Containerfile1 <<EOF
|
||||
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
|
||||
ADD testimage-id healthcheck pause /home/podman/
|
||||
ADD testimage-id healthcheck pause bytecheck /home/podman/
|
||||
RUN rm -f /var/cache/apk/*
|
||||
EOF
|
||||
|
||||
|
@ -14,7 +14,7 @@ PODMAN_RUNTIME=
|
||||
PODMAN_TEST_IMAGE_REGISTRY=${PODMAN_TEST_IMAGE_REGISTRY:-"quay.io"}
|
||||
PODMAN_TEST_IMAGE_USER=${PODMAN_TEST_IMAGE_USER:-"libpod"}
|
||||
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"
|
||||
|
||||
# Larger image containing systemd tools.
|
||||
|
Reference in New Issue
Block a user