Masayoshi Kobayashi | e4a551d | 2013-04-07 04:56:09 +0000 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | basename=$ONOS_CLUSTER_BASENAME |
| 3 | wait=10 |
| 4 | |
| 5 | fdef="flowdef_8node_42.txt" |
| 6 | |
| 7 | function 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 | |
| 15 | echo "all links up" |
| 16 | dsh -w ${basename}1 "cd ONOS/scripts; ./all-linkup.sh" |
| 17 | echo "clean up flow" |
| 18 | dsh -w ${basename}1 "cd ONOS/web; ./delete_flow.py 1 100" |
| 19 | dsh -w ${basename}1 "cd ONOS/web; ./clear_flow.py 1 100" |
| 20 | sleep 1 |
| 21 | dsh -w ${basename}1 "cd ONOS/web; ./get_flow.py all" |
| 22 | dsh "cd ONOS/scripts; ./delflow.sh" |
| 23 | echo "checkup status" |
| 24 | check_status.py |
| 25 | read -p "hit anykey> " |
| 26 | |
| 27 | echo "install pre-set flows" |
| 28 | dsh -w ${basename}1 "cd ONOS/web; ./add_flow.py -m onos -f $fdef" |
| 29 | sleep 6 |
| 30 | echo "check" |
| 31 | dsh -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` |
| 34 | operation=("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)) |
| 37 | while [ 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++)) |
| 54 | done |
| 55 | |