aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2017-11-09 10:59:46 -0800
committerGary Wu <gary.i.wu@huawei.com>2017-11-09 11:01:40 -0800
commitf5fef8ba321fe1a0fd974f634f72a0646baeffe7 (patch)
treeecf9eda8eb7119f1b377167d14d7ce9d73d468ac /test
parente8ac9b5c3bcef7a4f9737beaecca703fff95394a (diff)
Add wait loops for stack delete/create completion
Change-Id: If61d54b01e5f90dc75f3f8ec29914b7b506f3c51 Issue-ID: INT-278 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/ete/scripts/deploy-onap.sh19
-rwxr-xr-xtest/ete/scripts/install_openstack_cli.sh2
2 files changed, 19 insertions, 2 deletions
diff --git a/test/ete/scripts/deploy-onap.sh b/test/ete/scripts/deploy-onap.sh
index 69296ab17..5ed30a13f 100755
--- a/test/ete/scripts/deploy-onap.sh
+++ b/test/ete/scripts/deploy-onap.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
if [ -z "$WORKSPACE" ]; then
export WORKSPACE=`git rev-parse --show-toplevel`
@@ -8,19 +8,36 @@ source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh
# Delete all existing stacks
STACKS=$(openstack stack list -c "Stack Name" -f value)
+
if [ ! -z "${STACKS}" ]; then
echo "Deleting Stacks ${STACKS}"
openstack stack delete -y $STACKS
+ for STACK in ${STACKS}; do
+ until ! openstack stack show -c stack_status -f value $STACK; do
+ sleep 30
+ done
+ done
else
echo "No existing stacks to delete."
fi
+
+
+
STACK="ete-$(uuidgen | cut -c-8)"
echo "New Stack Name: ${STACK}"
cp ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.env ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-demo.env
envsubst < ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-template.env > ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env
+#diff ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-template.env ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env
openstack stack create -t ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.yaml -e ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env $STACK
+while [ "CREATE_IN_PROGRESS" == "$(openstack stack show -c stack_status -f value $STACK)" ]; do
+ sleep 10
+done
+
+STATUS=$(openstack stack show -c stack_status -f value $STACK)
+echo $STATUS
+[ "CREATE_COMPLETE" == "$STATUS" ]
diff --git a/test/ete/scripts/install_openstack_cli.sh b/test/ete/scripts/install_openstack_cli.sh
index ec5ad1f76..a6a0438f9 100755
--- a/test/ete/scripts/install_openstack_cli.sh
+++ b/test/ete/scripts/install_openstack_cli.sh
@@ -38,7 +38,7 @@ if [ -z "$ONAP_WORKDIR" ]; then
fi
echo "ONAP_WORKDIR=${ONAP_WORKDIR}"
if [ ! -d ${ONAP_WORKDIR}/demo ]; then
- git clone http://gerrit.onap.org/r/demo ${ONAP_WORKDIR}/demo
+ git clone https://gerrit.onap.org/r/demo ${ONAP_WORKDIR}/demo
else
pushd ${ONAP_WORKDIR}/demo
git pull