Masayoshi Kobayashi | 1ef9ec0 | 2013-04-12 18:03:12 +0000 | [diff] [blame] | 1 | #! /bin/bash |
Masayoshi Kobayashi | 0135ec8 | 2013-12-18 22:57:46 +0000 | [diff] [blame] | 2 | source ~/env_cluster |
Masayoshi Kobayashi | 1ef9ec0 | 2013-04-12 18:03:12 +0000 | [diff] [blame] | 3 | basename=$ONOS_CLUSTER_BASENAME |
| 4 | DIR=${HOME}/ONOS |
Masayoshi Kobayashi | 0135ec8 | 2013-12-18 22:57:46 +0000 | [diff] [blame] | 5 | |
| 6 | function 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 Kobayashi | c76b1c4 | 2013-12-20 05:13:46 +0000 | [diff] [blame] | 16 | if [ x$up == "x4" ]; then |
Masayoshi Kobayashi | 0135ec8 | 2013-12-18 22:57:46 +0000 | [diff] [blame] | 17 | break; |
| 18 | fi |
| 19 | sleep 1 |
| 20 | done |
| 21 | } |
| 22 | |
Masayoshi Kobayashi | 1ef9ec0 | 2013-04-12 18:03:12 +0000 | [diff] [blame] | 23 | start=`date +"%s"` |
Masayoshi Kobayashi | 0135ec8 | 2013-12-18 22:57:46 +0000 | [diff] [blame] | 24 | echo "bring up four nodes" |
| 25 | scale_onos |
Masayoshi Kobayashi | 1ef9ec0 | 2013-04-12 18:03:12 +0000 | [diff] [blame] | 26 | sleep 2 |
| 27 | echo "Adding more flows" |
| 28 | $DIR/web/add_flow.py -m onos -f $DIR/web/flowdef_demo_add.txt |
| 29 | endt=`date +"%s"` |
| 30 | (( delta = endt -start )) |
| 31 | echo "Scale Up Done: took $delta sec" |