Skip to content

Instantly share code, notes, and snippets.

@dgarros
Created May 1, 2016 21:58
Show Gist options
  • Save dgarros/664d5b251a8ff449a235dd92f3b427a0 to your computer and use it in GitHub Desktop.
Save dgarros/664d5b251a8ff449a235dd92f3b427a0 to your computer and use it in GitHub Desktop.
#!/bin/bash
##
## This script will launch vagrant 10 times and measured how long it takes for the topology to boot up
## Topology will be destroyed after the test
c=1
while [ $c -le 10 ]
do
START=$(date +%s);
# echo "1- Launching VM"
vagrant up > vagrant_boottime.log 2>&1
END=$(date +%s);
TIME=$((END-START));
# echo "3- Destroying VM"
vagrant destroy -f > vagrant_boottime.log 2>&1
if [ $? -eq 0 ]
then
echo "$c | SUCCESS : VM Successfully Launched in $TIME sec"
else
echo "$c | FAILED : VM Launch Failed in $TIME sec"
fi
(( c++ ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment