diff options
author | QiLiang <liangqi1@huawei.com> | 2015-12-25 07:28:22 +0000 |
---|---|---|
committer | Jun Li <matthew.lijun@huawei.com> | 2016-01-10 03:35:06 +0000 |
commit | a08f4e7265637f994598f233c7713bfe877cada6 (patch) | |
tree | 64b59bc806f7530a885fc73a6e1cea315a4a09cf /utils | |
parent | 2ef88b4eb1e78f562fed72df00c9b757c45f99f0 (diff) |
Add result handler & fix test run hanging bug
JIRA: BOTTLENECK-24
Change-Id: I8ef2c55d725af9258c34c3fd9b1161565851f7e0
Signed-off-by: QiLiang <liangqi1@huawei.com>
(cherry picked from commit 27a84e7905e66c005b02706ea3489576b5873c32)
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/infra_setup/heat_template/HOT_create_instance.sh | 32 | ||||
-rwxr-xr-x | utils/infra_setup/vm_dev_setup/setup_env.sh | 2 |
2 files changed, 31 insertions, 3 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 } diff --git a/utils/infra_setup/vm_dev_setup/setup_env.sh b/utils/infra_setup/vm_dev_setup/setup_env.sh index bd0ffb56..f1572e05 100755 --- a/utils/infra_setup/vm_dev_setup/setup_env.sh +++ b/utils/infra_setup/vm_dev_setup/setup_env.sh @@ -104,8 +104,6 @@ bottlenecks_rubbos_install_exe() cd $RUBBOS_RUN_DIR sudo ./run.sh - cd $RUBBOS_EXE_DIR - sudo ./CONTROL_rubbos_exec.sh } main() |