summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyota MIBU <r-mibu@cq.jp.nec.com>2016-02-18 12:30:31 +0900
committerRyota Mibu <r-mibu@cq.jp.nec.com>2016-02-18 12:17:59 +0000
commitc6324521cc892add33af5543df60ab615f5c8088 (patch)
treeb8895edc1d82eea93e2eb61e9c4fa870879cf46d
parentabdcd125f5f783155bea5d6e4cb52e80607e534e (diff)
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 <r-mibu@cq.jp.nec.com> (cherry picked from commit 9171d14463ae1172a91125a49d8f8a53a36433e9)
-rwxr-xr-xtests/run.sh23
1 files 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