diff options
author | QiLiang <liangqi1@huawei.com> | 2015-12-25 07:28:22 +0000 |
---|---|---|
committer | QiLiang <liangqi1@huawei.com> | 2016-01-07 13:57:10 +0000 |
commit | 27a84e7905e66c005b02706ea3489576b5873c32 (patch) | |
tree | 64b59bc806f7530a885fc73a6e1cea315a4a09cf /utils/infra_setup/heat_template/HOT_create_instance.sh | |
parent | 2ef88b4eb1e78f562fed72df00c9b757c45f99f0 (diff) |
Add result handler & fix test run hanging bug
JIRA: BOTTLENECK-24
Change-Id: I8ef2c55d725af9258c34c3fd9b1161565851f7e0
Signed-off-by: QiLiang <liangqi1@huawei.com>
Diffstat (limited to 'utils/infra_setup/heat_template/HOT_create_instance.sh')
-rwxr-xr-x | utils/infra_setup/heat_template/HOT_create_instance.sh | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/utils/infra_setup/heat_template/HOT_create_instance.sh b/utils/infra_setup/heat_template/HOT_create_instance.sh index 4de29b3a..8266229b 100755 --- a/utils/infra_setup/heat_template/HOT_create_instance.sh +++ b/utils/infra_setup/heat_template/HOT_create_instance.sh @@ -119,6 +119,34 @@ bottlenecks_create_instance() -P "image=$IMAGE_NAME;key_name=$KEY_NAME;public_net=$PUBLIC_NET_NAME;flavor=$FLAVOR_NAME" } +bottlenecks_rubbos_wait_finish() +{ + echo "Start checking rubbos running status..." + retry=0 + while true + do + ssh $ssh_args ec2-user@$control_ip " + FILE=/tmp/rubbos_finished + if [ -f \$FILE ]; then + exit 0 + else + exit 1 + fi + " + if [ $? = 0 ]; then + echo "Rubbos test case successfully finished :)" + return 0 + fi + echo "Rubbos running $retry ..." + sleep 30 + let retry+=1 + if [[ $retry -ge $1 ]]; then + echo "Rubbos test case timeout :(" + return 1 + fi + done +} + bottlenecks_rubbos_run() { echo "Run Rubbos" @@ -141,7 +169,9 @@ bottlenecks_rubbos_run() $BOTTLENECKS_REPO_DIR/utils/infra_setup/vm_dev_setup \ ec2-user@$control_ip:/tmp ssh $ssh_args \ - ec2-user@$control_ip "bash /tmp/vm_dev_setup/setup_env.sh" + ec2-user@$control_ip "bash /tmp/vm_dev_setup/setup_env.sh" & + + bottlenecks_rubbos_wait_finish 240 rm -rf $BOTTLENECKS_REPO_DIR/utils/infra_setup/vm_dev_setup/hosts.conf } |