Skip to content

Instantly share code, notes, and snippets.

@vepo
Last active September 9, 2017 12:40
Show Gist options
  • Save vepo/a908d7dba218bda687e2f1a63fda66e2 to your computer and use it in GitHub Desktop.
Save vepo/a908d7dba218bda687e2f1a63fda66e2 to your computer and use it in GitHub Desktop.
Execute JMeter test plans
#!/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