mirror of https://github.com/containers/podman.git
Use multi-arch images in test case scripts
Signed-off-by: Harshal Patil <harshal.patil@in.ibm.com>
This commit is contained in:
parent
1e4db4b0b8
commit
13bcf72ae4
|
@ -60,7 +60,7 @@ podman ps --all
|
||||||
########
|
########
|
||||||
# Run ls in redis container, this should work
|
# Run ls in redis container, this should work
|
||||||
########
|
########
|
||||||
ctrid=$(podman pull registry.access.redhat.com/rhscl/redis-32-rhel7)
|
ctrid=$(podman pull docker.io/library/redis:4-alpine3.8)
|
||||||
podman run $ctrid ls /
|
podman run $ctrid ls /
|
||||||
|
|
||||||
########
|
########
|
||||||
|
@ -72,7 +72,7 @@ podman rmi --all
|
||||||
########
|
########
|
||||||
# Create Fedora based image
|
# Create Fedora based image
|
||||||
########
|
########
|
||||||
image=$(podman pull fedora)
|
image=$(podman pull registry.fedoraproject.org/fedora:latest)
|
||||||
echo $image
|
echo $image
|
||||||
|
|
||||||
########
|
########
|
||||||
|
@ -113,7 +113,7 @@ podman images
|
||||||
########
|
########
|
||||||
# Create Fedora based container
|
# Create Fedora based container
|
||||||
########
|
########
|
||||||
image=$(podman pull fedora)
|
image=$(podman pull registry.fedoraproject.org/fedora:latest)
|
||||||
echo $image
|
echo $image
|
||||||
podman run $image ls /
|
podman run $image ls /
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ mount -t xfs -o prjquota $device $TMPDIR
|
||||||
########
|
########
|
||||||
# Expected to succeed
|
# Expected to succeed
|
||||||
########
|
########
|
||||||
podman $PODMANBASE run --security-opt label=disable alpine sh -c 'touch file.txt && dd if=/dev/zero of=file.txt count=1048576 bs=1'
|
podman $PODMANBASE run --security-opt label=disable docker.io/library/alpine:latest sh -c 'touch file.txt && dd if=/dev/zero of=file.txt count=1048576 bs=1'
|
||||||
rc=$?
|
rc=$?
|
||||||
if [ $rc == 0 ];
|
if [ $rc == 0 ];
|
||||||
then
|
then
|
||||||
|
@ -221,7 +221,7 @@ fi
|
||||||
########
|
########
|
||||||
|
|
||||||
if [ "$showerror" -ne 1 ]; then
|
if [ "$showerror" -ne 1 ]; then
|
||||||
podman $PODMANBASE run --security-opt label=disable alpine sh -c 'touch file.txt && dd if=/dev/zero of=file.txt count=1048577 bs=1'
|
podman $PODMANBASE run --security-opt label=disable docker.io/library/alpine:latest sh -c 'touch file.txt && dd if=/dev/zero of=file.txt count=1048577 bs=1'
|
||||||
rc=$?
|
rc=$?
|
||||||
if [ $rc != 0 ];
|
if [ $rc != 0 ];
|
||||||
then
|
then
|
||||||
|
@ -283,7 +283,7 @@ chmod +x $FILE
|
||||||
########
|
########
|
||||||
FILE=./Dockerfile
|
FILE=./Dockerfile
|
||||||
/bin/cat <<EOM >$FILE
|
/bin/cat <<EOM >$FILE
|
||||||
FROM debian
|
FROM docker.io/library/debian:latest
|
||||||
ADD ./runtest.sh /runtest.sh
|
ADD ./runtest.sh /runtest.sh
|
||||||
EOM
|
EOM
|
||||||
chmod +x $FILE
|
chmod +x $FILE
|
||||||
|
@ -327,7 +327,7 @@ rm -f ./Dockerfile
|
||||||
########
|
########
|
||||||
FILE=./Dockerfile
|
FILE=./Dockerfile
|
||||||
/bin/cat <<EOM >$FILE
|
/bin/cat <<EOM >$FILE
|
||||||
FROM alpine
|
FROM docker.io/library/alpine:latest
|
||||||
RUN touch /foo
|
RUN touch /foo
|
||||||
ONBUILD RUN touch /bar
|
ONBUILD RUN touch /bar
|
||||||
EOM
|
EOM
|
||||||
|
@ -363,7 +363,7 @@ rm ./Dockerfile*
|
||||||
########
|
########
|
||||||
if aa-enabled >/dev/null && getent passwd 1000 >/dev/null; then
|
if aa-enabled >/dev/null && getent passwd 1000 >/dev/null; then
|
||||||
# Expected to succeed
|
# Expected to succeed
|
||||||
sudo -u "#1000" podman run alpine echo hello
|
sudo -u "#1000" podman run docker.io/library/alpine:latest echo hello
|
||||||
rc=$?
|
rc=$?
|
||||||
echo -n "rootless with no AppArmor profile "
|
echo -n "rootless with no AppArmor profile "
|
||||||
if [ $rc == 0 ]; then
|
if [ $rc == 0 ]; then
|
||||||
|
@ -373,7 +373,7 @@ if aa-enabled >/dev/null && getent passwd 1000 >/dev/null; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Expected to succeed
|
# Expected to succeed
|
||||||
sudo -u "#1000" podman run --security-opt apparmor=unconfined alpine echo hello
|
sudo -u "#1000" podman run --security-opt apparmor=unconfined docker.io/library/alpine:latest echo hello
|
||||||
rc=$?
|
rc=$?
|
||||||
echo -n "rootless with unconfined AppArmor profile "
|
echo -n "rootless with unconfined AppArmor profile "
|
||||||
if [ $rc == 0 ]; then
|
if [ $rc == 0 ]; then
|
||||||
|
@ -402,7 +402,7 @@ EOF
|
||||||
apparmor_parser -Kr $aaFile
|
apparmor_parser -Kr $aaFile
|
||||||
|
|
||||||
#Expected to pass (as root)
|
#Expected to pass (as root)
|
||||||
podman run --security-opt apparmor=$aaProfile alpine echo hello
|
podman run --security-opt apparmor=$aaProfile docker.io/library/alpine:latest echo hello
|
||||||
rc=$?
|
rc=$?
|
||||||
echo -n "root with specified AppArmor profile: "
|
echo -n "root with specified AppArmor profile: "
|
||||||
if [ $rc == 0 ]; then
|
if [ $rc == 0 ]; then
|
||||||
|
@ -412,7 +412,7 @@ EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Expected to fail (as rootless)
|
#Expected to fail (as rootless)
|
||||||
sudo -u "#1000" podman run --security-opt apparmor=$aaProfile alpine echo hello
|
sudo -u "#1000" podman run --security-opt apparmor=$aaProfile docker.io/library/alpine:latest echo hello
|
||||||
rc=$?
|
rc=$?
|
||||||
echo -n "rootless with specified AppArmor profile: "
|
echo -n "rootless with specified AppArmor profile: "
|
||||||
if [ $rc != 0 ]; then
|
if [ $rc != 0 ]; then
|
||||||
|
@ -437,7 +437,7 @@ fi
|
||||||
########
|
########
|
||||||
FILE=./Dockerfile
|
FILE=./Dockerfile
|
||||||
/bin/cat <<EOM >$FILE
|
/bin/cat <<EOM >$FILE
|
||||||
FROM docker/whalesay:latest
|
FROM pharshal/whalesay:latest
|
||||||
RUN apt-get -y update && apt-get install -y fortunes
|
RUN apt-get -y update && apt-get install -y fortunes
|
||||||
CMD /usr/games/fortune -a | cowsay
|
CMD /usr/games/fortune -a | cowsay
|
||||||
EOM
|
EOM
|
||||||
|
|
|
@ -60,8 +60,8 @@ podman ps --no-trunc | grep $ctrid
|
||||||
########
|
########
|
||||||
# Containers in a pod share network namespace
|
# Containers in a pod share network namespace
|
||||||
########
|
########
|
||||||
podman run -dt --pod foobar quay.io/baude/alpine_nginx:latest
|
podman run -dt --pod foobar docker.io/library/nginx:latest
|
||||||
podman run -it --rm --pod foobar fedora-minimal:28 curl http://localhost
|
podman run -it --rm --pod foobar registry.fedoraproject.org/fedora-minimal:29 curl http://localhost
|
||||||
|
|
||||||
########
|
########
|
||||||
# There should be 3 containers running now
|
# There should be 3 containers running now
|
||||||
|
@ -91,7 +91,7 @@ podman pod stop foobar
|
||||||
# Start a pod and its containers
|
# Start a pod and its containers
|
||||||
########
|
########
|
||||||
podman pod start foobar
|
podman pod start foobar
|
||||||
podman run -it --rm --pod foobar fedora-minimal:28 curl http://localhost
|
podman run -it --rm --pod foobar registry.fedoraproject.org/fedora-minimal:29 curl http://localhost
|
||||||
|
|
||||||
########
|
########
|
||||||
# Pause a pod and its containers
|
# Pause a pod and its containers
|
||||||
|
@ -103,7 +103,7 @@ podman pod pause foobar
|
||||||
# Unpause a pod and its containers
|
# Unpause a pod and its containers
|
||||||
########
|
########
|
||||||
podman pod unpause foobar
|
podman pod unpause foobar
|
||||||
podman run -it --rm --pod foobar fedora-minimal:28 curl http://localhost
|
podman run -it --rm --pod foobar registry.fedoraproject.org/fedora-minimal:29 curl http://localhost
|
||||||
|
|
||||||
########
|
########
|
||||||
# Kill a pod and its containers
|
# Kill a pod and its containers
|
||||||
|
|
Loading…
Reference in New Issue