-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patholsr_experiment.sh
More file actions
executable file
·35 lines (27 loc) · 1011 Bytes
/
olsr_experiment.sh
File metadata and controls
executable file
·35 lines (27 loc) · 1011 Bytes
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
#!/usr/bin/env sh
nodes=$1
testbed="wilab"
delta_start=60
delta_stop=30
now=`date +%s`
start_time=$(($now + $delta_start))
times=""
for i in $(echo $nodes | sed -e "s/,/ /g")
do
time=`echo $i | cut -d'@' -f 2`
secs=`echo $time | cut -d'.' -f 1`
unix_time=$(($start_time + $secs))
if [ "$times" = "" ]; then
times=$unix_time
else
times="$times $unix_time"
fi
done
min_time=`echo $times | tr ' ' '\n' | sort -g | head -1`
max_time=`echo $times | tr ' ' '\n' | sort -g | tail -1`
stop_time=$(($max_time + $delta_stop))
echo "Experiment will start at `date -d @$start_time` and will end at `date -d @$stop_time`"
ansible-playbook start-olsr.yaml --extra-vars "testbed=$testbed"
ansible-playbook olsr_experiment.yaml --extra-vars "testbed=$testbed start=$start_time stop=$stop_time prefix=test interval=100"
ansible-playbook kill_myolsr.yaml --extra-vars "testbed=$testbed start=$start_time nodes=$nodes"
echo "Experiment will start at `date -d @$start_time` and will end at `date -d @$stop_time`"