blob: 15f97e1cee5555d5301630e9da0902ff1c0534d8 [file] [log] [blame]
Tim Lindberg390c2dc2013-04-11 00:48:53 -07001#! /bin/bash
2DIR=${HOME}/ONOS
Tim Lindberg9ec5e222013-04-12 10:46:02 -07003echo "==== Reset Demo to the initial State ==="
4date
5start=`date +"%s"`
6echo "all link up.."
Tim Lindberg390c2dc2013-04-11 00:48:53 -07007$DIR/scripts/all-linkup-hw.sh
Tim Lindberg9ec5e222013-04-12 10:46:02 -07008echo "link up done"
9
10echo "cleanup excess flows"
Tim Lindberg390c2dc2013-04-11 00:48:53 -070011$DIR/web/delete_flow.py 201 300
Tim Lindberg9ec5e222013-04-12 10:46:02 -070012echo "cleanup excess flows done"
13echo "Adding 200 flows"
Tim Lindberg390c2dc2013-04-11 00:48:53 -070014$DIR/web/add_flow.py -m onos -f $DIR/web/flowdef_demo_start.txt
Tim Lindberg9ec5e222013-04-12 10:46:02 -070015echo "done"
16echo "killing iperf"
17dsh -g onos 'sudo pkill -KILL iperf'
18echo "done"
19echo "kill onos at 5 and 7"
Tim Lindberg390c2dc2013-04-11 00:48:53 -070020onos stop 5
21onos stop 7
Tim Lindberg9ec5e222013-04-12 10:46:02 -070022echo "done"
23echo "bringup 1 2 3 4 6 8 if dead"
Tim Lindberg390c2dc2013-04-11 00:48:53 -070024for i in 1 2 3 4 6 8; do
25 status=`onos status $i | grep instance | awk '{print $2}'`
26 echo "onos $i status $status"
27 if [ x$status == "x0" ]; then
28 onos start $i
29 fi
30done
Tim Lindberg9ec5e222013-04-12 10:46:02 -070031echo "done"
32
Tim Lindberg390c2dc2013-04-11 00:48:53 -070033sleep 2
34switch local
Tim Lindberg9ec5e222013-04-12 10:46:02 -070035endt=`date +"%s"`
36(( delta = endt -start ))
37echo "finish: took $delta sec"