Tim Lindberg | 390c2dc | 2013-04-11 00:48:53 -0700 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | DIR=${HOME}/ONOS |
Tim Lindberg | 9ec5e22 | 2013-04-12 10:46:02 -0700 | [diff] [blame] | 3 | echo "==== Reset Demo to the initial State ===" |
| 4 | date |
| 5 | start=`date +"%s"` |
| 6 | echo "all link up.." |
Tim Lindberg | 390c2dc | 2013-04-11 00:48:53 -0700 | [diff] [blame] | 7 | $DIR/scripts/all-linkup-hw.sh |
Tim Lindberg | 9ec5e22 | 2013-04-12 10:46:02 -0700 | [diff] [blame] | 8 | echo "link up done" |
| 9 | |
| 10 | echo "cleanup excess flows" |
Tim Lindberg | 390c2dc | 2013-04-11 00:48:53 -0700 | [diff] [blame] | 11 | $DIR/web/delete_flow.py 201 300 |
Tim Lindberg | 9ec5e22 | 2013-04-12 10:46:02 -0700 | [diff] [blame] | 12 | $DIR/web/clear_flow.py 201 300 |
| 13 | echo "cleanup excess flows done" |
| 14 | echo "Adding 200 flows" |
Tim Lindberg | 390c2dc | 2013-04-11 00:48:53 -0700 | [diff] [blame] | 15 | $DIR/web/add_flow.py -m onos -f $DIR/web/flowdef_demo_start.txt |
Tim Lindberg | 9ec5e22 | 2013-04-12 10:46:02 -0700 | [diff] [blame] | 16 | echo "done" |
| 17 | echo "killing iperf" |
| 18 | dsh -g onos 'sudo pkill -KILL iperf' |
| 19 | echo "done" |
| 20 | echo "kill onos at 5 and 7" |
Tim Lindberg | 390c2dc | 2013-04-11 00:48:53 -0700 | [diff] [blame] | 21 | onos stop 5 |
| 22 | onos stop 7 |
Tim Lindberg | 9ec5e22 | 2013-04-12 10:46:02 -0700 | [diff] [blame] | 23 | echo "done" |
| 24 | echo "bringup 1 2 3 4 6 8 if dead" |
Tim Lindberg | 390c2dc | 2013-04-11 00:48:53 -0700 | [diff] [blame] | 25 | for i in 1 2 3 4 6 8; do |
| 26 | status=`onos status $i | grep instance | awk '{print $2}'` |
| 27 | echo "onos $i status $status" |
| 28 | if [ x$status == "x0" ]; then |
| 29 | onos start $i |
| 30 | fi |
| 31 | done |
Tim Lindberg | 9ec5e22 | 2013-04-12 10:46:02 -0700 | [diff] [blame] | 32 | echo "done" |
| 33 | |
Tim Lindberg | 390c2dc | 2013-04-11 00:48:53 -0700 | [diff] [blame] | 34 | sleep 2 |
| 35 | switch local |
Tim Lindberg | 9ec5e22 | 2013-04-12 10:46:02 -0700 | [diff] [blame] | 36 | endt=`date +"%s"` |
| 37 | (( delta = endt -start )) |
| 38 | echo "finish: took $delta sec" |