From 9171d14463ae1172a91125a49d8f8a53a36433e9 Mon Sep 17 00:00:00 2001 From: Ryota MIBU Date: Thu, 18 Feb 2016 12:30:31 +0900 Subject: test: fix DNS issue in test scenario Doctor test was failed due to failure in resolving hostname at [1]. This patch replaces hostname by ip address, and also changes ssh route from relaying instack VM to direct access from functest container to the target compute host. [1] https://build.opnfv.org/ci/view/functest/job/functest-apex-opnfv-jump-1-daily-brahmaputra/38/ Change-Id: I9d4f115cb43ec16540f7d9300d652625685477d5 Signed-off-by: Ryota MIBU --- tests/run.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/run.sh b/tests/run.sh index 5c58463f..ffb349a4 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -41,6 +41,18 @@ if [[ "$COMPUTE_IP" == "none" ]] ; then | awk '/ ctlplane network /{print \$5}'") fi +prepare_compute_ssh() { + ping -c 1 "$COMPUTE_IP" + + # get ssh key from installer node + sudo scp $ssh_opts /home/stack/.ssh/id_rsa instack_key + if [ ! -r instack_key ]; then + sudo chown $(whoami):$(whoami) instack_key + fi + chmod 400 instack_key + ssh_opts_cpu="$ssh_opts -i instack_key -l heat-admin" +} + download_image() { [ -e "$IMAGE_FILE" ] && return 0 wget "$IMAGE_URL" -o "$IMAGE_FILE" @@ -132,11 +144,8 @@ echo sudo ip link set $dev up sleep 1 END_TXT chmod +x disable_network.sh - sudo scp $ssh_opts disable_network.sh $INSTALLER_IP: - ssh_opts_cpu="$ssh_opts -i /home/stack/.ssh/id_rsa" - sudo ssh $ssh_opts $INSTALLER_IP \ - "scp $ssh_opts_cpu disable_network.sh heat-admin@$COMPUTE_HOST: && \ - ssh $ssh_opts_cpu 'nohup ./disable_network.sh > c 2>&1 &'" + scp $ssh_opts_cpu disable_network.sh "$COMPUTE_IP:" + ssh $ssh_opts_cpu "$COMPUTE_IP:" 'nohup ./disable_network.sh > disable_network.log 2>&1 &' } calculate_notification_time() { @@ -153,6 +162,8 @@ cleanup() { stop_monitor stop_inspector stop_consumer + ssh $ssh_opts_cpu $COMPUTE_IP \ + "[ -e disable_network.log ] && cat disable_network.log" nova service-force-down --unset "$COMPUTE_HOST" nova-compute sleep 1 @@ -173,7 +184,7 @@ cleanup() { echo "Note: doctor/tests/run.sh has been executed." -ping -c 1 "$COMPUTE_IP" +prepare_compute_ssh trap cleanup ERR -- cgit 1.2.3-korg