summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Morales <v.morales@samsung.com>2020-07-31 15:37:01 -0400
committerVictor Morales <v.morales@samsung.com>2020-08-12 15:14:50 -0400
commita0dfa66fe46f89013dc2593654ff2cd28edac063 (patch)
treea1e0a0d9b15a93d0459ab577dc913237b0f8aa9e
parent332652ce8bb53ea580d3a2a1f9b12e7d311ae29b (diff)
Improve wait instruction
The time that the jumpbox takes can be different every time that is created so waiting for a specific state can help during the creation. Signed-off-by: Victor Morales <v.morales@samsung.com> Change-Id: Idee038556bc669594660a308e405e79fe13ba118
-rwxr-xr-xfunctions.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/functions.sh b/functions.sh
index 5f7c0db..01b558c 100755
--- a/functions.sh
+++ b/functions.sh
@@ -23,7 +23,16 @@ clean_up() {
# Create jumphost VM
create_jump() {
./create_vm.sh "$VM_NAME"
- sleep 30
+ jumpbox_ip=$(get_vm_ip)
+ i=0
+ while [ -z $jumpbox_ip ]; do
+ sleep $((++i))
+ jumpbox_ip=$(get_vm_ip)
+ done
+ i=0
+ until nc -w5 -z $jumpbox_ip 22; do
+ sleep $((++i))
+ done
}
# Get jumphost VM IP