summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilanap <ilanap@amdocs.com>2019-01-06 15:40:21 +0200
committerilanap <ilanap@amdocs.com>2019-01-06 15:54:04 +0200
commitbf3624457b4747338b07379aab70a840adaa96ad (patch)
tree1e365eb812a7ec55349851f73bd83c2702d8ab29
parent31742c9edf7a847df2f737270c3d2865209de967 (diff)
fix for pom and script
Change-Id: I276dbd4b19fdd4d8b240ca4b2193e26fda2243e5 Issue-ID: SDC-2028 Signed-off-by: ilanap <ilanap@amdocs.com>
-rw-r--r--cucumber-js-test-apis-ci/docker_run.sh84
1 files changed, 34 insertions, 50 deletions
diff --git a/cucumber-js-test-apis-ci/docker_run.sh b/cucumber-js-test-apis-ci/docker_run.sh
index e202c9a47b..0e52a6bcbd 100644
--- a/cucumber-js-test-apis-ci/docker_run.sh
+++ b/cucumber-js-test-apis-ci/docker_run.sh
@@ -1,9 +1,6 @@
#!/bin/bash
-TESTDIR=`pwd`
-TESTDIR=$TESTDIR/target/ciTest
-
# checking some stuff for local run
if [ -z "$BUILD_NUMBER" ]
then
@@ -18,12 +15,8 @@ then
then
IMAGES_TAG=1.4-STAGING-latest
fi
- if [ -z "$LOGS_LOCATION" ]
- then
- LOGS_LOCATION=$TESTDIR
- fi
fi
-echo $WORKSPACE
+echo "Workspace under: $WORKSPACE"
# add dynamic ports from kubernetes master
if [ -z "$TEST_CI_BE_HOST" ]
@@ -39,70 +32,61 @@ fi
echo "host $TEST_CI_BE_HOST"
-if [ -e "./target/ciTest" ]
+if [ -e "$WORKSPACE/data" ]
then
- rm -Rf ./target/ciTest
+ rm -Rf $WORKSPACE/data
fi
-mkdir -p $TESTDIR
-echo "running from $TESTDIR"
-
-mkdir -p $TESTDIR/data/logs/cucumber
-mkdir -p $TESTDIR/data/scripts
-mkdir -p $TESTDIR/data/environments
+mkdir -p $WORKSPACE/data/logs/cucumber
+mkdir -p $WORKSPACE/data/scripts
+mkdir -p $WORKSPACE/data/environments
-cp $WORKSPACE/sdc-os-chef/environments/Template.json $TESTDIR/TEST_CI.json
-cp $WORKSPACE/sdc-os-chef/scripts/docker_run.sh $TESTDIR/data/scripts
-cp $WORKSPACE/cucumber-js-test-apis-ci/config.json $TESTDIR/data/environments/dockerConfig.json
+cp $WORKSPACE/sdc-os-chef/environments/Template.json $WORKSPACE/TEST_CI.json
+cp $WORKSPACE/sdc-os-chef/scripts/docker_run.sh $WORKSPACE/data/scripts
+cp $WORKSPACE/cucumber-js-test-apis-ci/config.json $WORKSPACE/data/environments/dockerConfig.json
-chmod 777 $TESTDIR/data/scripts/docker_run.sh
+chmod 777 $WORKSPACE/data/scripts/docker_run.sh
-sed -i "s/xxx/TEST_CI/g" $TESTDIR/TEST_CI.json
-sed -i "s/yyy/$TEST_CI_BE_HOST/g" $TESTDIR/TEST_CI.json
-sed -i "s/8080/$TEST_CI_BE_PORT/g" $TESTDIR/TEST_CI.json
-mv $TESTDIR/TEST_CI.json $TESTDIR/data/environments
+sed -i "s/xxx/TEST_CI/g" $WORKSPACE/TEST_CI.json
+sed -i "s/yyy/$TEST_CI_BE_HOST/g" $WORKSPACE/TEST_CI.json
+sed -i "s/8080/$TEST_CI_BE_PORT/g" $WORKSPACE/TEST_CI.json
+mv $WORKSPACE/TEST_CI.json $WORKSPACE/data/environments
echo "getting images for $IMAGES_TAG"
-OLD_WORKSPACE=$WORKSPACE
-export WORKSPACE=$TESTDIR
$WORKSPACE/data/scripts/docker_run.sh -e TEST_CI -r $IMAGES_TAG -sim -p 10001
echo "setting configuration"
-sed -i "s/onboarding.port/$TEST_CI_BE_PORT/g" $TESTDIR/data/environments/dockerConfig.json
-sed -i "s/onboarding.server/$TEST_CI_BE_HOST/g" $TESTDIR/data/environments/dockerConfig.json
-sed -i "s/onboarding.user/cs0008/g" $TESTDIR/data/environments/dockerConfig.json
-sed -i "s/CatalogBE.port/$TEST_CI_CATALOG_PORT/g" $TESTDIR/data/environments/dockerConfig.json
-sed -i "s/CatalogBE.server/$TEST_CI_CATALOG_HOST/g" $TESTDIR/data/environments/dockerConfig.json
-sed -i "s/CatalogBE.user/cs0008/g" $TESTDIR/data/environments/dockerConfig.json
-sed -i "s/activity_spec.port/$TEST_CI_AP_PORT/g" $TESTDIR/data/environments/dockerConfig.json
-sed -i "s/activity_spec.server/$TEST_CI_AP_HOST/g" $TESTDIR/data/environments/dockerConfig.json
-sed -i "s/activity_spec.user/cs0008/g" $TESTDIR/data/environments/dockerConfig.json
-
-cat $TESTDIR/data/environments/dockerConfig.json
+sed -i "s/onboarding.port/$TEST_CI_BE_PORT/g" $WORKSPACE/data/environments/dockerConfig.json
+sed -i "s/onboarding.server/$TEST_CI_BE_HOST/g" $WORKSPACE/data/environments/dockerConfig.json
+sed -i "s/onboarding.user/cs0008/g" $WORKSPACE/data/environments/dockerConfig.json
+sed -i "s/vf.port/$TEST_CI_BE_PORT/g" $WORKSPACE/data/environments/dockerConfig.json
+sed -i "s/vf.server/$TEST_CI_BE_HOST/g" $WORKSPACE/data/environments/dockerConfig.json
+sed -i "s/vf.user/cs0008/g" $WORKSPACE/data/environments/dockerConfig.json
+sed -i "s/CatalogBE.port/$TEST_CI_CATALOG_PORT/g" $WORKSPACE/data/environments/dockerConfig.json
+sed -i "s/CatalogBE.server/$TEST_CI_CATALOG_HOST/g" $WORKSPACE/data/environments/dockerConfig.json
+sed -i "s/CatalogBE.user/cs0008/g" $WORKSPACE/data/environments/dockerConfig.json
+sed -i "s/activity_spec.port/$TEST_CI_AP_PORT/g" $WORKSPACE/data/environments/dockerConfig.json
+sed -i "s/activity_spec.server/$TEST_CI_AP_HOST/g" $WORKSPACE/data/environments/dockerConfig.json
+sed -i "s/activity_spec.user/cs0008/g" $WORKSPACE/data/environments/dockerConfig.json
+
+cat $WORKSPACE/data/environments/dockerConfig.json
echo "time to run the cucumber"
# TODO check status and tar stuff
docker run --name cucumber-sdc-api-tests --volume $WORKSPACE/data/environments:/var/lib/tests/environments --volume $WORKSPACE/data/logs/cucumber:/var/lib/tests/report onap/cucumber-sdc-api-tests:latest
+echo "Checking exit status"
DOCKER_ID=`docker ps -a --filter name="cucumber-sdc-api-test" --format "{{.ID}}"`
-EXIT_STATUS=`docker inspect $DOCKER_ID --format='{{.State.ExitCode}}'`
-echo "cucumber docker exited with status $EXIT_STATUS"
-
-tar -czf $TESTDIR/logs_$BUILD_NUMBER.tar.gz $TESTDIR/data/logs $TESTDIR/data/environments
-## Move to NFS location
-echo "Logs can be found at: $LOGS_LOCATION/logs_$BUILD_NUMBER.tar.gz"
-if [ ! -d "$LOGS_LOCATION" ]; then
- sudo mkdir -p $LOGS_LOCATION
-fi
-
-sudo cp $TESTDIR/logs_$BUILD_NUMBER.tar.gz $LOG_LOCATION_SERVER_PREFIX$LOGS_LOCATION/logs_$BUILD_NUMBER.tar.gz
-sudo cp $TESTDIR/data/cucumber/report.html $LOGS_LOCATION/emailable-report-$BUILD_NUMBER.html
-WORKSPACE=$OLD_WORKSPACE
+EXIT_STATUS=`docker inspect --format='{{.State.ExitCode}}' $DOCKER_ID`
+docker rm -f $DOCKER_ID
+echo "Exit status: $EXIT_STATUS"
+echo " logs can be found under $WORKSPACE/data/logs"
echo "removing all the dockers"
docker ps -a --filter "name=sdc-" | grep $IMAGES_TAG | cut -d " " -f1 | xargs docker rm -f
exit $EXIT_STATUS
+