Last active
October 13, 2015 09:57
-
-
Save lhuard1A/2ce34aee6d1fdcbbb257 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm -f /tmp/concurrent_docker_pulls-* | |
declare -a childPid | |
readonly nbConcurrentPulls=30 | |
for i in $(eval echo "{1..$nbConcurrentPulls}"); do | |
docker run l3n41c/test-$i > /tmp/concurrent_docker_pulls-$i 2>&1 & | |
childPid[$i]=$! | |
done | |
for i in $(eval echo "{1..$nbConcurrentPulls}"); do | |
wait ${childPid[$i]} | |
done | |
result=ok | |
for i in $(eval echo "{1..$nbConcurrentPulls}"); do | |
if [[ $(tail -n1 /tmp/concurrent_docker_pulls-$i) != "Test $i" ]]; then | |
result=ko | |
fi | |
done | |
if [[ $result == "ok" ]]; then | |
echo "Success" | |
exit 0 | |
else | |
echo "Failed" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment