blob: 4db887a53dec69b9addfc63170c3831fed8c37bf [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"
Masayoshi Kobayashie4a551d2013-04-07 04:56:09 +000019sleep 1
20dsh -w ${basename}1 "cd ONOS/web; ./get_flow.py all"
21dsh "cd ONOS/scripts; ./delflow.sh"
22echo "checkup status"
23check_status.py
24read -p "hit anykey> "
25
26echo "install pre-set flows"
27dsh -w ${basename}1 "cd ONOS/web; ./add_flow.py -m onos -f $fdef"
28sleep 6
29echo "check"
30dsh -w ${basename}1 "cd ONOS/web; ./pingall.py $fdef"
31
32#ports=`dsh -w ${basename}1 "cd ONOS/scripts; ./listports.sh" | awk '{print $2}' |grep -v tap`
33operation=("sw3-eth3 down" "sw4-eth4 down" "sw4-eth3 down" "sw3-eth3 up" "sw1-eth2 down" "sw4-eth4 up" "sw4-eth3 up" "sw1-eth2 up")
34
35((n=0))
36while [ 1 ] ; do
37 for (( i = 0; i< ${#operation[@]}; i ++)); do
38 echo "Test $n-$i"
39 p=`echo ${operation[$i]}`
40 echo "operation: $p"
41# read -p "hit anykey> "
42 dsh -w ${basename}1 "sudo ifconfig $p"
43 echo "wait $wait sec"
44 sleep $wait
45 result=`dsh -w ${basename}1 "cd ONOS/web; ./pingall.py $fdef"`
46 echo $result
47 nr_fail=`echo $result |grep fail | wc -l`
48 if [ $nr_fail -gt 0 ]; then
49 log $n $i
50 fi
51 done
52 ((n++))
53done
54