Skip to content

Commit

Permalink
Merge pull request #8 from srbala/fix-test-alpine
Browse files Browse the repository at this point in the history
Fix alpine version to keep same as build
  • Loading branch information
mgoltzsche authored Jun 4, 2021
2 parents 836eaa7 + 5e5cf8f commit 8bd480d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ storage-dir: clean-storage-dir
mkdir -pm 1777 test/storage/user

clean-storage-dir:
$(DOCKER) run --rm -v "`pwd`/test:/test" alpine:3.12 rm -rf /test/storage
$(DOCKER) run --rm -v "`pwd`/test:/test" alpine:3.13 rm -rf /test/storage

test-remote: podman podman-remote
PODMAN_IMAGE=$(PODMAN_IMAGE) \
Expand Down
2 changes: 1 addition & 1 deletion test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM alpine:3.12
FROM alpine:3.13
RUN echo hello
CMD [ "/bin/echo", "hello" ]
2 changes: 1 addition & 1 deletion test/test-local-rootful.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ echo
-u root:root \
-v "`pwd`/storage/root":/var/lib/containers/storage \
"${IMAGE}" \
-c 'podman run --rm alpine:3.12 wget -O /dev/null http://example.org')
-c 'podman run --rm alpine:3.13 wget -O /dev/null http://example.org')

echo
echo TEST PODMAN DOCKERFILE BUILD AS ROOT
Expand Down
8 changes: 4 additions & 4 deletions test/test-local-rootless.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ echo
(set -x; $DOCKER run --rm --privileged -u podman:podman \
-v "`pwd`/storage/user":/podman/.local/share/containers/storage \
"${IMAGE}" \
docker run --rm alpine:3.12 wget -O /dev/null http://example.org)
docker run --rm alpine:3.13 wget -O /dev/null http://example.org)

echo
echo TEST ${TEST_PREDICATE} PODMAN AS UNPRIVILEGED USER - UID MAPPING '(using fuse-overlayfs)'
echo
(set -x; $DOCKER run --rm --privileged -u podman:podman \
-v "`pwd`/storage/user":/podman/.local/share/containers/storage \
"${IMAGE}" \
docker run --rm alpine:3.12 /bin/sh -c 'set -ex; touch /file; chown guest /file; [ $(stat -c %U /file) = guest ]')
docker run --rm alpine:3.13 /bin/sh -c 'set -ex; touch /file; chown guest /file; [ $(stat -c %U /file) = guest ]')

if [ ! "$DOCKER" = podman ]; then # this doesn't work with podman (v3.0.1) due to missing uid mapping
echo
echo TEST ${TEST_PREDICATE} PODMAN AS UNPRIVILEGED USER WITH NON-DEFAULT UID '(no uid/gid mapping)'
echo
(set -x; $DOCKER run --rm --privileged --user 9000:9000 \
"${IMAGE}" \
docker run --rm alpine:3.12 wget -O /dev/null http://example.org)
docker run --rm alpine:3.13 wget -O /dev/null http://example.org)
fi

echo
Expand All @@ -38,7 +38,7 @@ echo
"${IMAGE}" \
-c 'set -e;
podman build -t podmantestimage -f - . <<-EOF
FROM alpine:3.12
FROM alpine:3.13
RUN echo hello world > /hello
CMD ["/bin/cat", "/hello"]
EOF')
Expand Down
2 changes: 1 addition & 1 deletion test/test-portmapping.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

set -eux

podman run -p 8081:8080 --rm alpine:3.12 /bin/sh -c "echo \$'#!/bin/sh\ntimeout 1 cat - >/dev/null; echo -e \\\"HTTP/1.1 200 OK\n\nup\\\"' > /tmp/healthy && chmod +x /tmp/healthy && timeout 9 nc -l -p 8080 -e /tmp/healthy" &
podman run -p 8081:8080 --rm alpine:3.13 /bin/sh -c "echo \$'#!/bin/sh\ntimeout 1 cat - >/dev/null; echo -e \\\"HTTP/1.1 200 OK\n\nup\\\"' > /tmp/healthy && chmod +x /tmp/healthy && timeout 9 nc -l -p 8080 -e /tmp/healthy" &
sleep 5
wget -O - localhost:8081
4 changes: 2 additions & 2 deletions test/test-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sleep 5
set -eu
$DOCKER run --rm --network=host -v "$(pwd):/build" \
"${PODMAN_REMOTE_IMAGE}" \
podman --url=tcp://$ADDRESS run alpine:3.12 echo hello from remote container
podman --url=tcp://$ADDRESS run alpine:3.13 echo hello from remote container

# ATTENTION: podman remote fails if it cannot map the uids/gids from the server locally as well (which is why podman-remote user has been added)
$DOCKER run --rm --network=host --user=podman-remote:podman-remote \
Expand All @@ -41,7 +41,7 @@ $DOCKER run --rm --network=host --user=podman-remote:podman-remote \
# "${PODMAN_REMOTE_IMAGE}" \
# sh -c "set -ex; \
# echo hello > myfile; \
# podman --url=tcp://$ADDRESS run -v \$(pwd)/myfile:/myfile alpine:3.12 cat /myfile"
# podman --url=tcp://$ADDRESS run -v \$(pwd)/myfile:/myfile alpine:3.13 cat /myfile"
)
STATUS=$?

Expand Down

0 comments on commit 8bd480d

Please sign in to comment.