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 | echo "cleanup excess flows done" |
| 13 | echo "Adding 200 flows" |
Tim Lindberg | 390c2dc | 2013-04-11 00:48:53 -0700 | [diff] [blame] | 14 | $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] | 15 | echo "done" |
| 16 | echo "killing iperf" |
| 17 | dsh -g onos 'sudo pkill -KILL iperf' |
| 18 | echo "done" |
| 19 | echo "kill onos at 5 and 7" |
Tim Lindberg | 390c2dc | 2013-04-11 00:48:53 -0700 | [diff] [blame] | 20 | onos stop 5 |
| 21 | onos stop 7 |
Tim Lindberg | 9ec5e22 | 2013-04-12 10:46:02 -0700 | [diff] [blame] | 22 | echo "done" |
| 23 | echo "bringup 1 2 3 4 6 8 if dead" |
Tim Lindberg | 390c2dc | 2013-04-11 00:48:53 -0700 | [diff] [blame] | 24 | for 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 |
| 30 | done |
Tim Lindberg | 9ec5e22 | 2013-04-12 10:46:02 -0700 | [diff] [blame] | 31 | echo "done" |
| 32 | |
Tim Lindberg | 390c2dc | 2013-04-11 00:48:53 -0700 | [diff] [blame] | 33 | sleep 2 |
| 34 | switch local |
Tim Lindberg | 9ec5e22 | 2013-04-12 10:46:02 -0700 | [diff] [blame] | 35 | endt=`date +"%s"` |
| 36 | (( delta = endt -start )) |
| 37 | echo "finish: took $delta sec" |