Skip to content

Commit

Permalink
Merge pull request #24238 from edsantiago/pasta-bytecheck
Browse files Browse the repository at this point in the history
pasta udp tests: new bytecheck helper
  • Loading branch information
openshift-merge-bot[bot] authored Oct 17, 2024
2 parents b65f3b1 + fe96c84 commit 7d5377b
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
32 changes: 29 additions & 3 deletions test/apiv2/10-images.at
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,45 @@ t GET libpod/images/nonesuch/history 404
for i in $iid ${iid:0:12} $PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG; do
t GET libpod/images/$i/history 200 \
.[0].Id=$iid \
.[1].Id="<missing>" \
.[2].Id="<missing>" \
.[3].Id="<missing>" \
.[0].Created~[0-9]\\{10\\} \
.[0].Tags[0]="$IMAGE" \
.[0].Size=1024 \
.[0].Comment="FROM localhost/interim-image:latest"
.[1].Size=0 \
.[2].Size=0 \
.[3].Size=0 \
.[0].Comment="" \
.[1].Comment="" \
.[2].Comment="" \
.[3].Comment="FROM localhost/interim-image:latest" \
.[0].CreatedBy~".*/echo.*This container is intended for podman CI testing.*" \
.[1].CreatedBy~".* WORKDIR /home/podman" \
.[2].CreatedBy~".* LABEL created_at=.*" \
.[3].CreatedBy~".* LABEL created_by=test/system/build-testimage"
done

for i in $iid ${iid:0:12} $PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG; do
t GET images/$i/history 200 \
.[0].Id="sha256:"$iid \
.[0].Id="sha256:$iid" \
.[1].Id="sha256:<missing>" \
.[2].Id="sha256:<missing>" \
.[3].Id="sha256:<missing>" \
.[0].Created~[0-9]\\{10\\} \
.[0].Tags[0]="$IMAGE" \
.[0].Size=1024 \
.[0].Comment="FROM localhost/interim-image:latest"
.[1].Size=0 \
.[2].Size=0 \
.[3].Size=0 \
.[0].Comment="" \
.[1].Comment="" \
.[2].Comment="" \
.[3].Comment="FROM localhost/interim-image:latest" \
.[0].CreatedBy~".*/echo.*This container is intended for podman CI testing.*" \
.[1].CreatedBy~".* WORKDIR /home/podman" \
.[2].CreatedBy~".* LABEL created_at=.*" \
.[3].CreatedBy~".* LABEL created_by=test/system/build-testimage"
done

# compat api pull image unauthorized message error
Expand Down
2 changes: 1 addition & 1 deletion test/apiv2/20-containers.at
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ iid=$(jq -r '.Id' <<<"$output")
t GET libpod/images/$iid/json 200 \
.RepoTags[0]=null \
.Author="" \
.Comment=""
.Comment~"FROM docker\.io/.*"

# Commit a new image w/o tag
cparam="repo=newrepo&comment=foo&author=bob&format=docker"
Expand Down
2 changes: 1 addition & 1 deletion test/apiv2/test-apiv2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/config_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
2 changes: 1 addition & 1 deletion test/e2e/config_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
2 changes: 1 addition & 1 deletion test/e2e/config_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
4 changes: 2 additions & 2 deletions test/system/320-system-df.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions test/system/505-networking-pasta.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)"
Expand Down
29 changes: 27 additions & 2 deletions test/system/build-testimage
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/system/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

1 comment on commit 7d5377b

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.