summaryrefslogtreecommitdiffstats
path: root/utils/infra_setup
diff options
context:
space:
mode:
authorQiLiang <liangqi1@huawei.com>2016-01-08 01:27:55 +0000
committerQiLiang <liangqi1@huawei.com>2016-01-09 02:44:43 +0000
commit6e490df0346e26f9e6cc5dc79029a03e1d17a454 (patch)
tree04333ceadab525e1b89497f88f7919ecb9865dc0 /utils/infra_setup
parent27a84e7905e66c005b02706ea3489576b5873c32 (diff)
Rubbos test case pipline minor update
- Add timestamp - Fix code pull bug - Shoten test run time JIRA: BOTTLENECK-24 Change-Id: Ie83fcf0e4a4ad2da715a694118f1f9e916a5f704 Signed-off-by: QiLiang <liangqi1@huawei.com>
Diffstat (limited to 'utils/infra_setup')
-rwxr-xr-xutils/infra_setup/heat_template/HOT_create_instance.sh38
-rwxr-xr-xutils/infra_setup/vm_dev_setup/setup_env.sh9
2 files changed, 29 insertions, 18 deletions
diff --git a/utils/infra_setup/heat_template/HOT_create_instance.sh b/utils/infra_setup/heat_template/HOT_create_instance.sh
index 8266229b..eadaac2b 100755
--- a/utils/infra_setup/heat_template/HOT_create_instance.sh
+++ b/utils/infra_setup/heat_template/HOT_create_instance.sh
@@ -6,6 +6,8 @@ GERRIT_REFSPEC_DEBUG=$1
bottlenecks_env_prepare()
{
+ echo "Bottlenecks env prepare start $(date)"
+
if [ -d $BOTTLENECKS_REPO_DIR ]; then
rm -rf ${BOTTLENECKS_REPO_DIR}
fi
@@ -21,6 +23,8 @@ bottlenecks_env_prepare()
source $BOTTLENECKS_REPO_DIR/rubbos/rubbos_scripts/1-1-1/scripts/env_preparation.sh
chmod 600 $KEY_PATH/bottlenecks_key
+
+ echo "Bottlenecks env prepare end $(date)"
}
wait_heat_stack_complete() {
@@ -39,7 +43,8 @@ wait_heat_stack_complete() {
exit 1
fi
- if [ $BOTTLENECKS_DEBUG = True ]; then
+ #if [ $BOTTLENECKS_DEBUG = True ]; then
+ if false; then
heat stack-show bottlenecks
nova list | grep rubbos_
for i in $(nova list | grep rubbos_ | grep ERROR | awk '{print $2}')
@@ -75,7 +80,7 @@ wait_rubbos_control_ok() {
bottlenecks_check_instance_ok()
{
- echo "check instance"
+ echo "Bottlenecks check instance ok start $(date)"
wait_heat_stack_complete 120
wait_rubbos_control_ok 300
@@ -101,11 +106,13 @@ bottlenecks_check_instance_ok()
sleep 10
done
fi
+
+ echo "Bottlenecks check instance ok end $(date)"
}
bottlenecks_create_instance()
{
- echo "create bottlenecks instance using heat template"
+ echo "Bottlenecks create instance using heat template start $(date)"
echo "upload keypair"
nova keypair-add --pub_key $KEY_PATH/bottlenecks_key.pub $KEY_NAME
@@ -117,6 +124,8 @@ bottlenecks_create_instance()
cd $HOT_PATH
heat stack-create bottlenecks -f ${TEMPLATE_NAME} \
-P "image=$IMAGE_NAME;key_name=$KEY_NAME;public_net=$PUBLIC_NET_NAME;flavor=$FLAVOR_NAME"
+
+ echo "Bottlenecks create instance using heat template end $(date)"
}
bottlenecks_rubbos_wait_finish()
@@ -125,14 +134,7 @@ bottlenecks_rubbos_wait_finish()
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
- "
+ 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
@@ -171,14 +173,14 @@ bottlenecks_rubbos_run()
ssh $ssh_args \
ec2-user@$control_ip "bash /tmp/vm_dev_setup/setup_env.sh" &
- bottlenecks_rubbos_wait_finish 240
+ bottlenecks_rubbos_wait_finish 80
rm -rf $BOTTLENECKS_REPO_DIR/utils/infra_setup/vm_dev_setup/hosts.conf
}
bottlenecks_cleanup()
{
- echo "clean up bottlenecks images and keys"
+ echo "Bottlenecks cleanup start $(date)"
if heat stack-list; then
for stack in $(heat stack-list | grep -e bottlenecks | awk '{print $2}'); do
@@ -208,11 +210,13 @@ bottlenecks_cleanup()
nova flavor-delete $flavor || true
done
fi
+
+ echo "Bottlenecks cleanup end $(date)"
}
bottlenecks_load_bottlenecks_image()
{
- echo "load bottlenecks image"
+ echo "Bottlenecks load image start $(date)"
curl --connect-timeout 10 -o /tmp/bottlenecks-trusty-server.img $IMAGE_URL -v
@@ -231,12 +235,12 @@ bottlenecks_load_bottlenecks_image()
exit 1
fi
- echo "bottlenecks image id: $IMAGE_ID_BOTTLENECKS"
+ echo "bottlenecks image end id: $IMAGE_ID_BOTTLENECKS $(date)"
}
main()
{
- echo "create instances with heat template"
+ echo "main start $(date)"
BOTTLENECKS_DEBUG=True
BOTTLENECKS_REPO=https://gerrit.opnfv.org/gerrit/bottlenecks
@@ -253,12 +257,14 @@ main()
ssh_args="-o StrictHostKeyChecking=no -o BatchMode=yes -i $KEY_PATH/bottlenecks_key"
bottlenecks_env_prepare
+ set -x
bottlenecks_cleanup
bottlenecks_load_bottlenecks_image
bottlenecks_create_instance
bottlenecks_check_instance_ok
bottlenecks_rubbos_run
bottlenecks_cleanup
+ echo "main end $(date)"
}
main
diff --git a/utils/infra_setup/vm_dev_setup/setup_env.sh b/utils/infra_setup/vm_dev_setup/setup_env.sh
index f1572e05..795a0a6a 100755
--- a/utils/infra_setup/vm_dev_setup/setup_env.sh
+++ b/utils/infra_setup/vm_dev_setup/setup_env.sh
@@ -55,18 +55,22 @@ bottlenecks_download_repo()
{
echo "Bottlenecks: download bottlenecks repo"
+ sudo git config --global http.sslVerify false
if [ -d $BOTTLENECKS_REPO_DIR/.git ]; then
cd $BOTTLENECKS_REPO_DIR
sudo git pull origin master
if [ x"$GERRIT_REFSPEC_DEBUG" != x ]; then
- sudo git fetch $BOTTLENECKS_REPO $GERRIT_REFSPEC_DEBUG && git checkout FETCH_HEAD
+ sudo git fetch $BOTTLENECKS_REPO $GERRIT_REFSPEC_DEBUG && sudo git checkout FETCH_HEAD
fi
cd -
else
sudo rm -rf $BOTTLENECKS_REPO_DIR
sudo git clone $BOTTLENECKS_REPO $BOTTLENECKS_REPO_DIR
if [ x"$GERRIT_REFSPEC_DEBUG" != x ]; then
- sudo git fetch $BOTTLENECKS_REPO $GERRIT_REFSPEC_DEBUG && git checkout FETCH_HEAD
+ cd $BOTTLENECKS_REPO_DIR
+ echo "fetch $GERRIT_REFSPEC_DEBUG"
+ sudo git fetch $BOTTLENECKS_REPO $GERRIT_REFSPEC_DEBUG && sudo git checkout FETCH_HEAD
+ cd -
fi
fi
@@ -116,6 +120,7 @@ main()
source $SCRIPT_DIR/common.sh
bottlenecks_prepare_env
+ set -x
bottlenecks_download_repo
bottlenecks_config_hosts_ip
bottlenecks_download_packages