diff options
author | Ed Santiago <santiago@redhat.com> | 2020-09-16 10:06:33 -0600 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2020-09-19 15:55:00 -0600 |
commit | bd3c66fc8151350ad6562959054eddb5508cf028 (patch) | |
tree | 487c34a3af99796784538929d8cc61a536a07622 /test/system/build-testimage | |
parent | 852943516606f32ccc2406f41bcf3df42d7c622c (diff) | |
download | podman-bd3c66fc8151350ad6562959054eddb5508cf028.tar.gz podman-bd3c66fc8151350ad6562959054eddb5508cf028.tar.bz2 podman-bd3c66fc8151350ad6562959054eddb5508cf028.zip |
system tests: new tests
- podman network create: new test
- podman pull by-sha + podman images -a (#7651)
- podman image mount: new test
- podman pod: --infra-image and --infra-command (#7167)
For convenience and robustness, build a new testimage
containing a custom file /home/podman/testimage-id
with contents YYYYMMDD (same as image tag). The
image-mount test checks that this file exists and
has the desired content. New testimage also includes
a dummy 'pause' executable, for testing pod infra.
Updates from testimage:20200902 to :20200917
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/build-testimage')
-rwxr-xr-x | test/system/build-testimage | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/test/system/build-testimage b/test/system/build-testimage index 64aa46337..ef14d3afd 100755 --- a/test/system/build-testimage +++ b/test/system/build-testimage @@ -26,23 +26,51 @@ create_time_z=$(env TZ=UTC date +'%Y-%m-%dT%H:%M:%SZ') set -ex +# We'll need to create a Containerfile plus various other files to add in +# # Please document the reason for all flags, apk's, and anything non-obvious +tmpdir=$(mktemp -t -d $(basename $0).tmp.XXXXXXX) +cd $tmpdir + +# 'image mount' test will confirm that this file exists and has our YMD tag +echo $YMD >testimage-id + +# 'pod' test will use this for --infra-command +cat >pause <<EOF +#!/bin/sh # -# --squash-all : needed by 'tree' test in 070-build.bats -# busybox-extras : provides httpd needed in 500-networking.bats +# Trivial little pause script, used in one of the pod tests # -podman rmi -f testimage &> /dev/null || true -podman build --squash-all -t testimage - <<EOF +echo Confirmed: testimage pause invoked as \$0 +while :; do + sleep 0.1 +done +EOF +chmod 755 pause + +# alpine because it's small and light and reliable +# busybox-extras provides httpd needed in 500-networking.bats +cat >Containerfile <<EOF FROM docker.io/library/alpine:3.12.0 RUN apk add busybox-extras +ADD testimage-id pause /home/podman/ LABEL created_by=$create_script LABEL created_at=$create_time_z +WORKDIR /home/podman CMD ["/bin/echo", "This container is intended for podman CI testing"] EOF +# --squash-all : needed by 'tree' test in 070-build.bats +podman rmi -f testimage &> /dev/null || true +podman build --squash-all -t testimage . + +# Clean up +cd /tmp +rm -rf $tmpdir + # Tag and push to quay. -podman tag testimage quay.io/edsantiago/testimage:$YMD -podman push quay.io/edsantiago/testimage:$YMD +podman tag testimage quay.io/libpod/testimage:$YMD +podman push quay.io/libpod/testimage:$YMD # Side note: there should always be a testimage tagged ':00000000' # (eight zeroes) in the same location; this is used by tests which @@ -54,6 +82,6 @@ podman push quay.io/edsantiago/testimage:$YMD # # podman pull docker.io/library/busybox:1.32.0 # podman tag docker.io/library/busybox:1.32.0 \ -# quay.io/edsantiago/testimage:00000000 -# podman push quay.io/edsantiago/testimage:00000000 +# quay.io/libpod/testimage:00000000 +# podman push quay.io/libpod/testimage:00000000 # |