Skip to content

Commit

Permalink
tests to cover locks and parallel execution #2551
Browse files Browse the repository at this point in the history
Signed-off-by: alsadi <[email protected]>
  • Loading branch information
muayyad-alsadi committed Mar 6, 2019
1 parent 40f7843 commit a67465b
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/test_podman_baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,52 @@ podman run $image java 2>&1 || echo $?
########
podman rm --all

########
# pull and run many containers in parallel, test locks ..etc.
########
podman rmi docker.io/library/busybox:latest > /dev/null || :
for i in `seq 10`
do ( podman run -d --name b$i docker.io/library/busybox:latest busybox httpd -f -p 80 )&
done
echo -e "\nwaiting for creation...\n"
wait
echo -e "\ndone\n"
# assert we have 10 running containers
count=$( podman ps -q | wc -l )
[ "x$count" == "x10" ] || { echo "was expecting 10 running containers"; exit -1; }

for i in `seq 10`; do ( podman stop -t=1 b$i; podman rm b$i )& done
echo -e "\nwaiting for deletion...\n"
wait
echo -e "\ndone\n"
# assert we have 0 running containers
count=$( podman ps -q | wc -l )
[ "x$count" == "x0" ] || { echo "was expecting 0 running containers"; exit -1; }


########
# run many containers in parallel for an existing image, test locks ..etc.
########
podman pull docker.io/library/busybox:latest > /dev/null || :
for i in `seq 10`
do ( podman run -d --name c$i docker.io/library/busybox:latest busybox httpd -f -p 80 )&
done
echo -e "\nwaiting for creation...\n"
wait
echo -e "\ndone\n"
# assert we have 10 running containers
count=$( podman ps -q | wc -l )
[ "x$count" == "x10" ] || { echo "was expecting 10 running containers"; exit -1; }

for i in `seq 10`; do ( podman stop -t=1 c$i; podman rm c$i )& done
echo -e "\nwaiting for deletion...\n"
wait
echo -e "\ndone\n"
# assert we have 0 running containers
count=$( podman ps -q | wc -l )
[ "x$count" == "x0" ] || { echo "was expecting 0 running containers"; exit -1; }


########
# Install java onto the container, commit it, then run it showing java usage
########
Expand Down

0 comments on commit a67465b

Please sign in to comment.