X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Frun.sh;fp=tests%2Frun.sh;h=a970a7a574b87a4a88af282ebe01c18f5f04efeb;hb=1c4dda16a83977be189d2f874125a844e674b26a;hp=167a16bea418f84621cd95ddf4ce55eae22560f2;hpb=7b051407297547bdc7f56a42a5903bbd2655446a;p=doctor.git diff --git a/tests/run.sh b/tests/run.sh index 167a16be..a970a7a5 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -132,14 +132,14 @@ wait_for_vm_launch() { } inject_failure() { - echo "disabling network of comupte host [$COMPUTE_HOST] for 3 mins..." + echo "disabling network of compute host [$COMPUTE_HOST] for 3 mins..." cat > disable_network.sh << 'END_TXT' #!/bin/bash -x -dev=$(/usr/sbin/ip route | awk '/^default/{print $5}') +dev=$(ip route | awk '/^default/{print $5}') sleep 1 -echo sudo ip link set $dev down +sudo ip link set $dev down sleep 180 -echo sudo ip link set $dev up +sudo ip link set $dev up sleep 1 END_TXT chmod +x disable_network.sh @@ -148,11 +148,10 @@ END_TXT } calculate_notification_time() { - detect=$(grep "doctor monitor detected at" monitor.log | awk '{print $5}') + detected=$(grep "doctor monitor detected at" monitor.log | awk '{print $5}') notified=$(grep "doctor consumer notified at" consumer.log | awk '{print $5}') - duration=$(echo "$notified $detect" | awk '{print $1 - $2 }') - echo "$notified $detect" | \ - awk '{d = $1 - $2; if (d < 1 ) print d " OK"; else print d " NG"}' + echo "$notified $detected" | \ + awk '{d = $1 - $2; if (d < 1 && d > 0) print d " OK"; else print d " NG"}' } cleanup() {