Fixing broken CSIT by 40573
SMS CSIT was broken because of patch 40573
This patch should fix that issue
Issue-ID: AAF-189
Change-Id: I4a26841e833237ad485ca62fa76262b1832c5946
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
diff --git a/test/csit/plans/aaf/sms-test-plan/setup.sh b/test/csit/plans/aaf/sms-test-plan/setup.sh
index 5d1973a..9f77b69 100755
--- a/test/csit/plans/aaf/sms-test-plan/setup.sh
+++ b/test/csit/plans/aaf/sms-test-plan/setup.sh
@@ -22,21 +22,10 @@
mkdir -p $(pwd)/config
-cat << EOF > $CONFIG_FILE
-{
- "cafile": "auth/selfsignedca.pem",
- "servercert": "auth/server.cert",
- "serverkey": "auth/server.key",
-
- "vaultaddress": "http://$HOSTNAME:8200",
- "vaulttoken": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
- "disable_tls": true
-}
-EOF
-
docker login -u docker -p docker nexus3.onap.org:10001
docker pull nexus3.onap.org:10001/onap/aaf/sms
docker pull docker.io/vault:0.9.5
+
#
# Running vault in dev server mode here for CSIT
# In HELM it runs in production mode
@@ -44,16 +33,39 @@
docker run -e "VAULT_DEV_ROOT_TOKEN_ID=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" \
-e SKIP_SETCAP=true \
--name vault -d -p 8200:8200 vault:0.9.5
-docker run --workdir /sms -v "$(pwd)"/config/smsconfig.json:/sms/smsconfig.json \
+
+SMSDB_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vault)
+cat << EOF > $CONFIG_FILE
+{
+ "cafile": "auth/selfsignedca.pem",
+ "servercert": "auth/server.cert",
+ "serverkey": "auth/server.key",
+
+ "smsdbaddress": "http://$SMSDB_IP:8200",
+ "vaulttoken": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
+ "disable_tls": true
+}
+EOF
+
+cat $CONFIG_FILE
+
+docker run --workdir /sms -v $CONFIG_FILE:/sms/smsconfig.json \
--name sms -d -p 10443:10443 nexus3.onap.org:10001/onap/aaf/sms
+SMS_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sms)
+
echo "###### WAITING FOR ALL CONTAINERS TO COME UP"
-sleep 10
+sleep 20
+for i in {1..20}; do
+ curl -sS -m 1 http://${SMSDB_IP}:8200/v1/sys/seal-status && break
+ echo sleep $i
+ sleep $i
+done
#
# add here all ROBOT_VARIABLES settings
#
echo "# sms robot variables settings";
-ROBOT_VARIABLES="-v SMS_HOSTNAME:http://localhost -v SMS_PORT:10443"
+ROBOT_VARIABLES="-v SMS_HOSTNAME:http://${SMS_IP} -v SMS_PORT:10443"
echo ${ROBOT_VARIABLES}
diff --git a/test/csit/plans/aaf/sms-test-plan/teardown.sh b/test/csit/plans/aaf/sms-test-plan/teardown.sh
index 72f134f..d6fa329 100644
--- a/test/csit/plans/aaf/sms-test-plan/teardown.sh
+++ b/test/csit/plans/aaf/sms-test-plan/teardown.sh
@@ -15,6 +15,9 @@
# limitations under the License.
#
+docker cp sms:/sms/sms.log .
+cat sms.log
+rm sms.log
rm -rf config
docker stop sms vault
docker rm sms vault