blob: 6c5f128ce010686bcd2ab2b67ad99db88cc8b556 [file] [log] [blame]
Masayoshi Kobayashi7f02a802013-04-03 21:40:13 +00001#! /bin/sh
2basename=$ONOS_CLUSTER_BASENAME
Masayoshi Kobayashifb6c5802013-04-04 02:16:41 +00003wait=10
Masayoshi Kobayashi7f02a802013-04-03 21:40:13 +00004
5fdef="flowdef_8node_42.txt"
Masayoshi Kobayashifb6c5802013-04-04 02:16:41 +00006
7function log()
8{
9 date > error.$1.$2.log
10 check_status.py >> error.$1.$2.log
11 dsh -w ${basename}1 "cd ONOS/web; ./get_flow.py all" >> error.$1.$2.log
12 dsh "cd ONOS/scripts; ./showflow.sh" >> error.$1.$2.log
13}
14
Masayoshi Kobayashi7f02a802013-04-03 21:40:13 +000015echo "all links up"
16dsh -w ${basename}1 "cd ONOS/scripts; ./all-linkup.sh"
17echo "clean up flow"
18dsh -w ${basename}1 "cd ONOS/web; ./delete_flow.py 1 100"
19dsh -w ${basename}1 "cd ONOS/web; ./clear_flow.py 1 100"
20sleep 1
21dsh -w ${basename}1 "cd ONOS/web; ./get_flow.py all"
22dsh "cd ONOS/scripts; ./delflow.sh"
23echo "checkup status"
Masayoshi Kobayashifb6c5802013-04-04 02:16:41 +000024check_status.py
Masayoshi Kobayashi7f02a802013-04-03 21:40:13 +000025read -p "hit anykey> "
26
27echo "install pre-set flows"
28dsh -w ${basename}1 "cd ONOS/web; ./add_flow.py -m onos -f $fdef"
Masayoshi Kobayashifb6c5802013-04-04 02:16:41 +000029sleep 6
Masayoshi Kobayashi7f02a802013-04-03 21:40:13 +000030echo "check"
31dsh -w ${basename}1 "cd ONOS/web; ./pingall.py $fdef"
32
Masayoshi Kobayashifb6c5802013-04-04 02:16:41 +000033#ports=`dsh -w ${basename}1 "cd ONOS/scripts; ./listports.sh" | awk '{print $2}' |grep -v tap`
34operation=("sw3-eth3 down" "sw4-eth4 down" "sw4-eth3 down" "sw3-eth3 up" "sw1-eth2 down" "sw4-eth4 up" "sw4-eth3 up" "sw1-eth2 up")
Masayoshi Kobayashi7f02a802013-04-03 21:40:13 +000035
Masayoshi Kobayashifb6c5802013-04-04 02:16:41 +000036((n=0))
37while [ 1 ] ; do
38 for (( i = 0; i< ${#operation[@]}; i ++)); do
39 echo "Test $n-$i"
40 p=`echo ${operation[$i]}`
41 echo "operation: $p"
42# read -p "hit anykey> "
43 dsh -w ${basename}1 "sudo ifconfig $p"
44 echo "wait $wait sec"
45 sleep $wait
46 result=`dsh -w ${basename}1 "cd ONOS/web; ./pingall.py $fdef"`
47 echo $result
48 nr_fail=`echo $result |grep fail | wc -l`
49 if [ $nr_fail -gt 0 ]; then
50 log $n $i
51 fi
52 done
53 ((n++))
Masayoshi Kobayashi7f02a802013-04-03 21:40:13 +000054done
Masayoshi Kobayashifb6c5802013-04-04 02:16:41 +000055