summaryrefslogtreecommitdiffstats
path: root/utils/infra_setup
diff options
context:
space:
mode:
authorQiLiang <liangqi1@huawei.com>2015-12-25 07:28:22 +0000
committerQiLiang <liangqi1@huawei.com>2016-01-07 13:57:10 +0000
commit27a84e7905e66c005b02706ea3489576b5873c32 (patch)
tree64b59bc806f7530a885fc73a6e1cea315a4a09cf /utils/infra_setup
parent2ef88b4eb1e78f562fed72df00c9b757c45f99f0 (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')
-rwxr-xr-xutils/infra_setup/heat_template/HOT_create_instance.sh32
-rwxr-xr-xutils/infra_setup/vm_dev_setup/setup_env.sh2
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()