blob: 8c586f5722dc9defd88d1c2e59101a4c0b8eb65b [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 -070012$DIR/web/clear_flow.py 201 300
13echo "cleanup excess flows done"
14echo "Adding 200 flows"
Tim Lindberg390c2dc2013-04-11 00:48:53 -070015$DIR/web/add_flow.py -m onos -f $DIR/web/flowdef_demo_start.txt
Tim Lindberg9ec5e222013-04-12 10:46:02 -070016echo "done"
17echo "killing iperf"
18dsh -g onos 'sudo pkill -KILL iperf'
19echo "done"
20echo "kill onos at 5 and 7"
Tim Lindberg390c2dc2013-04-11 00:48:53 -070021onos stop 5
22onos stop 7
Tim Lindberg9ec5e222013-04-12 10:46:02 -070023echo "done"
24echo "bringup 1 2 3 4 6 8 if dead"
Tim Lindberg390c2dc2013-04-11 00:48:53 -070025for 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
31done
Tim Lindberg9ec5e222013-04-12 10:46:02 -070032echo "done"
33
Tim Lindberg390c2dc2013-04-11 00:48:53 -070034sleep 2
35switch local
Tim Lindberg9ec5e222013-04-12 10:46:02 -070036endt=`date +"%s"`
37(( delta = endt -start ))
38echo "finish: took $delta sec"