summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralsadi <alsadi@gmail.com>2019-03-06 09:00:01 +0200
committeralsadi <alsadi@gmail.com>2019-03-07 09:00:33 +0200
commitf0c146c7726110e5a45a8bbb67de6bc657691ad5 (patch)
treefcadd7373dedad25027ef62fb7f1864b43b54d62
parent614409f64464db8022e9dc3bb0b84816ad287781 (diff)
downloadpodman-f0c146c7726110e5a45a8bbb67de6bc657691ad5.tar.gz
podman-f0c146c7726110e5a45a8bbb67de6bc657691ad5.tar.bz2
podman-f0c146c7726110e5a45a8bbb67de6bc657691ad5.zip
tests to cover locks and parallel execution #2551
Signed-off-by: alsadi <alsadi@gmail.com>
-rwxr-xr-xtest/test_podman_baseline.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/test_podman_baseline.sh b/test/test_podman_baseline.sh
index 664fd2b03..27c0c9178 100755
--- a/test/test_podman_baseline.sh
+++ b/test/test_podman_baseline.sh
@@ -91,6 +91,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
########
podman run --net=host $image dnf -y install java