summaryrefslogtreecommitdiffstats
path: root/test/csit/scripts/clamp
diff options
context:
space:
mode:
authorehautot <eh552t@intl.att.com>2018-02-23 12:36:37 +0100
committerehautot <eh552t@intl.att.com>2018-02-26 11:02:17 +0100
commitaf8aad211786393c3505c7649cc18c88195b8f45 (patch)
treecd9c5636538b82eb3d9e13b1791ec4b2fac8d142 /test/csit/scripts/clamp
parent907b60a30d7bcd33a1330a7cfadf35527605fe31 (diff)
Fix clamp integration APIs due to code change
Change-Id: I6537143329a8bd16c7648a07d5a00fb76d0d8130 Signed-off-by: ehautot <eh552t@intl.att.com> Issue-ID: CLAMP-100
Diffstat (limited to 'test/csit/scripts/clamp')
-rwxr-xr-xtest/csit/scripts/clamp/clone_clamp_and_change_dockercompose.sh9
-rwxr-xr-xtest/csit/scripts/clamp/kill_and_remove_clamp_and_db_containers.sh1
-rwxr-xr-xtest/csit/scripts/clamp/start_clamp_containers.sh18
3 files changed, 28 insertions, 0 deletions
diff --git a/test/csit/scripts/clamp/clone_clamp_and_change_dockercompose.sh b/test/csit/scripts/clamp/clone_clamp_and_change_dockercompose.sh
index f3b080ea1..14619b9f3 100755
--- a/test/csit/scripts/clamp/clone_clamp_and_change_dockercompose.sh
+++ b/test/csit/scripts/clamp/clone_clamp_and_change_dockercompose.sh
@@ -33,3 +33,12 @@ cd clamp/extra/docker/clamp/
# Pull the Clamp docker image from nexus instead of local image by default in the docker-compose.yml
sed -i '/image: onap\/clamp/c\ image: nexus3.onap.org:10001\/onap\/clamp' docker-compose.yml
+# Change config to take localhost:8085 for SDC and Policy simulator
+sed -i 's/classpath:\/clds\/clds-reference.properties/file:.\/config\/clds-reference-sdc_proxy.properties/g' clamp.env
+sed -i 's/classpath:\/clds\/clds-policy-config.properties/file:.\/config\/clds-policy-config-sdc_proxy.properties/g' clamp.env
+
+# Add the sql to create template so it is played by docker-compose later
+cp ../../../src/test/resources/sql/four_templates_only.sql ../../sql/bulkload/
+echo 'mysql -uroot -p$MYSQL_ROOT_PASSWORD -f < four_templates_only.sql' >> ../../sql/load-sql-files-tests-automation.sh
+
+
diff --git a/test/csit/scripts/clamp/kill_and_remove_clamp_and_db_containers.sh b/test/csit/scripts/clamp/kill_and_remove_clamp_and_db_containers.sh
index c51464300..d59d19407 100755
--- a/test/csit/scripts/clamp/kill_and_remove_clamp_and_db_containers.sh
+++ b/test/csit/scripts/clamp/kill_and_remove_clamp_and_db_containers.sh
@@ -21,5 +21,6 @@ echo "This is ${WORKSPACE}/test/csit/scripts/clamp/kill_and_remove_clamp_and_db_
kill-instance.sh clamp_clamp_1
kill-instance.sh clamp_db_1
+kill-instance.sh clamp_sdc_proxy_1
# $WORKSPACE/archives/clamp-clone deleted with archives folder when tests starts so we keep it at the end for debugging
diff --git a/test/csit/scripts/clamp/start_clamp_containers.sh b/test/csit/scripts/clamp/start_clamp_containers.sh
index 02abe264c..e49a591dd 100755
--- a/test/csit/scripts/clamp/start_clamp_containers.sh
+++ b/test/csit/scripts/clamp/start_clamp_containers.sh
@@ -48,3 +48,21 @@ if [ "$TIME" -ge "$TIME_OUT" ]; then
echo TIME OUT: Docker containers not started in $TIME_OUT seconds... Could cause problems for tests...
fi
+# To avoid some problem because templates not yet read
+TIME=0
+while [ "$TIME" -lt "$TIME_OUT" ]; do
+ response=$(curl --write-out '%{http_code}' --silent --output /dev/null -u admin:5f4dcc3b5aa765d61d8327deb882cf99 http://localhost:8080/restservices/clds/v1/cldsTempate/template-names); echo $response
+
+ if [ "$response" == "200" ]; then
+ echo Templates well available
+ break;
+ fi
+
+ echo Sleep: $INTERVAL seconds before testing if templates available. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds
+ sleep $INTERVAL
+ TIME=$(($TIME+$INTERVAL))
+done
+
+if [ "$TIME" -ge "$TIME_OUT" ]; then
+ echo TIME OUT: Templates not available in $TIME_OUT seconds... Could cause problems for tests...
+fi