blob: 6c5f128ce010686bcd2ab2b67ad99db88cc8b556 [file] [log] [blame]
Masayoshi Kobayashie4a551d2013-04-07 04:56:09 +00001#! /bin/sh
2basename=$ONOS_CLUSTER_BASENAME
3wait=10
4
5fdef="flowdef_8node_42.txt"
6
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
15echo "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"
24check_status.py
25read -p "hit anykey> "
26
27echo "install pre-set flows"
28dsh -w ${basename}1 "cd ONOS/web; ./add_flow.py -m onos -f $fdef"
29sleep 6
30echo "check"
31dsh -w ${basename}1 "cd ONOS/web; ./pingall.py $fdef"
32
33#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")
35
36((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++))
54done
55