diff options
author | rexlee8776 <limingjiang@huawei.com> | 2016-07-30 02:23:29 +0000 |
---|---|---|
committer | rexlee8776 <limingjiang@huawei.com> | 2016-07-30 02:23:29 +0000 |
commit | 76d0e5f0cfcf016d0c1d78f50c059b01474af14c (patch) | |
tree | 38b34d33c4d81cebf8da919e6930890a12970a47 /tests/ci | |
parent | 7d5d227ecb7163271cf1645d0affb0134f5ff039 (diff) |
bug_fix tc045 ssh error caused by no id_rsa key file
this patch fetch id_rsa when prepare the env
JIRA: YARDSTICK-312
Change-Id: I9f172c4ec87a47143a63607dcb4725b86016605a
Signed-off-by: rexlee8776 <limingjiang@huawei.com>
Diffstat (limited to 'tests/ci')
-rwxr-xr-x | tests/ci/prepare_env.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ci/prepare_env.sh b/tests/ci/prepare_env.sh index 723a04aa1..35118b12c 100755 --- a/tests/ci/prepare_env.sh +++ b/tests/ci/prepare_env.sh @@ -55,3 +55,28 @@ export EXTERNAL_NETWORK INSTALLER_TYPE DEPLOY_TYPE NODE_NAME # Prepare a admin-rc file for StorPerf integration $YARDSTICK_REPO_DIR/tests/ci/prepare_storperf_admin-rc.sh + +# Fetching id_rsa file from jump_server..." +verify_connectivity() { + local ip=$1 + echo "Verifying connectivity to $ip..." + for i in $(seq 0 10); do + if ping -c 1 -W 1 $ip > /dev/null; then + echo "$ip is reachable!" + return 0 + fi + sleep 1 + done + error "Can not talk to $ip." +} + +ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + +if [ "$INSTALLER_TYPE" == "fuel" ]; then + #ip_fuel="10.20.0.2" + verify_connectivity $INSTALLER_IP + echo "Fetching id_rsa file from jump_server $INSTALLER_IP..." + sshpass -p r00tme scp 2>/dev/null $ssh_options \ + root@${INSTALLER_IP}:~/.ssh/id_rsa /root/.ssh/id_rsa &> /dev/null +fi + |