From 53db71e8a1a01a4d4e22973e1bab80ff3b746191 Mon Sep 17 00:00:00 2001 From: alsadi Date: Wed, 6 Mar 2019 09:00:01 +0200 Subject: [PATCH 1/2] tests to cover locks and parallel execution #2551 --- test/test_podman_baseline.sh | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/test/test_podman_baseline.sh b/test/test_podman_baseline.sh index 664fd2b035..27c0c9178b 100755 --- a/test/test_podman_baseline.sh +++ b/test/test_podman_baseline.sh @@ -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 ######## From a67465b21c2931b553ec5128458461a641247833 Mon Sep 17 00:00:00 2001 From: alsadi Date: Wed, 6 Mar 2019 09:00:01 +0200 Subject: [PATCH 2/2] tests to cover locks and parallel execution #2551 Signed-off-by: alsadi --- test/test_podman_baseline.sh | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/test/test_podman_baseline.sh b/test/test_podman_baseline.sh index 664fd2b035..27c0c9178b 100755 --- a/test/test_podman_baseline.sh +++ b/test/test_podman_baseline.sh @@ -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 ########