-
Notifications
You must be signed in to change notification settings - Fork 1
/
launch_tests.sh
executable file
·42 lines (32 loc) · 1.26 KB
/
launch_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
set -e
usage() {
cat <<EOF
Latency tests script
This script launches latency test on <it> iterations with <cycles> PCAP replay
each.
Usage: multiple-tests.sh <it> <cycles> [target]
EOF
}
if [ -z "$2" ]; then
usage
exit 1
fi
SSH_OPTS="-i ~/.ssh/sfl-seapath -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
VM_HOST="[email protected]"
it="$1"
pcap_cyles="$2"
dev="$3"
sed -i "s/^\(\s\{28\}pcap_cycles:\s*\)[0-9]\+/\1$pcap_cyles/" seapath-inventories/fromveur/common.yaml
for ((i=1; i<=it; i++)); do
ssh $SSH_OPTS $VM_HOST reboot
sleep 120
if [ "$dev" == "vm" ]; then
ansible-playbook -i seapath-inventories/fromveur/common.yaml -i seapath-inventories/fromveur/vms.yaml playbooks/configure_latency_tests.yaml
ansible-playbook -i seapath-inventories/fromveur/common.yaml -i seapath-inventories/fromveur/vms.yaml playbooks/run_latency_tests.yaml
else
ansible-playbook -i seapath-inventories/fromveur/common.yaml -i seapath-inventories/fromveur/hyp.yaml playbooks/configure_latency_tests.yaml
ansible-playbook -i seapath-inventories/fromveur/common.yaml -i seapath-inventories/fromveur/hyp.yaml playbooks/run_latency_tests.yaml
fi
mv tests_results tests_results-$(date +%F_%Hh%Mm%S)
done