diff options
Diffstat (limited to 'csit')
-rwxr-xr-x | csit/resources/scripts/run-test.sh | 7 | ||||
-rwxr-xr-x | csit/run-k8s-csit.sh | 23 |
2 files changed, 28 insertions, 2 deletions
diff --git a/csit/resources/scripts/run-test.sh b/csit/resources/scripts/run-test.sh index 4af5879f..6286e9cf 100755 --- a/csit/resources/scripts/run-test.sh +++ b/csit/resources/scripts/run-test.sh @@ -32,16 +32,19 @@ POLICY_PAP_IP=policy-pap:${DEFAULT_PORT} APEX_IP=policy-apex-pdp:${DEFAULT_PORT} POLICY_PDPX_IP=policy-xacml-pdp:${DEFAULT_PORT} POLICY_DROOLS_IP=policy-drools-pdp:9696 - +DISTRIBUTION_IP=policy-distribution:6969 DMAAP_IP=message-router:3904 APEX_EVENTS_IP=policy-apex-pdp:23324 PROMETHEUS_IP=prometheus:9090 +DIST_TEMP_FOLDER=/tmp/distribution + export ROBOT_VARIABLES= ROBOT_VARIABLES="-v DATA:$DATA -v NODETEMPLATES:$NODETEMPLATES -v POLICY_API_IP:$POLICY_API_IP -v POLICY_RUNTIME_ACM_IP:$POLICY_RUNTIME_ACM_IP -v POLICY_PAP_IP:$POLICY_PAP_IP -v APEX_IP:$APEX_IP -v APEX_EVENTS_IP:$APEX_EVENTS_IP -v DMAAP_IP:$DMAAP_IP -v PROMETHEUS_IP:${PROMETHEUS_IP} --v POLICY_PDPX_IP:$POLICY_PDPX_IP -v POLICY_DROOLS_IP:$POLICY_DROOLS_IP" +-v POLICY_PDPX_IP:$POLICY_PDPX_IP -v POLICY_DROOLS_IP:$POLICY_DROOLS_IP -v TEMP_FOLDER:${DIST_TEMP_FOLDER} +-v DISTRIBUTION_IP:$DISTRIBUTION_IP" echo "Run Robot test" echo ROBOT_VARIABLES="${ROBOT_VARIABLES}" diff --git a/csit/run-k8s-csit.sh b/csit/run-k8s-csit.sh index d84f7318..a987c112 100755 --- a/csit/run-k8s-csit.sh +++ b/csit/run-k8s-csit.sh @@ -34,12 +34,17 @@ POLICY_PAP_ROBOT="pap-test.robot" POLICY_APEX_PDP_ROBOT="apex-pdp-test.robot" POLICY_XACML_PDP_ROBOT="xacml-pdp-test.robot" POLICY_DROOLS_PDP_ROBOT="drools-pdp-test.robot" +POLICY_DISTRIBUTION_ROBOT="distribution-test.robot" POLICY_API_CONTAINER="policy-api" POLICY_PAP_CONTAINER="policy-pap" POLICY_CLAMP_CONTAINER="policy-clamp-runtime-acm" POLICY_APEX_CONTAINER="policy-apex-pdp" POLICY_DROOLS_CONTAINER="policy-drools-pdp" POLICY_XACML_CONTAINER="policy-xacml-pdp" +POLICY_DISTRIBUTION_CONTAINER="policy-distribution" + +DISTRIBUTION_CSAR=${WORKSPACE}/csit/resources/tests/data/csar +DIST_TEMP_FOLDER=/tmp/distribution export PROJECT="" export ROBOT_FILE="" @@ -89,6 +94,9 @@ function build_robot_image () { echo "Build docker image for robot framework" cd ${WORKSPACE}/csit/resources || exit; clone_models + if [ "${PROJECT}" == "distribution" ] || [ "${PROJECT}" == "policy-distribution" ]; then + copy_csar_file + fi echo "Build robot framework docker image" docker login -u docker -p docker nexus3.onap.org:10001 docker build . --file Dockerfile \ @@ -145,6 +153,15 @@ function clone_models () { >tests/models/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.v2.json } +function copy_csar_file () { + zip -F ${DISTRIBUTION_CSAR}/sample_csar_with_apex_policy.csar \ + --out ${DISTRIBUTION_CSAR}/csar_temp.csar -q + # Remake temp directory + sudo rm -rf "${DIST_TEMP_FOLDER}" + sudo mkdir "${DIST_TEMP_FOLDER}" + sudo cp ${DISTRIBUTION_CSAR}/csar_temp.csar ${DISTRIBUTION_CSAR}/temp.csar + sudo mv ${DISTRIBUTION_CSAR}/temp.csar ${DIST_TEMP_FOLDER}/sample_csar_with_apex_policy.csar +} function get_robot_file () { case $PROJECT in @@ -179,6 +196,12 @@ function get_robot_file () { export READINESS_CONTAINERS=($POLICY_DROOLS_CONTAINER) ;; + distribution | policy-distribution) + export ROBOT_FILE=($POLICY_DISTRIBUTION_ROBOT) + export READINESS_CONTAINERS=($POLICY_APEX_CONTAINER,$POLICY_API_CONTAINER,$POLICY_PAP_CONTAINER, + $POLICY_DISTRIBUTION_CONTAINER) + ;; + *) echo "unknown project supplied" ;; |