Added demo scripts
diff --git a/demo-scripts/Sprint-4/cleanup.sh b/demo-scripts/Sprint-4/cleanup.sh
new file mode 100755
index 0000000..9e05b43
--- /dev/null
+++ b/demo-scripts/Sprint-4/cleanup.sh
@@ -0,0 +1,28 @@
+#! /bin/sh
+CLUSTER=/home/masayosi/bin/hosts-3x3.txt
+function ilink_up {
+ echo "add link at $2"
+ n=`dsh -w $1 "sudo tc qdisc show dev $2" | grep netem | wc -l`
+ if [ $n -eq 1 ]; then
+ echo "dsh -w $1 sudo tc qdisc change dev $2 root netem loss 0%"
+ dsh -w $1 "sudo tc qdisc change dev $2 root netem loss 0%"
+ else
+ echo "dsh -w $1 sudo tc qdisc add dev $2 root netem loss 0%"
+ dsh -w $1 "sudo tc qdisc add dev $2 root netem loss 0%"
+ fi
+ echo "done"
+}
+
+ilink_up onos9vpc tapa0
+ilink_up onos10vpc tapb0
+ilink_up onos10vpc tapb1
+ilink_up onos11vpc tapc0
+
+#echo "stopping mininet"
+#dsh -g onos 'sudo mn -c'
+echo "stopping ONOS"
+dsh -g onos 'cd ONOS; ./start-onos.sh stop'
+echo "stopping Cassandra"
+dsh -g onos 'cd ONOS; ./start-cassandra.sh stop'
+echo "Removing Cassandra DB"
+dsh -g onos 'sudo rm -rf /var/lib/cassandra/*'
diff --git a/demo-scripts/Sprint-4/demo-prep.sh b/demo-scripts/Sprint-4/demo-prep.sh
new file mode 100755
index 0000000..80c3aa4
--- /dev/null
+++ b/demo-scripts/Sprint-4/demo-prep.sh
@@ -0,0 +1,69 @@
+#! /bin/bash
+export CLUSTER=/home/masayosi/bin/hosts-3x3.txt
+function cmd {
+while [ 1 ] ; do
+ $@
+ echo "Continue? [y/n]:"
+ read -t 2 value
+ if [ x$value == "xy" ]; then
+ break;
+ fi
+ sleep 1
+done
+}
+
+./start-onos.sh 'onos9vpc,onos10vpc,onos11vpc,onos12vpc' stop
+./start-onos.sh 'onos9vpc,onos10vpc,onos11vpc,onos12vpc' status
+#./start-cassandra.sh 'onos9vpc' start
+#sleep 2
+#./start-cassandra.sh 'onos10vpc,onos11vpc,onos12vpc' start
+
+dsh -w onos9vpc 'cd ONOS;./clean-cassandra.sh'
+cmd ./start-cassandra.sh onos9vpc status
+sleep 5
+echo "Set mininet local"
+dsh -g onos 'ONOS/ctrl-none.sh'
+echo "Start ONOS on 9, 10 and 12"
+./start-onos.sh 'onos9vpc' start
+sleep 1
+./start-onos.sh 'onos10vpc' start
+sleep 1
+./start-onos.sh 'onos12vpc' start
+while [ 1 ] ; do
+ ./start-onos.sh 'onos9vpc,onos10vpc,onos12vpc' status
+ echo "Continue? [y/s/n]:"
+ read -t 2 value
+ if [ x$value == "xy" ]; then
+ break;
+ elif [ x$value == "xs" ]; then
+ ./start-onos.sh 'onos9vpc,onos10vpc,onos12vpc' start
+ fi
+ sleep 1
+done
+sleep 2
+dsh -g onos 'ONOS/ctrl-local.sh'
+#sleep 2
+#./start-onos.sh 'onos9vpc,onos10vpc,onos12vpc' start
+while [ 1 ] ; do
+ ./start-onos.sh 'onos9vpc,onos10vpc,onos12vpc' status
+ echo "Continue? [y/s/n]:"
+ read -t 2 value
+ if [ x$value == "xy" ]; then
+ break;
+ elif [ x$value == "xs" ]; then
+ ./start-onos.sh 'onos9vpc,onos10vpc,onos12vpc' start
+ fi
+ sleep 1
+done
+#cmd dsh -w onos9vpc,onos10vpc 'ONOS/ctrl-add-ext.sh'
+#while [ 1 ] ; do
+# ./start-onos.sh 'onos9vpc,onos10vpc,onos12vpc' status
+# echo "Continue? [y/n]:"
+# read -t 2 value
+# if [ x$value == "xy" ]; then
+# break;
+# fi
+# sleep 1
+#done
+#dsh -w onos9vpc,onos10vpc 'ONOS/ctrl-add-ext.sh'
+#sleep 1
diff --git a/demo-scripts/Sprint-4/demo.sh b/demo-scripts/Sprint-4/demo.sh
new file mode 100755
index 0000000..a835daf
--- /dev/null
+++ b/demo-scripts/Sprint-4/demo.sh
@@ -0,0 +1,43 @@
+#! /bin/bash
+export CLUSTER=/home/masayosi/bin/hosts-3x3.txt
+function cmd {
+while [ 1 ] ; do
+ $@
+ echo "Continue? [y/n]:"
+ read -t 2 value
+ if [ x$value == "xy" ]; then
+ break;
+ fi
+ sleep 1
+done
+}
+
+dsh -w onos9vpc,onos10vpc 'ONOS/ctrl-add-ext.sh'
+sleep 5
+
+echo "start ONOS on onos11vpc"
+read
+./start-onos.sh onos11vpc start
+echo "done"
+
+echo "kill ONOS on onos9"
+read
+./start-onos.sh onos9vpc stop
+echo "done"
+
+echo "kill ONOS on onos11"
+read
+dsh -w onos11vpc 'ONOS/ctrl-add-ext.sh'
+sleep 1
+./start-onos.sh onos11vpc stop
+echo "done"
+
+echo "bring back ONOS on onos9 and onos11"
+read
+./start-onos.sh 'onos9vpc,onos11vpc' start
+echo "done"
+
+echo "kill ONOS on onos10"
+read
+./start-onos.sh onos10vpc stop
+echo "done"
diff --git a/demo-scripts/Sprint-4/network-change.sh b/demo-scripts/Sprint-4/network-change.sh
new file mode 100755
index 0000000..4fd49f9
--- /dev/null
+++ b/demo-scripts/Sprint-4/network-change.sh
@@ -0,0 +1,138 @@
+#! /bin/sh
+
+function Wait {
+ echo "press ret> "
+ read
+}
+
+function port_down {
+ echo "Taking down $2 port $3"
+ Wait
+ dsh -w $1 "sudo ifconfig $2-$3 down"
+ echo "done"
+}
+function port_up {
+ echo "bring up $2 port $3"
+ Wait
+ dsh -w $1 "sudo ifconfig $2-$3 up"
+ echo "done"
+}
+
+function port_change {
+ port_down $1 $2 $3
+ port_up $1 $2 $3
+}
+
+function switch_remove {
+ echo "taking switch $2 out"
+ Wait
+ dsh -w $1 "sudo ovs-vsctl set-controller $2 tcp:127.0.0.1:6639"
+ echo "done"
+}
+
+function switch_back {
+ echo "taking switch $2 back"
+ Wait
+ ctrl="tcp:127.0.0.1:6633"
+ dsh -w $1 "sudo ovs-vsctl set-controller $2 $ctrl"
+ echo "done"
+}
+function switch_go_back {
+ switch_remove $1 $2
+ switch_back $1 $2
+}
+
+function link_down {
+ echo "remove link from sw $2 port $3"
+ n=`dsh -w $1 "sudo tc qdisc show dev $2-$3" | grep netem | wc -l`
+ if [ $n -eq 1 ]; then
+ echo "dsh -w $1 sudo tc qdisc change dev $2-$3 root netem loss 100%"
+ dsh -w $1 "sudo tc qdisc change dev $2-$3 root netem loss 100%"
+ else
+ echo "dsh -w $1 sudo tc qdisc add dev $2-$3 root netem 100%"
+ dsh -w $1 "sudo tc qdisc add dev $2-$3 root netem loss 100%"
+ fi
+ echo "done"
+}
+function link_up {
+ echo "add link from sw $2 port $3"
+ n=`dsh -w $1 "sudo tc qdisc show dev $2-$3" | grep netem | wc -l`
+ if [ $n -eq 1 ]; then
+ echo "dsh -w $1 sudo tc qdisc change dev $2-$3 root netem loss 0%"
+ dsh -w $1 "sudo tc qdisc change dev $2-$3 root netem loss 0%"
+ else
+ echo "dsh -w $1 sudo tc qdisc add dev $2-$3 root netem loss 0%"
+ dsh -w $1 "sudo tc qdisc add dev $2-$3 root netem loss 0%"
+ fi
+ echo "done"
+}
+function link_change {
+ link_down $1 $2 $3
+ link_up $1 $2 $3
+}
+
+function ilink_down {
+ echo "remove link from $2"
+ n=`dsh -w $1 "sudo tc qdisc show dev $2" | grep netem | wc -l`
+ if [ $n -eq 1 ]; then
+ echo "dsh -w $1 sudo tc qdisc change dev $2 root netem loss 100%"
+ dsh -w $1 "sudo tc qdisc change dev $2 root netem loss 100%"
+ else
+ echo "dsh -w $1 sudo tc qdisc add dev $2 root netem 100%"
+ dsh -w $1 "sudo tc qdisc add dev $2 root netem loss 100%"
+ fi
+ echo "done"
+}
+function ilink_up {
+ echo "add link at $2"
+ n=`dsh -w $1 "sudo tc qdisc show dev $2" | grep netem | wc -l`
+ if [ $n -eq 1 ]; then
+ echo "dsh -w $1 sudo tc qdisc change dev $2 root netem loss 0%"
+ dsh -w $1 "sudo tc qdisc change dev $2 root netem loss 0%"
+ else
+ echo "dsh -w $1 sudo tc qdisc add dev $2 root netem loss 0%"
+ dsh -w $1 "sudo tc qdisc add dev $2 root netem loss 0%"
+ fi
+ echo "done"
+}
+function ilink_change {
+ ilink_down $1 $2
+ ilink_up $1 $2
+}
+
+
+#port_change onos9vpc swa1 eth2
+#port_change onos10vpc swb3 eth4
+#port_change onos11vpc swc5 eth2
+
+#switch_go_back onos9vpc swa1
+#switch_go_back onos10vpc swb3
+#switch_go_back onos11vpc swc3
+
+#echo "link down between swa4 and swa3"
+#Wait
+#link_down onos9vpc swa4 eth2
+#link_down onos9vpc swa3 eth4
+#echo "link up between swa4 and swa3"
+Wait
+link_up onos9vpc swa3 eth4
+link_up onos9vpc swa4 eth2
+
+echo "link down between swb4 and swb3"
+Wait
+link_down onos10vpc swb4 eth2
+link_down onos10vpc swb3 eth4
+echo "link down between swb4 and swb3"
+Wait
+link_up onos10vpc swb3 eth4
+link_up onos10vpc swb4 eth2
+
+echo "link down between network 1 and network2"
+Wait
+ilink_down onos9vpc tapa0
+ilink_down onos10vpc tapb0
+
+echo "link up between network 1 and network2"
+Wait
+ilink_up onos10vpc tapb0
+ilink_up onos9vpc tapa0
diff --git a/demo-scripts/Sprint-4/start-cassandra.sh b/demo-scripts/Sprint-4/start-cassandra.sh
new file mode 100755
index 0000000..860a320
--- /dev/null
+++ b/demo-scripts/Sprint-4/start-cassandra.sh
@@ -0,0 +1,6 @@
+#! /bin/sh
+if [ $# != 2 ]; then
+ echo "$0 server cmd"
+fi
+CLUSTER=/home/masayosi/bin/hosts-3x3.txt
+dsh -w $1 "cd ONOS; sudo ./start-cassandra.sh $2"
diff --git a/demo-scripts/Sprint-4/start-onos.sh b/demo-scripts/Sprint-4/start-onos.sh
new file mode 100755
index 0000000..3c90e87
--- /dev/null
+++ b/demo-scripts/Sprint-4/start-onos.sh
@@ -0,0 +1,6 @@
+#! /bin/sh
+if [ $# != 2 ]; then
+ echo "$0 server cmd"
+fi
+CLUSTER=/home/masayosi/bin/hosts-3x3.txt
+dsh -w $1 "cd ONOS; sudo ./start-onos.sh $2"
diff --git a/demo-scripts/Sprint-4/update.sh b/demo-scripts/Sprint-4/update.sh
new file mode 100755
index 0000000..30c9391
--- /dev/null
+++ b/demo-scripts/Sprint-4/update.sh
@@ -0,0 +1,4 @@
+#! /bin/sh
+CLUSTER=/home/masayosi/bin/hosts-3x3.txt
+
+dsh -g onos 'cd ONOS; git pull; ant'