blob: 762a00eadd7255f73518b188e9cb365f109bc87e [file] [log] [blame]
Masayoshi Kobayashi1ef9ec02013-04-12 18:03:12 +00001#! /bin/bash
Masayoshi Kobayashi0135ec82013-12-18 22:57:46 +00002source ~/env_cluster
Masayoshi Kobayashi1ef9ec02013-04-12 18:03:12 +00003basename=$ONOS_CLUSTER_BASENAME
4DIR=${HOME}/ONOS
Masayoshi Kobayashi0135ec82013-12-18 22:57:46 +00005
6function scale_onos(){
7 for i in 5 6 7 8 ; do
8 ssh -i ~/.ssh/onlabkey.pem ${basename}${i} 'cd ONOS;./start-onos.sh start' &
9 done
10
11 while [ 1 ]; do
12 up=`for i in 5 6 7 8 ; do
13 ssh -i ~/.ssh/onlabkey.pem ${basename}${i} 'cd ONOS;./start-onos.sh status' &
14 done | grep "instance" | awk '{s+=$1}END{print s}'`
15
Masayoshi Kobayashifcc7c9d2013-12-20 00:50:55 +000016 if [ x$up == "x4" ]; then
Masayoshi Kobayashi0135ec82013-12-18 22:57:46 +000017 break;
18 fi
19 sleep 1
20 done
21}
22
Masayoshi Kobayashi1ef9ec02013-04-12 18:03:12 +000023start=`date +"%s"`
Masayoshi Kobayashi0135ec82013-12-18 22:57:46 +000024echo "bring up four nodes"
25scale_onos
Masayoshi Kobayashi1ef9ec02013-04-12 18:03:12 +000026sleep 2
27echo "Adding more flows"
28$DIR/web/add_flow.py -m onos -f $DIR/web/flowdef_demo_add.txt
29endt=`date +"%s"`
30(( delta = endt -start ))
31echo "Scale Up Done: took $delta sec"