Last active
September 9, 2017 12:40
-
-
Save vepo/a908d7dba218bda687e2f1a63fda66e2 to your computer and use it in GitHub Desktop.
Execute JMeter test plans
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 | |
SLAVE_IP=$(docker inspect -f '{{.Name}} {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq) | grep slave | awk -F' ' '{print $2}' | tr '\n' ',' | sed 's/.$//') | |
WDIR=`docker exec -it master /bin/pwd | tr -d '\r'` | |
mkdir -p results | |
for filename in scripts/*.jmx; do | |
NAME=$(basename $filename) | |
NAME="${NAME%.*}" | |
eval "docker cp $filename master:$WDIR/scripts/" | |
eval "docker exec -it master /bin/bash -c 'mkdir $NAME && cd $NAME && ../bin/jmeter -n -t ../$filename -R$SLAVE_IP'" | |
eval "docker cp master:$WDIR/$NAME results/" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment