From: Gerald Kunzmann Date: Fri, 29 Jul 2016 10:18:13 +0000 (+0000) Subject: Merge "fix bugs to get `CONSUMER_IP`" X-Git-Tag: colorado.1.0~36 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=4a1d0e285755afc6ae7b441c935d70617ec90ac3;hp=-c;p=doctor.git Merge "fix bugs to get `CONSUMER_IP`" --- 4a1d0e285755afc6ae7b441c935d70617ec90ac3 diff --combined tests/run.sh index d693a7ce,0bd9ee64..2f141f52 --- a/tests/run.sh +++ b/tests/run.sh @@@ -96,17 -96,12 +96,12 @@@ prepare_compute_ssh() } get_consumer_ip() { - #get network of the compute_ip address - network_pre=${COMPUTE_IP%.*} - network=${network_pre}.0/24 + CONSUMER_IP=$(ip route get $COMPUTE_IP | awk '/ src /{print $NF}') - #if there is a dedicated route, use it - dev=$(ip route |grep $network | awk '{print $3}' |head -n 1) - - #if there is no route, use default route - [[ -z $dev ]] && dev=$(ip route |grep ^default | awk '{print $3}' |head -n 1) - - CONSUMER_IP=$(ip addr show $dev |grep inet | grep $network_pre | awk '{print $2}' | cut -d'/' -f1) + if [[ -z "$CONSUMER_IP" ]]; then + echo "ERROR: Could not get CONSUMER_IP." + exit 1 + fi } download_image() { @@@ -261,7 -256,7 +256,7 @@@ cleanup() echo "waiting disabled compute host back to be enabled..." python ./nova_force_down.py "$COMPUTE_HOST" --unset - sleep 180 + sleep 240 check_host_status "UP" ssh $ssh_opts_cpu "$COMPUTE_USER@$COMPUTE_IP" \ "[ -e disable_network.log ] && cat disable_network.log" @@@ -314,7 -309,7 +309,7 @@@ start_consume sleep 60 echo "injecting host failure..." inject_failure -sleep 10 +sleep 60 check_host_status "DOWN" calculate_notification_time