models
.vscode/
**/*.log
+**/*/Chart.lock
+**/*/charts/
--- /dev/null
+#
+# ===========LICENSE_START====================================================
+# Copyright 2023 Nordix Foundation.
+# ============================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=====================================================
+#
+version: '2'
+services:
+ policy-gui:
+ image: ${CONTAINER_LOCATION}onap/policy-gui:latest
+ container_name: policy-gui
+ depends_on:
+ - policy-clamp-backend
+ hostname: policy-gui
+ environment:
+ CLAMP_URL: http://policy-clamp-backend:8445
+ CLAMP_DISABLE_SSL_VALIDATION: "true"
+ ports:
+ - 2445:2445
+ volumes:
+ - ./config/policy-gui/application.yaml:/opt/app/policy/gui/etc/application.yml
+ - ./config/policy-gui/logback.xml:/opt/app/policy/gui/etc/logback.xml:ro
+ - ./wait_for_port.sh:/opt/app/policy/gui/bin/wait_for_port.sh:ro
+ entrypoint: ./policy-gui.sh
+ working_dir: /opt/app/policy/gui/bin
+ command: ./policy-gui.sh
+ policy-clamp-backend:
+ image: ${CONTAINER_LOCATION}onap/policy-clamp-backend:${POLICY_CLAMP_VERSION}
+ container_name: policy-clamp-backend
+ depends_on:
+ - policy-clamp-runtime-acm
+ - distribution
+ hostname: policy-clamp-backend
+ environment:
+ POLICY_API_HOST: api
+ POLICY_PAP_HOST: pap
+ MARIADB_HOST: mariadb
+ RUNTIME_HOST: policy-clamp-runtime-acm
+ ports:
+ - 8445:8445
+ volumes:
+ - ./config/clamp/ClampBackend.properties:/opt/policy/clamp/config/ClampBackend.properties:ro
+ - ./config/clamp/logback-backend.xml:/opt/policy/clamp/config/logback.xml:ro
+ working_dir: /opt/policy/clamp
+ command: java
+ -Djava.security.egd=file:/dev/./urandom
+ -XX:MinRAMPercentage=50
+ -XX:MaxRAMPercentage=75
+ -jar ./policy-clamp-backend.jar
+ --spring.config.name=ClampBackend
+ --spring.config.location=/opt/policy/clamp/config/ClampBackend.properties
+
\ No newline at end of file
SQL_DB: policyadmin
SQL_HOST: mariadb
volumes:
- - ./db_migrator_policy_init.sh:/opt/app/policy/bin/db_migrator_policy_init.sh:ro
+ - ./config/db-migrator/init.sh:/opt/app/policy/bin/db_migrator_policy_init.sh:ro
- ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
entrypoint: /opt/app/policy/bin/wait_for_port.sh
command: [
- 3904
- 6680
ports:
- - 30227:3904
+ - ${DMAAP_PORT}:3904
api:
image: ${CONTAINER_LOCATION}onap/policy-api:${POLICY_API_VERSION}
container_name: policy-api
- policy-db-migrator
hostname: policy-api
ports:
- - 30440:6969
+ - ${API_PORT}:6969
volumes:
- ./config/api/apiParameters.yaml:/opt/app/policy/api/etc/apiParameters.yaml:ro
- ./config/api/logback.xml:/opt/app/policy/api/etc/logback.xml:ro
- api
hostname: policy-pap
ports:
- - 30442:6969
+ - ${PAP_PORT}:6969
volumes:
- ./config/pap/papParameters.yaml:/opt/app/policy/pap/etc/papParameters.yaml:ro
- ./config/${PROJECT}/groups.json:/opt/app/policy/pap/etc/mounted/groups.json:ro
- pap
hostname: policy-xacml-pdp
ports:
- - 30441:6969
+ - ${XACML_PORT}:6969
- 30999:3904
volumes:
- ./config/xacml-pdp/defaultConfig.json:/opt/app/policy/pdpx/etc/defaultConfig.json:ro
- pap
hostname: drools
ports:
- - 30217:6969
- - 30216:9696
+ - ${DROOLS_PORT}:6969
+ - ${DROOLS_TELEMETRY_PORT}:9696
volumes:
- ./config/drools-pdp/custom:/tmp/policy-install/config:ro
- ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
- xacml-pdp
hostname: drools-apps
ports:
- - 30221:6969
- - 30219:9696
+ - ${DROOLS_APPS_PORT}:6969
+ - ${DROOLS_APPS_TELEMETRY_PORT}:9696
volumes:
- ./config/drools-applications/custom:/tmp/policy-install/config:ro
- ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
- pap
hostname: policy-apex-pdp
ports:
- - 30237:6969
- - 23324:23324
+ - ${APEX_PORT}:6969
+ - ${APEX_EVENTS_PORT}:23324
volumes:
- ./config/apex-pdp/OnapPfConfig.json:/opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json:ro
- ./config/apex-pdp/logback.xml:/opt/app/policy/apex-pdp/etc/logback.xml:ro
- apex-pdp
hostname: policy-distribution
ports:
- - 30238:6969
+ - ${DIST_PORT}:6969
volumes:
- ./config/distribution/defaultConfig.json:/opt/app/policy/distribution/etc/defaultConfig.json:ro
- - ./distribution/config/temp/:/opt/app/policy/distribution/etc/temp/:ro
+ - /tmp/distribution/:/opt/app/policy/distribution/etc/temp/:ro
- ./config/distribution/logback.xml:/opt/app/policy/distribution/etc/logback.xml:ro
- ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
entrypoint: /opt/app/policy/bin/wait_for_port.sh
- simulator
hostname: policy-clamp-runtime-acm
ports:
- - 30258:6969
+ - ${ACM_PORT}:6969
volumes:
- ./config/clamp/AcRuntimeParameters.yaml:/opt/app/policy/clamp/etc/AcRuntimeParameters.yaml
- ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
- api
hostname: policy-clamp-ac-pf-ppnt
ports:
- - 30218:6969
+ - ${POLICY_PARTICIPANT_PORT}:6969
volumes:
- ./config/clamp/PolicyParticipantParameters.yaml:/opt/app/policy/clamp/etc/PolicyParticipantParameters.yaml:ro
- ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
'-c', './a1pms-participant.sh',
'message-router', '3904'
]
- policy-gui:
- image: ${CONTAINER_LOCATION}onap/policy-gui:latest
- container_name: policy-gui
- depends_on:
- - policy-clamp-backend
- hostname: policy-gui
- environment:
- CLAMP_URL: http://policy-clamp-backend:8445
- CLAMP_DISABLE_SSL_VALIDATION: "true"
- ports:
- - 2445:2445
- volumes:
- - ./config/policy-gui/application.yaml:/opt/app/policy/gui/etc/application.yml
- - ./config/policy-gui/logback.xml:/opt/app/policy/gui/etc/logback.xml:ro
- - ./wait_for_port.sh:/opt/app/policy/gui/bin/wait_for_port.sh:ro
- entrypoint: ./policy-gui.sh
- working_dir: /opt/app/policy/gui/bin
- command: ./policy-gui.sh
- policy-clamp-backend:
- image: ${CONTAINER_LOCATION}onap/policy-clamp-backend:${POLICY_CLAMP_VERSION}
- container_name: policy-clamp-backend
- depends_on:
- - policy-clamp-runtime-acm
- - distribution
- hostname: policy-clamp-backend
- environment:
- POLICY_API_HOST: api
- POLICY_PAP_HOST: pap
- MARIADB_HOST: mariadb
- RUNTIME_HOST: policy-clamp-runtime-acm
- ports:
- - 8445:8445
- volumes:
- - ./config/clamp/ClampBackend.properties:/opt/policy/clamp/config/ClampBackend.properties:ro
- - ./config/clamp/logback-backend.xml:/opt/policy/clamp/config/logback.xml:ro
- working_dir: /opt/policy/clamp
- command: java
- -Djava.security.egd=file:/dev/./urandom
- -XX:MinRAMPercentage=50
- -XX:MaxRAMPercentage=75
- -jar ./policy-clamp-backend.jar
- --spring.config.name=ClampBackend
- --spring.config.location=/opt/policy/clamp/config/ClampBackend.properties
prometheus:
image: prom/prometheus:v2.32.1
container_name: prometheus
hostname: prometheus
ports:
- - 30259:9090
+ - ${PROMETHEUS_PORT}:9090
volumes:
- ./metrics/prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
- prometheus
hostname: grafana
ports:
- - 30269:3000
+ - ${GRAFANA_PORT}:3000
volumes:
- ./metrics/dashboard.yaml:/etc/grafana/provisioning/dashboards/dashboard.yaml
- ./metrics/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
-# ============LICENSE_START====================================================
-# Copyright (C) 2022 Nordix Foundation.
-# =============================================================================
+#!/bin/bash
+# ============LICENSE_START=======================================================
+# Copyright 2023 Nordix Foundation.
+# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END======================================================
-
-
-if [ "$#" -ne 1 ]
-then
- echo "Usage: $0 <container-name>"
- exit 1
-fi
-
-export PROJECT=$1
+# ============LICENSE_END=========================================================
if $(docker images | grep -q "onap\/policy-api")
then
- export CONTAINER_LOCATION=$(
+ CONTAINER_LOCATION=$(
docker images |
grep onap/policy-api |
head -1 |
sed 's/onap\/policy-api.*$//'
)
+ export CONTAINER_LOCATION
else
export CONTAINER_LOCATION="nexus3.onap.org:10001/"
fi
-SCRIPTS=$(git rev-parse --show-toplevel)
-export SCRIPTS="${SCRIPTS}"/csit
-
-source "${SCRIPTS}"/get-versions.sh
-
-docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up $*
-
-echo "Clamp GUI: https://localhost:2445/clamp"
+# EXPLICITLY ASSIGN PORTS FOR TESTING PURPOSES
+export APEX_PORT=30001
+export APEX_EVENTS_PORT=23324
+export API_PORT=30002
+export PAP_PORT=30003
+export XACML_PORT=30004
+export DROOLS_PORT=30005
+export DROOLS_TELEMETRY_PORT=30216
+export DIST_PORT=30006
+export ACM_PORT=30007
+export POLICY_PARTICIPANT_PORT=30008
+export DROOLS_APPS_PORT=30009
+export DROOLS_APPS_TELEMETRY_PORT=30219
+export DMAAP_PORT=30904
+export PROMETHEUS_PORT=30259
+export GRAFANA_PORT=30269
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END======================================================
-
-if [[ -z "$GERRIT_BRANCH" ]]
-then
- source "${SCRIPTS}"/get-branch.sh
-else
- echo GERRIT_BRANCH="${GERRIT_BRANCH}"
+if [ -z "${WORKSPACE}" ]; then
+ WORKSPACE=$(git rev-parse --show-toplevel)
+ export WORKSPACE
fi
+GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
+ "${WORKSPACE}"/.gitreview)
+
+echo GERRIT_BRANCH="${GERRIT_BRANCH}"
+
export POLICY_MARIADB_VER=10.10.2
echo POLICY_MARIADB_VER=${POLICY_MARIADB_VER}
function getDockerVersion
{
- REPO=$1
- DEFAULT_DOCKER_IMAGE_NAME=$2
- DEFAULT_DOCKER_IMAGE_VERSION=$3
+ REPO=${1}
+ DEFAULT_DOCKER_IMAGE_NAME=${2:-}
+ DEFAULT_DOCKER_IMAGE_VERSION=${3:-}
REPO_RELEASE_DATA=$(
curl -qL --silent \
--- /dev/null
+#!/bin/bash
+#
+# ============LICENSE_START====================================================
+# Copyright (C) 2022-2023 Nordix Foundation.
+# =============================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END======================================================
+
+#Usage: $0 [policy-component] [OPTIONS]"
+#" OPTIONS:"
+#" --grafana start the docker compose with grafana"
+#" --gui start the docker compose with gui"
+#" no policy-component will start all components"
+
+if [ -z "${WORKSPACE}" ]; then
+ WORKSPACE=$(git rev-parse --show-toplevel)
+ export WORKSPACE
+fi
+COMPOSE_FOLDER="${WORKSPACE}"/compose
+
+# Set default values for the options
+grafana=false
+gui=false
+
+# Parse the command-line arguments
+while [[ $# -gt 0 ]]
+do
+ key="$1"
+
+ case $key in
+ --grafana)
+ grafana=true
+ shift
+ ;;
+ --gui)
+ gui=true
+ shift 2
+ break;
+ ;;
+ *)
+ echo "$1"
+ component="$1"
+ shift
+ ;;
+ esac
+done
+
+echo "Configuring docker compose..."
+source "${COMPOSE_FOLDER}"/export-ports.sh > /dev/null 2>&1
+source "${COMPOSE_FOLDER}"/get-versions.sh > /dev/null 2>&1
+
+# in case of csit running for PAP (groups should be for pap) but starts apex-pdp for dependencies.
+if [ -z "$PROJECT" ]; then
+ PROJECT=$component
+fi
+
+if [ -n "$component" ]; then
+ if [ "$grafana" = true ]; then
+ echo "Starting ${component} application with Grafana"
+ docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml up -d "${component}" grafana
+ echo "Prometheus server: http://localhost:${PROMETHEUS_PORT}"
+ echo "Grafana server: http://localhost:${GRAFANA_PORT}"
+ elif [ "$gui" = true ]; then
+ echo "Starting application with gui..."
+ docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml \
+ -f "${COMPOSE_FOLDER}"/docker-compose.gui.yml up -d "${component}" policy-gui
+ echo "Clamp GUI: https://localhost:2445/clamp"
+ else
+ echo "Starting ${component} application"
+ docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml up -d "${component}"
+ fi
+else
+ PROJECT=pap
+ if [ "$gui" = true ]; then
+ echo "Starting application with gui..."
+ docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml \
+ -f "${COMPOSE_FOLDER}"/docker-compose.gui.yml up -d
+ echo "Clamp GUI: https://localhost:2445/clamp"
+ else
+ echo "Starting all components..."
+ docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml up -d
+ fi
+fi
#!/bin/bash
#
# ============LICENSE_START====================================================
-# Copyright (C) 2022-2023 Nordix Foundation.
+# Copyright (C) 2023 Nordix Foundation.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END======================================================
-SCRIPTS=$(git rev-parse --show-toplevel)
-export SCRIPTS="${SCRIPTS}"/csit
-export CONTAINER_LOCATION="nexus3.onap.org:10001/"
-
-source "${SCRIPTS}"/get-versions.sh
+echo "Shut down started!"
+if [ -z "${WORKSPACE}" ]; then
+ WORKSPACE=$(git rev-parse --show-toplevel)
+ export WORKSPACE
+fi
+COMPOSE_FOLDER="${WORKSPACE}"/compose
-export PROJECT="${1}"
+source "${COMPOSE_FOLDER}"/export-ports.sh > /dev/null 2>&1
+source "${COMPOSE_FOLDER}"/get-versions.sh > /dev/null 2>&1
-if [ -z "${PROJECT}" ]; then
- echo "Starting all components..."
- docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d
-else
- echo "Starting ${PROJECT} application..."
- docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d "${PROJECT}" grafana
-fi
+echo "Collecting logs from docker compose containers..."
+docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml logs > docker_compose.log
+cat docker_compose.log
-echo "Prometheus server: http://localhost:30259"
-echo "Grafana server: http://localhost:30269"
+echo "Tearing down containers..."
+docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml down -v
+++ /dev/null
-#!/bin/bash
-# ============LICENSE_START=======================================================
-# Copyright (C) 2018 Ericsson. All rights reserved.
-#
-# Modifications Copyright (c) 2019-2023 Nordix Foundation.
-# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property.
-# Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-echo "Uninstall docker-py and reinstall docker."
-python3 -m pip uninstall -y docker-py
-python3 -m pip uninstall -y docker
-python3 -m pip install -U docker
-
-sudo apt-get -y install libxml2-utils
-
-source "${SCRIPTS}"/get-versions.sh
-
-docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d apex-pdp grafana
-
-unset http_proxy https_proxy
-
-POLICY_API_IP=$(get-instance-ip.sh policy-api)
-POLICY_API_PORT=30440
-POLICY_PAP_IP=$(get-instance-ip.sh policy-pap)
-POLICY_PAP_PORT=30442
-MARIADB_IP=$(get-instance-ip.sh mariadb)
-APEX_IP=$(get-instance-ip.sh policy-apex-pdp)
-APEX_PORT=30237
-SIM_IP=$(get-instance-ip.sh simulator)
-export SIM_IP
-
-echo PAP IP IS "${POLICY_PAP_IP}"
-echo MARIADB IP IS "${MARIADB_IP}"
-echo API IP IS "${POLICY_API_IP}"
-echo APEX IP IS "${APEX_IP}"
-echo DMAAP_IP IS "${SIM_IP}"
-
-# wait for the app to start up
-"${SCRIPTS}"/wait_for_rest.sh localhost "${APEX_PORT}"
-
-ROBOT_VARIABLES=""
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCRIPTS:${SCRIPTS}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_IP:${APEX_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_PORT:${APEX_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_PORT:${POLICY_API_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_PORT:${POLICY_PAP_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DMAAP_IP:${SIM_IP}"
+++ /dev/null
-# Test suites are relative paths under [policy/docker.git]/csit/[project]/tests.
-# Place the suites in run order.
-apex-pdp-test.robot
+++ /dev/null
-#!/bin/bash
-# ============LICENSE_START=======================================================
-# Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
-# Modifications Copyright 2021-2023 Nordix Foundation.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-echo "Uninstall docker-py and reinstall docker."
-python3 -m pip uninstall -y docker-py
-python3 -m pip uninstall -y docker
-python3 -m pip install -U docker
-
-source "${SCRIPTS}"/get-versions.sh
-
-sudo apt-get -y install libxml2-utils
-bash "${SCRIPTS}"/get-models-examples.sh
-
-DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
-
-NODETEMPLATES=${WORKSPACE}/models/models-examples/src/main/resources/nodetemplates
-
-# create a couple of variations of the policy definitions
-sed -e 's!Measurement_vGMUX!ADifferentValue!' \
- ${DATA}/vCPE.policy.monitoring.input.tosca.json \
- >${DATA}/vCPE.policy.monitoring.input.tosca.v1_2.json
-
-sed -e 's!"version": "1.0.0"!"version": "2.0.0"!' \
- -e 's!"policy-version": 1!"policy-version": 2!' \
- ${DATA}/vCPE.policy.monitoring.input.tosca.json \
- >${DATA}/vCPE.policy.monitoring.input.tosca.v2.json
-
-echo "${POLICY_API_VERSION}"
-
-cd "${SCRIPTS}"
-docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d api grafana
-
-sleep 10
-unset http_proxy https_proxy
-
-POLICY_API_IP=$(get-instance-ip.sh policy-api)
-POLICY_API_PORT=30440
-MARIADB_IP=$(get-instance-ip.sh mariadb)
-
-echo API IP IS "${POLICY_API_IP}"
-echo MARIADB IP IS "${MARIADB_IP}"
-
-# wait for the app to start up
-"${SCRIPTS}"/wait_for_rest.sh localhost "$POLICY_API_PORT"
-
-ROBOT_VARIABLES=""
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_PORT:${POLICY_API_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v NODETEMPLATES:${NODETEMPLATES}"
\ No newline at end of file
+++ /dev/null
-# Test suites are relative paths under [policy/docker.git]/csit/[project]/tests.
-# Place the suites in run order.
-api-test.robot
+++ /dev/null
-#!/bin/bash
-# ============LICENSE_START=======================================================
-# Copyright (C) 2021-2023 Nordix Foundation.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-echo "Uninstall docker-py and reinstall docker."
-pip uninstall -y docker-py
-pip uninstall -y docker
-pip install -U docker==2.7.0
-
-sudo apt-get -y install libxml2-utils
-
-source "${SCRIPTS}"/get-versions.sh
-
-# Bringup ACM runtime containers
-docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d policy-clamp-runtime-acm grafana
-
-sleep 10
-unset http_proxy https_proxy
-
-POLICY_RUNTIME_ACM_IP=$(get-instance-ip.sh policy-clamp-runtime-acm)
-POLICY_RUNTIME_ACM_PORT=30258
-MARIADB_IP=$(get-instance-ip.sh mariadb)
-DMAAP_IP=$(get-instance-ip.sh simulator)
-
-echo MARIADB IP IS "${MARIADB_IP}"
-echo DMAAP_IP IS "${DMAAP_IP}"
-echo POLICY RUNTIME ACM IP IS "${POLICY_RUNTIME_ACM_IP}"
-
-# wait for the app to start up
-"${SCRIPTS}"/wait_for_rest.sh localhost "${POLICY_RUNTIME_ACM_PORT}"
-
-# TODO: This disables the participant during ACM refactoring, will be reenabled when ACM
-# TODO: tests are re-enabled
-
-# Bring up ACM participant containers
-#docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d policy-clamp-ac-k8s-ppnt
-#docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d policy-clamp-ac-http-ppnt
-#docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d policy-clamp-ac-pf-ppnt
-#docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d policy-clamp-ac-a1pms-ppnt
-
-#sleep 10
-unset http_proxy https_proxy
-
-POLICY_PARTICIPANT_IP=$(get-instance-ip.sh policy-clamp-ac-pf-ppnt)
-POLICY_PARTICIPANT_PORT=30218
-POLICY_API_IP=$(get-instance-ip.sh policy-api)
-POLICY_API_PORT=30440
-K8S_PARTICIPANT_IP=$(get-instance-ip.sh policy-clamp-ac-k8s-ppnt)
-K8S_PARTICIPANT_PORT=30295
-HTTP_PARTICIPANT_IP=$(get-instance-ip.sh policy-clamp-ac-http-ppnt)
-HTTP_PARTICIPANT_PORT=30290
-A1PMS_PARTICIPANT_IP=$(get-instance-ip.sh policy-clamp-ac-a1pms-ppnt)
-A1PMS_PARTICIPANT_PORT=30296
-
-echo POLICY PARTICIPANT IP IS "${POLICY_PARTICIPANT_IP}"
-echo API IP IS "${POLICY_API_IP}"
-echo K8S PARTICIPANT IP IS "${K8S_PARTICIPANT_IP}"
-echo HTTP PARTICIPANT IP IS "${HTTP_PARTICIPANT_IP}"
-echo A1PMS PARTICIPANT IP IS "${A1PMS_PARTICIPANT_IP}"
-
-# wait for the app to start up
-#"${SCRIPTS}"/wait_for_rest.sh localhost "${POLICY_PARTICIPANT_PORT}"
-
-ROBOT_VARIABLES=""
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_RUNTIME_ACM_IP:${POLICY_RUNTIME_ACM_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_RUNTIME_ACM_PORT:${POLICY_RUNTIME_ACM_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PARTICIPANT_IP:${POLICY_PARTICIPANT_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PARTICIPANT_PORT:${POLICY_PARTICIPANT_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v K8S_PARTICIPANT_IP:${K8S_PARTICIPANT_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v K8S_PARTICIPANT_PORT:${K8S_PARTICIPANT_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v HTTP_PARTICIPANT_IP:${HTTP_PARTICIPANT_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v HTTP_PARTICIPANT_PORT:${HTTP_PARTICIPANT_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v A1PMS_PARTICIPANT_IP:${A1PMS_PARTICIPANT_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v A1PMS_PARTICIPANT_PORT:${A1PMS_PARTICIPANT_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_PORT:${POLICY_API_PORT}"
+++ /dev/null
-# Test suites are relative paths under [policy/docker.git]/csit/[project]/tests.
-# Place the suites in run order.
-policy-clamp-test.robot
+++ /dev/null
-#
-# ===========LICENSE_START====================================================
-# Copyright (C) 2022 Nordix Foundation.
-# ============================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=====================================================
-#
-version: '2'
-services:
- postgres:
- image: nexus3.onap.org:10001/library/postgres:${POLICY_POSTGRES_VER}
- container_name: postgres
- hostname: postgres
- command: ['--idle_in_transaction_session_timeout=28800']
- env_file: config/db-pg/db-pg.conf
- volumes:
- - ./config/db-pg:/docker-entrypoint-initdb.d:ro
- expose:
- - 5432
- policy-db-migrator-postgres:
- image: nexus3.onap.org:10001/onap/policy-db-migrator:${POLICY_DOCKER_VERSION}
- container_name: policy-db-migrator-postgres
- hostname: policy-db-migrator-postgres
- depends_on:
- - postgres
- expose:
- - 6824
- env_file: config/db-pg/db-pg.conf
- environment:
- SQL_DB: policyadmin
- SQL_HOST: postgres
- PGPASSWORD: policy_user
- volumes:
- - ./db_migrator_policy_init_pg.sh:/opt/app/policy/bin/db_migrator_policy_init_pg.sh:ro
- - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
- entrypoint: /opt/app/policy/bin/wait_for_port.sh
- command: [
- '-c',
- '/opt/app/policy/bin/db_migrator_policy_init_pg.sh',
- 'postgres', '5432'
- ]
- api:
- image: nexus3.onap.org:10001/onap/policy-api:${POLICY_API_VERSION}
- container_name: policy-api
- depends_on:
- - policy-db-migrator-postgres
- hostname: policy-api
- expose:
- - 6980
- volumes:
- - ./config/ks.jks:/opt/app/policy/api/etc/ssl/policy-keystore:ro
- - ./config/policy-truststore:/opt/app/policy/api/etc/ssl/policy-truststore:ro
- - ./wait_for_port.sh:/opt/app/policy/api/bin/wait_for_port.sh:ro
- entrypoint: ./wait_for_port.sh
- command: [
- '-c', './policy-api.sh',
- 'postgres', '5432',
- 'policy-db-migrator-postgres', '6824'
- ]
\ No newline at end of file
+++ /dev/null
-echo "Uninstall docker-py and reinstall docker."
-python3 -m pip uninstall -y docker-py
-python3 -m pip uninstall -y docker
-python3 -m pip install -U docker
-python3 -m pip install -U robotframework-databaselibrary
-python3 -m pip install psycopg2-binary
-
-sudo apt-get -y install libxml2-utils
-
-source "${SCRIPTS}"/get-versions.sh
-
-cd "${SCRIPTS}"
-docker-compose -f "${SCRIPTS}"/compose-postgres.yml up -d
-
-sleep 15
-unset http_proxy https_proxy
-
-POSTGRES_IP=$(get-instance-ip.sh postgres)
-POLICY_API_IP=$(get-instance-ip.sh policy-api)
-
-echo POSTGRES IP IS "${POSTGRES_IP}"
-echo POLICY_API_IP IS "${POLICY_API_IP}"
-
-ROBOT_VARIABLES=""
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POSTGRES_IP:${POSTGRES_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
\ No newline at end of file
+++ /dev/null
-#!/bin/bash
-# ============LICENSE_START=======================================================
-# Copyright (C) 2022 Nordix Foundation.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-docker-compose -f ${SCRIPTS}/compose-postgres.yml down -v
\ No newline at end of file
+++ /dev/null
-# Test suites are relative paths under [policy/docker.git]/csit/[project]/tests.
-# Place the suites in run order.
-db-migrator-test.robot
+++ /dev/null
-*** Settings ***
-Suite Setup Connect To Database psycopg2 ${DB_NAME} ${DB_USERNAME} ${DB_PASSWORD} ${POSTGRES_IP} ${DB_PORT}
-Suite Teardown Disconnect From Database
-Library DatabaseLibrary
-Library String
-Library RequestsLibrary
-Library OperatingSystem
-Library json
-Resource ${CURDIR}/../../common-library.robot
-
-*** Variables ***
-${DB_NAME} = policyadmin
-${DB_USERNAME} = policy_user
-${DB_PASSWORD} = policy_user
-${DB_PORT} = 5432
-${PGPASSWORD} = policy_user
-
-*** Keywords ***
-GetReq
- [Arguments] ${url}
- ${auth}= PolicyAdminAuth
- ${resp}= PerformGetRequest ${POLICY_API_IP} ${url} 200 null ${auth}
- [return] ${resp}
-
-*** Test Cases ***
-Test Connection
- ${output} = Execute SQL String SELECT datname FROM pg_database WHERE datname='policyadmin';
- Log ${output}
- Should Be Equal As Strings ${output} None
-
-Healthcheck
- [Documentation] Verify policy api health check
- ${resp}= GetReq /policy/api/v1/healthcheck
- Should Be Equal As Strings ${resp.json()['code']} 200
\ No newline at end of file
+++ /dev/null
-#!/bin/bash
-# ============LICENSE_START=======================================================
-# Copyright (C) 2018 Ericsson. All rights reserved.
-# Modifications Copyright (c) 2019-2023 Nordix Foundation.
-# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-echo "Uninstall docker-py and reinstall docker."
-python3 -m pip uninstall -y docker-py
-python3 -m pip uninstall -y docker
-python3 -m pip install -U docker
-
-sudo apt-get -y install libxml2-utils
-
-source "${SCRIPTS}"/get-versions.sh
-
-SCRIPT_DIR=${TESTPLANDIR}/config
-
-# Remaking the csar file in case if the file got corrupted
-zip -F "${SCRIPT_DIR}"/csar/sample_csar_with_apex_policy.csar --out "${SCRIPT_DIR}"/csar/csar_temp.csar
-
-# Remake temp directory
-rm -rf "${SCRIPT_DIR}"/temp
-mkdir "${SCRIPT_DIR}"/temp
-
-docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d distribution
-
-unset http_proxy https_proxy
-
-POLICY_API_IP=$(get-instance-ip.sh policy-api)
-POLICY_PAP_IP=$(get-instance-ip.sh policy-pap)
-MARIADB_IP=$(get-instance-ip.sh mariadb)
-APEX_IP=$(get-instance-ip.sh policy-apex-pdp)
-APEX_PORT=30237
-DMAAP_IP=$(get-instance-ip.sh simulator)
-POLICY_DISTRIBUTION_IP=$(get-instance-ip.sh policy-distribution)
-POLICY_DISTRIBUTION_PORT=30238
-
-echo PAP IP IS "${POLICY_PAP_IP}"
-echo MARIADB IP IS "${MARIADB_IP}"
-echo API IP IS "${POLICY_API_IP}"
-echo APEX IP IS "${APEX_IP}"
-echo DMAAP_IP IS "${DMAAP_IP}"
-echo POLICY_DISTRIBUTION_IP IS "${POLICY_DISTRIBUTION_IP}"
-
-# wait for the app to start up
-"${SCRIPTS}"/wait_for_rest.sh localhost "${POLICY_DISTRIBUTION_PORT}"
-
-ROBOT_VARIABLES=""
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_IP:${APEX_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_PORT:${APEX_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCRIPT_DIR:${SCRIPT_DIR}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_DISTRIBUTION_IP:${POLICY_DISTRIBUTION_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_DISTRIBUTION_PORT:${POLICY_DISTRIBUTION_PORT}"
+++ /dev/null
-# Test suites are relative paths under [policy/docker.git]/csit/[project]/tests.
-# Place the suites in run order.
-distribution-test.robot
+++ /dev/null
-{
- "nameSpace": "org.onap.policy.apex.sample.events",
- "name": "Event0000",
- "version": "0.0.1",
- "source": "REST_0",
- "target": "apex",
- "TestSlogan": "Test slogan for External Event0",
- "TestMatchCase": 3,
- "TestTimestamp": 1536363522018,
- "TestTemperature": 9080.866
-}
+++ /dev/null
-#!/bin/bash
-#
-# ===========LICENSE_START====================================================
-# Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
-# Modifications Copyright 2021-2023 Nordix Foundation.
-# ============================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=====================================================
-#
-
-echo "Uninstall docker-py and reinstall docker."
-python3 -m pip uninstall -y docker-py
-python3 -m pip uninstall -y docker
-python3 -m pip install -U docker
-
-sudo apt-get -y install libxml2-utils
-
-source "${SCRIPTS}"/get-versions.sh
-bash "${SCRIPTS}"/get-models-examples.sh
-
-docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d drools-apps
-
-unset http_proxy https_proxy
-
-DROOLS_IP=$(get-instance-ip.sh drools-apps)
-DROOLS_PORT=30221
-API_IP=$(get-instance-ip.sh policy-api)
-API_PORT=30440
-PAP_IP=$(get-instance-ip.sh policy-pap)
-PAP_PORT=30442
-XACML_IP=$(get-instance-ip.sh policy-xacml-pdp)
-XACML_PORT=30441
-SIM_IP=$(get-instance-ip.sh simulator)
-export SIM_IP
-
-echo DROOLS IP IS "${DROOLS_IP}"
-echo API IP IS "${API_IP}"
-echo PAP IP IS "${PAP_IP}"
-echo XACML IP IS "${XACML_IP}"
-echo SIMULATORS IP IS "${SIM_IP}"
-
-# wait for the app to start up
-"${SCRIPTS}"/wait_for_rest.sh localhost 30219
-
-# give enough time for the controllers to come up
-sleep 15
-
-DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
-DATA2=${TESTPLANDIR}/tests/data
-
-ROBOT_VARIABLES=""
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCRIPTS}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA2:${DATA2}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_PORT:${DROOLS_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v API_IP:${API_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v API_PORT:${API_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v PAP_IP:${PAP_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v PAP_PORT:${PAP_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_IP:${XACML_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_PORT:${XACML_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SIM_IP:${SIM_IP}"
+++ /dev/null
-# Test suites are relative paths under [policy/docker.git]/csit/[project]/tests.
-# Place the suites in run order.
-drools-applications-test.robot
+++ /dev/null
-#!/bin/bash
-# ============LICENSE_START=======================================================
-# Copyright 2017-2021 AT&T Intellectual Property. All rights reserved.
-# Modifications Copyright 2021-2023 Nordix Foundation.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-echo "Uninstall docker-py and reinstall docker."
-python3 -m pip uninstall -y docker-py
-python3 -m pip uninstall -y docker
-python3 -m pip install -U docker
-
-sudo apt-get -y install libxml2-utils
-
-source "${SCRIPTS}"/get-versions.sh
-
-docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d drools
-
-POLICY_DROOLS_IP=$(get-instance-ip.sh drools)
-POLICY_DROOLS_PORT=30217
-MARIADB_IP=$(get-instance-ip.sh mariadb)
-
-echo DROOLS IP IS "${POLICY_DROOLS_IP}"
-echo MARIADB IP IS "${MARIADB_IP}"
-
-# wait for the app to start up - looking for telemetry service on port 30216 forwarded from 9696
-"${SCRIPTS}"/wait_for_rest.sh localhost 30216
-
-# give enough time for the controllers to come up
-sleep 15
-
-ROBOT_VARIABLES=""
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_DROOLS_IP:${POLICY_DROOLS_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_DROOLS_PORT:${POLICY_DROOLS_PORT}"
+++ /dev/null
-# Test suites are relative paths under [policy/docker.git]/csit/[project]/tests.
-# Place the suites in run order.
-drools-pdp-test.robot
+++ /dev/null
-# ============LICENSE_START====================================================
-# Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
-# Modifications Copyright 2022 Nordix Foundation.
-# =============================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END======================================================
-
-export NEXUS_URL=https://nexus.onap.org/content/repositories/snapshots
-
-GIT_TOP=$(git rev-parse --show-toplevel)
-GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
- "${GIT_TOP}"/.gitreview)
-echo GERRIT_BRANCH="${GERRIT_BRANCH}"
+++ /dev/null
-#!/bin/bash
-#
-# Copyright 2016-2017 Huawei Technologies Co., Ltd.
-# Modification Copyright 2021 © AT&T Intellectual Property.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $1
+++ /dev/null
-#!/bin/bash
-#
-# ============LICENSE_START===================================================
-# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
-# Modifications Copyright 2022 Nordix Foundation.
-# ============================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=====================================================
-#
-
-source "${SCRIPTS}"/get-branch.sh
-
-rm -rf "${WORKSPACE}"/models
-mkdir "${WORKSPACE}"/models
-cd "${WORKSPACE}"
-
-# download models examples
-git clone -b "${GERRIT_BRANCH}" --single-branch https://github.com/onap/policy-models.git models
+++ /dev/null
-#!/bin/bash
-# ============LICENSE_START=======================================================
-# Copyright (C) 2019-2022 Nordix Foundation.
-# Modifications Copyright (C) 2019-2021 AT&T Intellectual Property.
-# Modifications Copyright (C) 2022-2023 Nordix Foundation.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-echo "Uninstall docker-py and reinstall docker."
-python3 -m pip uninstall -y docker-py
-python3 -m pip uninstall -y docker
-python3 -m pip install -U docker
-
-source "${SCRIPTS}"/get-versions.sh
-
-sudo apt-get -y install libxml2-utils
-bash "${SCRIPTS}"/get-models-examples.sh
-
-echo "${POLICY_PAP_VERSION}"
-
-cd "${SCRIPTS}"
-docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d pap apex-pdp grafana
-
-sleep 10
-unset http_proxy https_proxy
-
-POLICY_PAP_PORT=30442
-POLICY_API_PORT=30440
-
-# wait for the app to start up
-"${SCRIPTS}"/wait_for_rest.sh localhost "${POLICY_PAP_PORT}"
-
-DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
-
-NODETEMPLATES=${WORKSPACE}/models/models-examples/src/main/resources/nodetemplates
-
-ROBOT_VARIABLES=""
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_PORT:${POLICY_PAP_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_PORT:${POLICY_API_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v NODETEMPLATES:${NODETEMPLATES}"
+++ /dev/null
-# Test suites are relative paths under [policy/docker.git]/csit/[project]/tests.
-# Place the suites in run order.
-pap-test.robot
-pap-slas.robot
--- /dev/null
+FROM python:3
+ARG CSIT_SCRIPT=${CSIT_SCRIPT}
+ARG ROBOT_FILE=${ROBOT_FILE}
+ENV ROBOT_WORKSPACE /opt/robotworkspace
+ENV ROBOT_FILE $ROBOT_FILE
+RUN python3 -m pip install --upgrade pip
+RUN python3 -m pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==0.5.1.*' --pre
+RUN python3 -m pip freeze
+RUN mkdir -p ${ROBOT_WORKSPACE}
+COPY ${CSIT_SCRIPT} ${ROBOT_WORKSPACE}/
+COPY tests/ ${ROBOT_WORKSPACE}/
+WORKDIR ${ROBOT_WORKSPACE}
+RUN chmod +x run-test.sh
+CMD ["sh", "-c", "./run-test.sh" , "${ROBOT_FILE}"]
--- /dev/null
+#!/bin/bash
+# ============LICENSE_START=======================================================
+# Copyright 2023 Nordix Foundation.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+if [ -z "${WORKSPACE}" ]; then
+ WORKSPACE=$(git rev-parse --show-toplevel)
+ export WORKSPACE
+fi
+
+GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
+ "${WORKSPACE}"/.gitreview)
+
+echo GERRIT_BRANCH="${GERRIT_BRANCH}"
+
+rm -rf "${WORKSPACE}"/models
+mkdir "${WORKSPACE}"/models
+
+# download models examples
+git clone -b "${GERRIT_BRANCH}" --single-branch https://github.com/onap/policy-models.git \
+ "${WORKSPACE}"/models
+
+export DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
+
+export NODETEMPLATES=${WORKSPACE}/models/models-examples/src/main/resources/nodetemplates
+
+# create a couple of variations of the policy definitions
+sed -e 's!Measurement_vGMUX!ADifferentValue!' \
+ "${DATA}"/vCPE.policy.monitoring.input.tosca.json \
+ >"${DATA}"/vCPE.policy.monitoring.input.tosca.v1_2.json
+
+sed -e 's!"version": "1.0.0"!"version": "2.0.0"!' \
+ -e 's!"policy-version": 1!"policy-version": 2!' \
+ "${DATA}"/vCPE.policy.monitoring.input.tosca.json \
+ >"${DATA}"/vCPE.policy.monitoring.input.tosca.v2.json
#
if [ -z "$WORKSPACE" ]; then
- export WORKSPACE=$(git rev-parse --show-toplevel)
+ WORKSPACE=$(git rev-parse --show-toplevel)
+ export WORKSPACE
fi
ROBOT_VENV=$(mktemp -d)
echo "Python version is: $(python3 --version)"
python3 -m venv --clear "${ROBOT_VENV}"
-source "${ROBOT_VENV}/bin/activate"
+source "${ROBOT_VENV}/bin/activate" > /dev/null
set -exu
-python3 -m pip install --upgrade pip setuptools
+python3 -m pip install -qq --upgrade pip setuptools
echo "Installing Python Requirements"
-python3 -m pip install -r ${SCRIPTS}/pylibs.txt
-python3 -m pip freeze
+python3 -m pip install -qq -r "${SCRIPTS}"/pylibs.txt
+python3 -m pip -qq freeze
# install eteutils
mkdir -p "${ROBOT_VENV}"/src/onap
rm -rf "${ROBOT_VENV}"/src/onap/testsuite
-python3 -m pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==0.5.1.*' --pre
+python3 -m pip install -qq --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==0.5.1.*' --pre
-python3 -m pip freeze
+echo "Uninstall docker-py and reinstall docker."
+python3 -m pip uninstall -y -qq docker-py
+python3 -m pip uninstall -y -qq docker
+python3 -m pip install -U -qq docker
+
+python3 -m pip -qq freeze
+
+sudo apt-get -y -qq install libxml2-utils
--- /dev/null
+#!/bin/bash
+#
+# ============LICENSE_START====================================================
+# Copyright (C) 2023 Nordix Foundation.
+# =============================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END======================================================
+
+
+ROBOT_FILE=$1
+echo "Invoking the robot tests from: $1"
+
+export DEFAULT_PORT=6969
+export DATA=/opt/robotworkspace/models/models-examples/src/main/resources/policies
+export NODETEMPLATES=/opt/robotworkspace/models/models-examples/src/main/resources/nodetemplates
+export POLICY_RUNTIME_ACM_IP=policy-clamp-runtime-acm:${DEFAULT_PORT}
+export POLICY_API_IP=policy-api:${DEFAULT_PORT}
+export POLICY_PAP_IP=policy-pap:${DEFAULT_PORT}
+export APEX_IP=policy-apex-pdp:${DEFAULT_PORT}
+export DMAAP_IP=message-router:3904
+export SIMULATOR_IP=message-router
+export PROMETHEUS_IP=prometheus:9090
+
+export ROBOT_VARIABLES=
+ROBOT_VARIABLES="-v DATA:$DATA -v NODETEMPLATES:$NODETEMPLATES -v POLICY_RUNTIME_ACM_IP:$POLICY_RUNTIME_ACM_IP -v POLICY_API_IP:$POLICY_API_IP
+-v POLICY_PAP_IP:$POLICY_PAP_IP -v APEX_IP:$APEX_IP -v DMAAP_IP:$DMAAP_IP -v SIMULATOR_IP:$SIMULATOR_IP -v PROMETHEUS_IP:${PROMETHEUS_IP}"
+
+echo "Run Robot test"
+echo ROBOT_VARIABLES="${ROBOT_VARIABLES}"
+echo "Starting Robot test suites ..."
+python3 -m robot.run -d /tmp/ $ROBOT_VARIABLES $1
+RESULT=$?
+echo "RESULT: ${RESULT}"
# ============LICENSE_START=======================================================
# Copyright (C) 2018 Ericsson. All rights reserved.
#
-# Modifications copyright (c) 2019-2022 Nordix Foundation.
+# Modifications Copyright (c) 2019-2023 Nordix Foundation.
# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property.
+# Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
+source "${SCRIPTS}"/setup-pap.sh
+
+# wait for the app to start up
+"${SCRIPTS}"/wait_for_rest.sh localhost "${APEX_PORT}"
+
+export DMAAP_IP="localhost:${DMAAP_PORT}"
+export SUITES="apex-pdp-test.robot"
+
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_IP:localhost:${APEX_PORT} -v DMAAP_IP:${DMAAP_IP}
+-v APEX_EVENTS_IP:localhost:${APEX_EVENTS_PORT}"
#!/bin/bash
# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation.
+# Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright 2021-2023 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
+source "${SCRIPTS}"/node-templates.sh
+
+source "${WORKSPACE}"/compose/start-compose.sh api --grafana
+
+sleep 10
+unset http_proxy https_proxy
+
+# wait for the app to start up
+bash "${SCRIPTS}"/wait_for_rest.sh localhost ${API_PORT}
+
+export SUITES="api-test.robot"
+
+ROBOT_VARIABLES="-v POLICY_API_IP:localhost:${API_PORT} -v PROMETHEUS_IP:localhost:${PROMETHEUS_PORT}
+-v DATA:${DATA} -v NODETEMPLATES:${NODETEMPLATES}"
#!/bin/bash
# ============LICENSE_START=======================================================
-# Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
-# Modifications copyright (c) 2022 Nordix Foundation.
+# Copyright (C) 2021-2023 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
+source "${WORKSPACE}"/compose/start-compose.sh policy-clamp-runtime-acm
+
+sleep 10
+unset http_proxy https_proxy
+
+# wait for the app to start up
+"${SCRIPTS}"/wait_for_rest.sh localhost "${ACM_PORT}"
+
+export SUITES="policy-clamp-test.robot"
+
+ROBOT_VARIABLES="-v POLICY_RUNTIME_ACM_IP:localhost:${ACM_PORT}
+-v POLICY_API_IP:localhost:${POLICY_API_PORT}"
#!/bin/bash
# ============LICENSE_START=======================================================
# Copyright (C) 2018 Ericsson. All rights reserved.
-#
-# Modifications copyright (c) 2019-2022 Nordix Foundation.
+# Modifications Copyright (c) 2019-2023 Nordix Foundation.
# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
+# Remaking the csar file in case if the file got corrupted
+DIST_TEMP_FOLDER=/tmp/distribution
+
+zip -F "${TEST_PLAN_DIR}"/data/csar/sample_csar_with_apex_policy.csar \
+ --out "${TEST_PLAN_DIR}"/data/csar/csar_temp.csar
+
+# Remake temp directory
+rm -rf "${DIST_TEMP_FOLDER}"
+mkdir "${DIST_TEMP_FOLDER}"
+
+source "${WORKSPACE}"/compose/start-compose.sh distribution
+
+sleep 10
+unset http_proxy https_proxy
+
+# wait for the app to start up
+"${SCRIPTS}"/wait_for_rest.sh localhost "${DIST_PORT}"
+
+export SUITES="distribution-test.robot"
+
+ROBOT_VARIABLES="-v APEX_EVENTS_IP:localhost:${APEX_EVENTS_PORT}
+-v DISTRIBUTION_IP:localhost:${DIST_PORT} -v TEMP_FOLDER:${DIST_TEMP_FOLDER}"
#!/bin/bash
#
# ===========LICENSE_START====================================================
-# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
-# Modifications copyright (c) 2022 Nordix Foundation.
+# Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright 2021-2023 Nordix Foundation.
# ============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ============LICENSE_END=====================================================
#
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
+source "${SCRIPTS}"/node-templates.sh
+
+source "${WORKSPACE}"/compose/start-compose.sh drools-apps
+
+sleep 10
+unset http_proxy https_proxy
+
+export DMAAP_IP="localhost:${DMAAP_PORT}"
+export SUITES="drools-applications-test.robot"
+
+# wait for the app to start up
+"${SCRIPTS}"/wait_for_rest.sh localhost ${DROOLS_APPS_PORT}
+
+# give enough time for the controllers to come up
+sleep 15
+
+ROBOT_VARIABLES="-v DATA:${DATA} -v DROOLS_IP:localhost:${DROOLS_APPS_PORT}
+-v DROOLS_IP_2:localhost:${DROOLS_APPS_TELEMETRY_PORT} -v POLICY_API_IP:localhost:${API_PORT}
+-v POLICY_PAP_IP:localhost:${PAP_PORT}"
#!/bin/bash
# ============LICENSE_START=======================================================
# Copyright 2017-2021 AT&T Intellectual Property. All rights reserved.
-# Modifications copyright (c) 2022 Nordix Foundation.
+# Modifications Copyright 2021-2023 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
+source "${WORKSPACE}"/compose/start-compose.sh drools
+
+sleep 10
+unset http_proxy https_proxy
+
+export SUITES="drools-pdp-test.robot"
+
+# wait for the app to start up - looking for telemetry service on port ${DROOLS_PORT} forwarded from 9696
+"${SCRIPTS}"/wait_for_rest.sh localhost ${DROOLS_TELEMETRY_PORT}
+
+# give enough time for the controllers to come up
+sleep 15
+
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_DROOLS_IP:localhost:${DROOLS_TELEMETRY_PORT}"
# ============LICENSE_START=======================================================
# Copyright (C) 2019-2022 Nordix Foundation.
# Modifications Copyright (C) 2019-2021 AT&T Intellectual Property.
+# Modifications Copyright (C) 2022-2023 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
+source "${SCRIPTS}"/node-templates.sh
+
+source "${WORKSPACE}"/compose/start-compose.sh apex-pdp --grafana
+
+sleep 10
+unset http_proxy https_proxy
+
+# wait for the app to start up
+bash "${SCRIPTS}"/wait_for_rest.sh localhost ${PAP_PORT}
+
+export SUITES="pap-test.robot
+pap-slas.robot"
+
+ROBOT_VARIABLES="-v POLICY_PAP_IP:localhost:${PAP_PORT} -v POLICY_API_IP:localhost:${API_PORT}
+-v PROMETHEUS_IP:localhost:${PROMETHEUS_PORT} -v DATA:${DATA} -v NODETEMPLATES:${NODETEMPLATES}"
#!/bin/bash
# ============LICENSE_START=======================================================
-# Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
-# Modifications copyright (c) 2022 Nordix Foundation.
+# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright 2021-2023 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
+source "${SCRIPTS}"/node-templates.sh
+
+source "${WORKSPACE}"/compose/start-compose.sh xacml-pdp
+
+sleep 10
+unset http_proxy https_proxy
+
+export DMAAP_IP="localhost:${DMAAP_PORT}"
+export SUITES="xacml-pdp-test.robot"
+
+# wait for the app to start up
+"${SCRIPTS}"/wait_for_rest.sh localhost "${XACML_PORT}"
+
+ROBOT_VARIABLES="-v DATA:${DATA} -v POLICY_PDPX_IP:localhost:${XACML_PORT}
+-v POLICY_API_IP:localhost:${API_PORT} -v POLICY_PAP_IP:localhost:${PAP_PORT}"
then
break
else
- tmout=$((tmout-1))
- sleep 1
+ tmout=$((tmout-5))
+ sleep 5
fi
done
if [ $rc -ne 0 ]
Library OperatingSystem
Library json
Library Process
-Resource ${CURDIR}/../../common-library.robot
+Resource ${CURDIR}/common-library.robot
*** Test Cases ***
Healthcheck
[Documentation] Runs Apex PDP Health check
${hcauth}= HealthCheckAuth
- ${resp}= PerformGetRequest ${APEX_PORT} /policy/apex-pdp/v1/healthcheck 200 null ${hcauth}
+ ${resp}= PerformGetRequest ${APEX_IP} /policy/apex-pdp/v1/healthcheck 200 null ${hcauth}
Should Be Equal As Strings ${resp.json()['code']} 200
Set Suite Variable ${pdpName} ${resp.json()['name']}
ExecuteApexSampleDomainPolicy
Set Test Variable ${policyName} onap.policies.native.apex.Sampledomain
- ${postjson}= Get file ${CURDIR}/data/${policyName}.json
+ Log ${policyName}
+ ${postjson}= Get File ${CURDIR}/data/${policyName}.json
CreatePolicy /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies 200 ${postjson} ${policyName} 1.0.0
Wait Until Keyword Succeeds 3 min 5 sec VerifyPdpStatistics 0 0 0 0
DeployPolicy
ExecuteApexTestPnfPolicy
Set Test Variable ${policyName} onap.policies.apex.pnf.Test
- ${postjson}= Get file ${CURDIR}/data/${policyName}.json
+ ${postjson}= Get File ${CURDIR}/data/${policyName}.json
CreatePolicy /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies 200 ${postjson} ${policyName} 1.0.0
DeployPolicy
Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex
- ${result}= Run Process ${SCRIPTS}/make_topic.sh APEX-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/make_topic.sh APEX-CL-MGT
Should Be Equal As Integers ${result.rc} 0
Wait Until Keyword Succeeds 2 min 5 sec TriggerAndVerifyTestPnfPolicy
ExecuteApexTestVnfPolicy
Set Test Variable ${policyName} onap.policies.apex.vnf.Test
- ${postjson}= Get file ${CURDIR}/data/${policyName}.json
+ ${postjson}= Get File ${CURDIR}/data/${policyName}.json
CreatePolicy /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies 200 ${postjson} ${policyName} 1.0.0
DeployPolicy
Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex
- ${result}= Run Process ${SCRIPTS}/make_topic.sh APEX-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/make_topic.sh APEX-CL-MGT
Should Be Equal As Integers ${result.rc} 0
Wait Until Keyword Succeeds 2 min 5 sec TriggerAndVerifyTestVnfPolicy
ExecuteApexTestPnfPolicyWithMetadataSet
Set Test Variable ${policyName} onap.policies.apex.pnf.metadataSet.Test
- ${postjson}= Get file ${CURDIR}/data/${policyName}.json
+ ${postjson}= Get File ${CURDIR}/data/${policyName}.json
CreatePolicy /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies 200 ${postjson} ${policyName} 1.0.0
- ${postjson}= Get file ${CURDIR}/data/onap.pnf.metadataSet.Test.json
+ ${postjson}= Get File ${CURDIR}/data/onap.pnf.metadataSet.Test.json
CreateNodeTemplate /policy/api/v1/nodetemplates 200 ${postjson} 1
DeployPolicy
Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex
- ${result}= Run Process ${SCRIPTS}/make_topic.sh APEX-CL-MGT2
+ ${result}= Run Process ${CURDIR}/data/make_topic.sh APEX-CL-MGT2
Should Be Equal As Integers ${result.rc} 0
Wait Until Keyword Succeeds 2 min 5 sec TriggerAndVerifyTestPnfPolicy
Metrics
[Documentation] Verify policy-apex-pdp is exporting prometheus metrics
${auth}= HealthCheckAuth
- ${resp}= PerformGetRequest ${APEX_PORT} /metrics 200 null ${auth}
+ ${resp}= PerformGetRequest ${APEX_IP} /metrics 200 null ${auth}
Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="TOTAL",} 4.0
Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="SUCCESS",} 4.0
Should Contain ${resp.text} pdpa_policy_executions_total{status="SUCCESS",} 3.0
DeployPolicy
[Documentation] Deploy the policy in apex-pdp engine
- ${postjson}= Get file ${CURDIR}/data/policy_deploy.json
+ ${postjson}= Get File ${CURDIR}/data/policy_deploy.json
${postjson}= evaluate json.loads('''${postjson}''') json
set to dictionary ${postjson['groups'][0]['deploymentSubgroups'][0]['policies'][0]} name=${policyName}
${postjson}= evaluate json.dumps(${postjson}) json
${policyadmin}= PolicyAdminAuth
- PerformPostRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/deployments/batch 202 ${postjson} null ${policyadmin}
+ PerformPostRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/deployments/batch 202 ${postjson} null ${policyadmin}
RunEventOnApexEngine
[Documentation] Send event to verify policy execution
- Create Session apexSession http://localhost:23324 max_retries=1
- ${data}= Get Binary File ${CURDIR}${/}data${/}event.json
+ Create Session apexSession http://${APEX_EVENTS_IP} max_retries=1
+ ${data}= Get Binary File ${CURDIR}/data/event.json
&{headers}= Create Dictionary Content-Type=application/json Accept=application/json
${resp}= PUT On Session apexSession /apex/FirstConsumer/EventIn data=${data} headers=${headers}
Should Be Equal As Strings ${resp.status_code} 200
TriggerAndVerifyTestPnfPolicy
[Documentation] Send TestPnf policy trigger event to DMaaP and read notifications to verify policy execution
- Create Session apexSession http://localhost:30227 max_retries=1
+ Create Session apexSession http://${DMAAP_IP} max_retries=1
${data}= Get Binary File ${CURDIR}/data/VesEventForPnfPolicy.json
&{headers}= Create Dictionary Content-Type=application/json Accept=application/json
${resp}= POST On Session apexSession /events/unauthenticated.DCAE_CL_OUTPUT data=${data} headers=${headers}
TriggerAndVerifyTestVnfPolicy
[Documentation] Send TestVnf policy trigger event to DMaaP and read notifications to verify policy execution
- Create Session apexSession http://localhost:30227 max_retries=1
+ Create Session apexSession http://${DMAAP_IP} max_retries=1
${data}= Get Binary File ${CURDIR}/data/VesEventForVnfPolicy.json
&{headers}= Create Dictionary Content-Type=application/json Accept=application/json
${resp}= POST On Session apexSession /events/unauthenticated.DCAE_POLICY_EXAMPLE_OUTPUT data=${data} headers=${headers}
CheckLogMessage
[Documentation] Read log messages received and check for expected content.
[Arguments] ${status} ${expectedMsg}
- ${result}= Run Process ${SCRIPTS}/wait_topic.sh APEX-CL-MGT ${status}
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh APEX-CL-MGT ${status}
Log Received log event on APEX-CL-MGT topic ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} ${expectedMsg}
[Documentation] Verify pdp statistics after policy execution
[Arguments] ${deployCount} ${deploySuccessCount} ${executedCount} ${executedSuccessCount}
${policyadmin}= PolicyAdminAuth
- ${resp}= PerformGetRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/statistics/defaultGroup/apex/${pdpName} 200 null ${policyadmin}
+ ${resp}= PerformGetRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/statistics/defaultGroup/apex/${pdpName} 200 null ${policyadmin}
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal As Strings ${resp.json()['defaultGroup']['apex'][0]['pdpInstanceId']} ${pdpName}
Should Be Equal As Strings ${resp.json()['defaultGroup']['apex'][0]['pdpGroupName']} defaultGroup
Library RequestsLibrary
Library OperatingSystem
Library json
-Resource ${CURDIR}/../../common-library.robot
+Resource ${CURDIR}/common-library.robot
*** Test Cases ***
Metrics
[Documentation] Verify policy-api is exporting prometheus metrics
${auth}= PolicyAdminAuth
- ${resp}= GetMetrics ${POLICY_API_PORT} ${auth} /policy/api/v1/
- Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/healthcheck",} 1.0
+ ${resp}= GetMetrics ${POLICY_API_IP} ${auth} /policy/api/v1/
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/healthcheck",}
Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/statistics",} 1.0
Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policytypes",} 1.0
Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policies",} 1.0
GetReq
[Arguments] ${url}
${auth}= PolicyAdminAuth
- ${resp}= PerformGetRequest ${POLICY_API_PORT} ${url} 200 null ${auth}
+ ${resp}= PerformGetRequest ${POLICY_API_IP} ${url} 200 null ${auth}
[return] ${resp}
DeleteReq
[Arguments] ${url} ${expectedstatus}
${auth}= PolicyAdminAuth
- ${resp}= PerformDeleteRequest ${POLICY_API_PORT} ${url} ${expectedstatus} ${auth}
+ ${resp}= PerformDeleteRequest ${POLICY_API_IP} ${url} ${expectedstatus} ${auth}
[return] ${resp}
CreatePolicyType
[Documentation] Create the specific policy type
${postjson}= Get file ${CURDIR}/data/${jsonfile}
${auth}= PolicyAdminAuth
- ${resp}= PerformPostRequest ${POLICY_API_PORT} ${url} ${expectedstatus} ${postjson} null ${auth}
+ ${resp}= PerformPostRequest ${POLICY_API_IP} ${url} ${expectedstatus} ${postjson} null ${auth}
Run Keyword If ${expectedstatus}==200 List Should Contain Value ${resp.json()['policy_types']} ${policytypename}
Run Keyword If ${expectedstatus}==200 Should Be Equal As Strings ${resp.json()['policy_types']['${policytypename}']['version']} ${policytypeversion}
[return] ${healthcheck}
PerformPostRequest
- [Arguments] ${port} ${url} ${expectedstatus} ${postjson} ${params} ${auth}
- Log Creating session http://localhost:${port}
- ${session}= Create Session policy http://localhost:${port} auth=${auth}
+ [Arguments] ${domain} ${url} ${expectedstatus} ${postjson} ${params} ${auth}
+ Log Creating session http://${domain}
+ ${session}= Create Session policy http://${domain} auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${resp}= POST On Session policy ${url} data=${postjson} params=${params} headers=${headers} expected_status=${expectedstatus}
Log Received response from policy ${resp.text}
[return] ${resp}
PerformPutRequest
- [Arguments] ${port} ${url} ${expectedstatus} ${params} ${auth}
- Log Creating session http://localhost:${port}
- ${session}= Create Session policy http://localhost:${port} auth=${auth}
+ [Arguments] ${domain} ${url} ${expectedstatus} ${params} ${auth}
+ Log Creating session http://${domain}
+ ${session}= Create Session policy http://${domain} auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${resp}= PUT On Session policy ${url} params=${params} headers=${headers} expected_status=${expectedstatus}
Log Received response from policy ${resp.text}
[return] ${resp}
PerformGetRequest
- [Arguments] ${port} ${url} ${expectedstatus} ${params} ${auth}
- Log Creating session http://localhost:${port}
- ${session}= Create Session policy http://localhost:${port} auth=${auth}
+ [Arguments] ${domain} ${url} ${expectedstatus} ${params} ${auth}
+ Log Creating session http://${domain}
+ ${session}= Create Session policy http://${domain} auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${resp}= GET On Session policy ${url} params=${params} headers=${headers} expected_status=${expectedstatus}
Log Received response from policy ${resp.text}
[return] ${resp}
PerformDeleteRequest
- [Arguments] ${port} ${url} ${expectedstatus} ${auth}
- Log Creating session http://localhost:${port}
- ${session}= Create Session policy http://localhost:${port} auth=${auth}
+ [Arguments] ${domain} ${url} ${expectedstatus} ${auth}
+ Log Creating session http://${domain}
+ ${session}= Create Session policy http://${domain} auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${resp}= DELETE On Session policy ${url} headers=${headers} expected_status=${expectedstatus}
Log Received response from policy ${resp.text}
[Arguments] ${url} ${expectedstatus} ${postjson} ${policyname} ${policyversion}
[Documentation] Create the specific policy
${policyadmin}= PolicyAdminAuth
- ${resp}= PerformPostRequest ${POLICY_API_PORT} ${url} ${expectedstatus} ${postjson} null ${policyadmin}
+ ${resp}= PerformPostRequest ${POLICY_API_IP} ${url} ${expectedstatus} ${postjson} null ${policyadmin}
Run Keyword If ${expectedstatus}==200 Dictionary Should Contain Key ${resp.json()['topology_template']['policies'][0]} ${policyname}
Run Keyword If ${expectedstatus}==200 Should Be Equal As Strings ${resp.json()['topology_template']['policies'][0]['${policyname}']['version']} ${policyversion}
[Arguments] ${url} ${expectedstatus} ${postjson} ${nodeTemplateListLength}
[Documentation] Create the node templates
${policyadmin}= PolicyAdminAuth
- ${resp}= PerformPostRequest ${POLICY_API_PORT} ${url} ${expectedstatus} ${postjson} \ ${policyadmin}
+ ${resp}= PerformPostRequest ${POLICY_API_IP} ${url} ${expectedstatus} ${postjson} \ ${policyadmin}
Run Keyword If ${expectedstatus}==200 Length Should Be ${resp.json()['topology_template']['node_templates']} ${nodeTemplateListLength}
QueryPdpGroups
- [Documentation] Verify pdp group query - supports upto 2 groups
+ [Documentation] Verify pdp group query - suphosts upto 2 groups
[Arguments] ${groupsLength} ${group1Name} ${group1State} ${policiesLengthInGroup1} ${group2Name} ${group2State} ${policiesLengthInGroup2}
${policyadmin}= PolicyAdminAuth
- ${resp}= PerformGetRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps 200 null ${policyadmin}
+ ${resp}= PerformGetRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps 200 null ${policyadmin}
Length Should Be ${resp.json()['groups']} ${groupsLength}
Should Be Equal As Strings ${resp.json()['groups'][0]['name']} ${group1Name}
Should Be Equal As Strings ${resp.json()['groups'][0]['pdpGroupState']} ${group1State}
QueryPolicyAudit
[Arguments] ${url} ${expectedstatus} ${pdpGroup} ${pdpType} ${policyName} ${expectedAction}
${policyadmin}= PolicyAdminAuth
- ${resp}= PerformGetRequest ${POLICY_PAP_PORT} ${url} ${expectedstatus} recordCount=2 ${policyadmin}
+ ${resp}= PerformGetRequest ${POLICY_PAP_IP} ${url} ${expectedstatus} recordCount=2 ${policyadmin}
Log Received response from queryPolicyAudit ${resp.text}
FOR ${responseEntry} IN @{resp.json()}
Exit For Loop IF '${responseEntry['policy']['name']}'=='${policyName}'
[Documentation] Verify policy deployment status
[Arguments] ${policyName} ${pdpGroup} ${pdpType} ${pdpName} ${policyTypeName}
${policyadmin}= PolicyAdminAuth
- ${resp}= PerformGetRequest ${POLICY_PAP_PORT} /policy/pap/v1/policies/status 200 null ${policyadmin}
+ ${resp}= PerformGetRequest ${POLICY_PAP_IP} /policy/pap/v1/policies/status 200 null ${policyadmin}
FOR ${responseEntry} IN @{resp.json()}
Exit For Loop IF '${responseEntry['policy']['name']}'=='${policyName}'
END
Should Be Equal As Strings ${responseEntry['state']} SUCCESS
GetMetrics
- [Arguments] ${port} ${auth} ${context_path}
- Log Creating session http://localhost:${port}
- ${session}= Create Session policy http://localhost:${port} auth=${auth}
+ [Arguments] ${domain} ${auth} ${context_path}
+ Log Creating session http://${domain}
+ ${session}= Create Session policy http://${domain} auth=${auth}
${resp}= GET On Session policy ${context_path}metrics expected_status=200
Log Received response from policy ${resp.text}
[return] ${resp}
QueryPrometheus
[Arguments] ${query}
${params}= Create Dictionary query=${query}
- ${resp}= GET http://localhost:30259/api/v1/query ${params}
+ ${resp}= GET http://${PROMETHEUS_IP}/api/v1/query ${params}
Status Should Be OK
Log Received response from Prometheus ${resp.text}
[return] ${resp.json()}
topic="${1}"
-curl -s -k "http://localhost:30227/events/${topic}/script/1?limit=1&timeout=0"
+curl -s -k "http://${DMAAP_IP}/events/${topic}/script/1?limit=1&timeout=0"
echo
fi
curl -k -H "Content-type: application/json" --data-binary @$1 \
- http://localhost:30227/events/unauthenticated.DCAE_CL_OUTPUT
+ http://${DMAAP_IP}/events/unauthenticated.DCAE_CL_OUTPUT
echo
while [ ${matched} = "no" ]
do
- msg=`curl -s -k "http://localhost:30227/events/${topic}/script/1?limit=1"`
+ msg=`curl -s -k "http://${DMAAP_IP}/events/${topic}/script/1?limit=1"`
if [ $? -ne 0 -o "${msg}" = "[]" ]
then
echo not found >&2
Library RequestsLibrary
Library OperatingSystem
Library json
-Resource ${CURDIR}/../../common-library.robot
+Resource ${CURDIR}/common-library.robot
*** Test Cases ***
Healthcheck
[Documentation] Verify policy distribution health check
${hcauth}= HealthCheckAuth
- ${resp}= PerformGetRequest ${POLICY_DISTRIBUTION_PORT} /healthcheck 200 null ${hcauth}
+ ${resp}= PerformGetRequest ${DISTRIBUTION_IP} /healthcheck 200 null ${hcauth}
Should Be Equal As Strings ${resp.json()['code']} 200
Statistics
[Documentation] Verify policy distribution statistics
${hcauth}= HealthCheckAuth
- ${resp}= PerformGetRequest ${POLICY_DISTRIBUTION_PORT} /statistics 200 null ${hcauth}
+ ${resp}= PerformGetRequest ${DISTRIBUTION_IP} /statistics 200 null ${hcauth}
Should Be Equal As Strings ${resp.json()['code']} 200
Metrics
[Documentation] Verify policy-distribution is exporting prometheus metrics
${hcauth}= HealthCheckAuth
- ${resp}= PerformGetRequest ${POLICY_DISTRIBUTION_PORT} /metrics 200 null ${hcauth}
+ ${resp}= PerformGetRequest ${DISTRIBUTION_IP} /metrics 200 null ${hcauth}
Should Contain ${resp.text} total_distribution_received_count_total 0.0
Should Contain ${resp.text} distribution_success_count_total 0.0
Should Contain ${resp.text} distribution_failure_count_total 0.0
MetricsAfterExecution
[Documentation] Verify policy-distribution is exporting prometheus metrics after execution
${hcauth}= HealthCheckAuth
- ${resp}= PerformGetRequest ${POLICY_DISTRIBUTION_PORT} /metrics 200 null ${hcauth}
+ ${resp}= PerformGetRequest ${DISTRIBUTION_IP} /metrics 200 null ${hcauth}
Should Contain ${resp.text} total_distribution_received_count_total 1.0
Should Contain ${resp.text} distribution_success_count_total 1.0
Should Contain ${resp.text} distribution_failure_count_total 0.0
*** Keywords ***
InvokeDistributionUsingFile And RunEventOnApexEngine
- Copy File ${SCRIPT_DIR}/csar/csar_temp.csar ${SCRIPT_DIR}/csar/temp.csar
- Move File ${SCRIPT_DIR}/csar/temp.csar ${SCRIPT_DIR}/temp/sample_csar_with_apex_policy.csar
+ Copy File ${CURDIR}/data/csar/csar_temp.csar ${CURDIR}/data/csar/temp.csar
+ Move File ${CURDIR}/data/csar/temp.csar ${TEMP_FOLDER}/sample_csar_with_apex_policy.csar
Sleep 20 seconds "Waiting for the Policy Distribution to call Policy API and PAP"
- Create Session apexSession http://localhost:23324 max_retries=1
- ${data}= Get Binary File ${CURDIR}${/}data${/}event.json
+ Create Session apexSession http://${APEX_EVENTS_IP} max_retries=1
+ ${data}= Get Binary File ${CURDIR}/data/event.json
&{headers}= Create Dictionary Content-Type=application/json Accept=application/json
${resp}= PUT On Session apexSession /apex/FirstConsumer/EventIn data=${data} headers=${headers} expected_status=200
- Remove Files ${SCRIPT_DIR}/temp/sample_csar_with_apex_policy.csar
+ Remove Files ${CURDIR}/data/temp/sample_csar_with_apex_policy.csar
+ Remove Files ${CURDIR}/data/csar/csar_temp.csar
*** Test Cases ***
Alive
[Documentation] Runs Policy PDP Alive Check
- ${resp}= PeformGetRequest /policy/pdp/engine 30219 200
+ ${resp}= PeformGetRequest /policy/pdp/engine ${DROOLS_IP_2} 200
Should Be Equal As Strings ${resp.json()['alive']} True
Metrics
[Documentation] Verify drools-apps is exporting metrics
- ${resp}= PeformGetRequest /metrics 30219 200
+ ${resp}= PeformGetRequest /metrics ${DROOLS_IP_2} 200
Should Contain ${resp.text} jvm_threads_current
Healthcheck
[Documentation] Runs Policy PDP-D Health check
- ${resp}= PeformGetRequest /healthcheck ${DROOLS_PORT} 200
+ ${resp}= PeformGetRequest /healthcheck ${DROOLS_IP} 200
Should Be Equal As Strings ${resp.json()['healthy']} True
Controller
MakeTopics
[Documentation] Creates the Policy topics
- ${result}= Run Process ${SCR2}/make_topic.sh POLICY-PDP-PAP
+ ${result}= Run Process ${CURDIR}/data/make_topic.sh POLICY-PDP-PAP
Should Be Equal As Integers ${result.rc} 0
- ${result}= Run Process ${SCR2}/make_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/make_topic.sh POLICY-CL-MGT
Should Be Equal As Integers ${result.rc} 0
CreateVcpeXacmlPolicy
[Documentation] Create VCPE Policy for Xacml
- PerformPostRequest /policy/api/v1/policies null ${API_PORT} vCPE.policy.monitoring.input.tosca.yaml ${DATA} yaml 200
+ PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vCPE.policy.monitoring.input.tosca.yaml ${DATA} yaml 200
CreateVcpeDroolsPolicy
[Documentation] Create VCPE Policy for Drools
- PerformPostRequest /policy/api/v1/policies null ${API_PORT} vCPE.policy.operational.input.tosca.yaml ${DATA} yaml 200
+ PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vCPE.policy.operational.input.tosca.yaml ${DATA} yaml 200
CreateVdnsXacmlPolicy
[Documentation] Create VDNS Policy for Xacml
- PerformPostRequest /policy/api/v1/policies null ${API_PORT} vDNS.policy.monitoring.input.tosca.yaml ${DATA} yaml 200
+ PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vDNS.policy.monitoring.input.tosca.yaml ${DATA} yaml 200
CreateVdnsDroolsPolicy
[Documentation] Create VDNS Policy for Drools
- PerformPostRequest /policy/api/v1/policies null ${API_PORT} vDNS.policy.operational.input.tosca.json ${DATA} json 200
+ PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vDNS.policy.operational.input.tosca.json ${DATA} json 200
CreateVfwXacmlPolicy
[Documentation] Create VFW Policy for Xacml
- PerformPostRequest /policy/api/v1/policies null ${API_PORT} vFirewall.policy.monitoring.input.tosca.yaml ${DATA} yaml 200
+ PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vFirewall.policy.monitoring.input.tosca.yaml ${DATA} yaml 200
CreateVfwDroolsPolicy
[Documentation] Create VFW Policy for Drools
- PerformPostRequest /policy/api/v1/policies null ${API_PORT} vFirewall.policy.operational.input.tosca.json ${DATA} json 200
+ PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vFirewall.policy.operational.input.tosca.json ${DATA} json 200
DeployXacmlPolicies
[Documentation] Deploys the Policies to Xacml
- PerformPostRequest /policy/pap/v1/pdps/deployments/batch null ${PAP_PORT} deploy.xacml.policies.json ${DATA2} json 202
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-PDP-PAP
+ PerformPostRequest /policy/pap/v1/pdps/deployments/batch null ${POLICY_PAP_IP} deploy.xacml.policies.json ${CURDIR}/data json 202
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-PDP-PAP
... responseTo xacml ACTIVE restart
Log Received status ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
DeployDroolsPolicies
[Documentation] Deploys the Policies to Drools
- PerformPostRequest /policy/pap/v1/pdps/deployments/batch null ${PAP_PORT} deploy.drools.policies.json ${DATA2} json 202
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-PDP-PAP
+ PerformPostRequest /policy/pap/v1/pdps/deployments/batch null ${POLICY_PAP_IP} deploy.drools.policies.json ${CURDIR}/data json 202
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-PDP-PAP
... responseTo drools ACTIVE
Log Received status ${result.stdout}
Sleep 3s
VcpeExecute
[Documentation] Executes VCPE Policy
- ${result}= Run Process ${SCR2}/onset.sh ${DATA2}/vcpeOnset.json
+ ${result}= Run Process ${CURDIR}/data/onset.sh ${CURDIR}/data/vcpeOnset.json
Should Be Equal As Integers ${result.rc} 0
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} ACTIVE
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION
Should Contain ${result.stdout} Sending guard query for APPC Restart
Should Be Equal As Integers ${result.rc} 0
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION
Should Contain ${result.stdout} Guard result for APPC Restart is Permit
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION
Should Contain ${result.stdout} actor=APPC,operation=Restart
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION: SUCCESS
Should Contain ${result.stdout} actor=APPC,operation=Restart
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
VdnsExecute
[Documentation] Executes VDNS Policy
- ${result}= Run Process ${SCR2}/onset.sh ${DATA2}/vdnsOnset.json
+ ${result}= Run Process ${CURDIR}/data/onset.sh ${CURDIR}/data/vdnsOnset.json
Should Be Equal As Integers ${result.rc} 0
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} ACTIVE
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION
Should Contain ${result.stdout} Sending guard query for SO VF Module Create
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION
Should Contain ${result.stdout} Guard result for SO VF Module Create is Permit
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION
Should Contain ${result.stdout} actor=SO,operation=VF Module Create
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION: SUCCESS
Should Contain ${result.stdout} actor=SO,operation=VF Module Create
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
VfwExecute
[Documentation] Executes VFW Policy
- ${result}= Run Process ${SCR2}/onset.sh ${DATA2}/vfwOnset.json
+ ${result}= Run Process ${CURDIR}/data/onset.sh ${CURDIR}/data/vfwOnset.json
Should Be Equal As Integers ${result.rc} 0
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} ACTIVE
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION
Should Contain ${result.stdout} Sending guard query for APPC ModifyConfig
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION
Should Contain ${result.stdout} Guard result for APPC ModifyConfig is Permit
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION
Should Contain ${result.stdout} actor=APPC,operation=ModifyConfig
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} OPERATION: SUCCESS
Should Contain ${result.stdout} actor=APPC,operation=ModifyConfig
- ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-CL-MGT
... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
Log Received notification ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
*** Keywords ***
VerifyController
- ${resp}= PeformGetRequest /policy/pdp/engine/controllers/usecases/drools/facts 30219 200
+ ${resp}= PeformGetRequest /policy/pdp/engine/controllers/usecases/drools/facts ${DROOLS_IP_2} 200
Should Be Equal As Strings ${resp.json()['usecases']} 1
PeformGetRequest
- [Arguments] ${url} ${port} ${expectedstatus}
+ [Arguments] ${url} ${domain} ${expectedstatus}
${auth}= Create List demo@people.osaaf.org demo123456!
- Log Creating session http://localhost:${port}
- ${session}= Create Session policy http://localhost:${port} auth=${auth}
+ Log Creating session http://${domain}
+ ${session}= Create Session policy http://${domain} auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${resp}= GET On Session policy ${url} headers=${headers} expected_status=${expectedstatus}
Log Received response from policy ${resp.text}
[return] ${resp}
PerformPostRequest
- [Arguments] ${url} ${params} ${port} ${jsonfile} ${filepath} ${contenttype} ${expectedstatus}
+ [Arguments] ${url} ${params} ${domain} ${jsonfile} ${filepath} ${contenttype} ${expectedstatus}
${auth}= Create List policyadmin zb!XztG34
${postjson}= Get file ${filepath}/${jsonfile}
- Log Creating session http://localhost:${port}
- ${session}= Create Session policy http://localhost:${port} auth=${auth}
+ Log Creating session http://${domain}
+ ${session}= Create Session policy http://${domain} auth=${auth}
${headers}= Create Dictionary Accept=application/${contenttype} Content-Type=application/${contenttype}
${resp}= POST On Session policy ${url} params=${params} data=${postjson} headers=${headers} expected_status=${expectedstatus}
Log Received response from policy ${resp.text}
Alive
[Documentation] Runs Policy PDP Alive Check
${auth}= Create List demo@people.osaaf.org demo123456!
- Log Creating session http://localhost:30216
- ${session}= Create Session policy http://localhost:30216 auth=${auth}
+ Log Creating session http://${POLICY_DROOLS_IP}
+ ${session}= Create Session policy http://${POLICY_DROOLS_IP} auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${resp}= GET On Session policy /policy/pdp/engine headers=${headers} expected_status=200
Log Received response from policy ${resp.text}
Metrics
[Documentation] Verify drools-pdp is exporting metrics
${auth}= Create List demo@people.osaaf.org demo123456!
- Log Creating session http://localhost:30216
- ${session}= Create Session policy http://localhost:30216 auth=${auth}
+ Log Creating session http://${POLICY_DROOLS_IP}
+ ${session}= Create Session policy http://${POLICY_DROOLS_IP} auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${resp}= GET On Session policy /metrics headers=${headers} expected_status=200
Log Received response from policy ${resp.text}
Library RequestsLibrary
Library OperatingSystem
Library json
-Resource ${CURDIR}/../../common-library.robot
+Resource ${CURDIR}/common-library.robot
*** Keywords ***
ValidateResponseTimeForPap
*** Test Cases ***
WaitForPrometheusServer
- [Documentation] Sleep time to wait for Prometheus server to gather all metrics
+ [Documentation] Wait for Prometheus server to gather all metrics
Sleep 1 minute
ValidateResponseTimeForHealthcheck
Library RequestsLibrary
Library OperatingSystem
Library json
-Resource ${CURDIR}/../../common-library.robot
+Resource ${CURDIR}/common-library.robot
*** Keywords ***
GetReq
[Arguments] ${url}
${auth}= PolicyAdminAuth
- ${resp}= PerformGetRequest ${POLICY_PAP_PORT} ${url} 200 null ${auth}
+ ${resp}= PerformGetRequest ${POLICY_PAP_IP} ${url} 200 null ${auth}
[return] ${resp}
ValidateResponseTimeForPap
Metrics
[Documentation] Verify policy pap is exporting prometheus metrics
${auth}= PolicyAdminAuth
- ${resp}= GetMetrics ${POLICY_PAP_PORT} ${auth} /policy/pap/v1/
+ ${resp}= GetMetrics ${POLICY_PAP_IP} ${auth} /policy/pap/v1/
Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/healthcheck",} 1.0
Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/components/healthcheck",} 1.0
Should Contain ${resp.text} spring_data_repository_invocations_seconds_count{exception="None",method="save",repository="PdpGroupRepository",state="SUCCESS",} 1.0
[Documentation] Add a new PdpGroup named 'testGroup' in the policy database
${postjson}= Get file ${CURDIR}/data/create.group.request.json
${auth}= PolicyAdminAuth
- PerformPostRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/groups/batch 200 ${postjson} null ${auth}
+ PerformPostRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/groups/batch 200 ${postjson} null ${auth}
QueryPdpGroupsBeforeActivation
[Documentation] Verify PdpGroups before activation
ActivatePdpGroup
[Documentation] Change the state of PdpGroup named 'testGroup' to ACTIVE
${auth}= PolicyAdminAuth
- PerformPutRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/groups/testGroup 200 state=ACTIVE ${auth}
+ PerformPutRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/groups/testGroup 200 state=ACTIVE ${auth}
QueryPdpGroupsAfterActivation
[Documentation] Verify PdpGroups after activation
[Documentation] Deploy policies in PdpGroups
${postjson}= Get file ${CURDIR}/data/deploy.group.request.json
${auth}= PolicyAdminAuth
- PerformPostRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/deployments/batch 202 ${postjson} null ${auth}
+ PerformPostRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/deployments/batch 202 ${postjson} null ${auth}
QueryPdpGroupsAfterDeploy
[Documentation] Verify PdpGroups after undeploy
UndeployPolicy
[Documentation] Undeploy a policy named 'onap.restart.tca' from PdpGroups
${auth}= PolicyAdminAuth
- PerformDeleteRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/policies/onap.restart.tca 202 ${auth}
+ PerformDeleteRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/policies/onap.restart.tca 202 ${auth}
UndeployPolicyWithMetadataSet
[Documentation] Undeploy a policy named 'operational.apex.decisionMaker' from PdpGroups
${auth}= PolicyAdminAuth
- PerformDeleteRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/policies/operational.apex.decisionMaker 202 ${auth}
+ PerformDeleteRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/policies/operational.apex.decisionMaker 202 ${auth}
QueryPdpGroupsAfterUndeploy
[Documentation] Verify PdpGroups after undeploy
DeactivatePdpGroup
[Documentation] Change the state of PdpGroup named 'testGroup' to PASSIVE
${auth}= PolicyAdminAuth
- PerformPutRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/groups/testGroup 200 state=PASSIVE ${auth}
+ PerformPutRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/groups/testGroup 200 state=PASSIVE ${auth}
DeletePdpGroups
[Documentation] Delete the PdpGroup named 'testGroup' from policy database
${auth}= PolicyAdminAuth
- PerformDeleteRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/groups/testGroup 200 ${auth}
+ PerformDeleteRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/groups/testGroup 200 ${auth}
QueryPdpGroupsAfterDelete
[Documentation] Verify PdpGroups after delete
Healthcheck
[Documentation] Healthcheck on Clamp Acm
${auth}= Create List runtimeUser zb!XztG34
- Log Creating session http://localhost:${POLICY_RUNTIME_ACM_PORT}
- ${session}= Create Session ACM http://localhost:${POLICY_RUNTIME_ACM_PORT} auth=${auth}
+ Log Creating session http://${POLICY_RUNTIME_ACM_IP}
+ ${session}= Create Session ACM http://${POLICY_RUNTIME_ACM_IP} auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${resp}= GET On Session ACM /onap/policy/clamp/acm/health headers=${headers}
Log Received response from ACM healthcheck {resp.text}
#CommissionAutomationCompositionV1
# [Documentation] Commission automation composition.
# ${auth}= Create List runtimeUser zb!XztG34
-# Log Creating session http://localhost:${POLICY_RUNTIME_ACM_PORT}
+# Log Creating session http://${POLICY_RUNTIME_ACM_IP}
# ${postyaml}= Get file ${CURDIR}/data/functional-pmsh-usecase.yaml
-# ${session}= Create Session policy http://localhost:${POLICY_RUNTIME_ACM_PORT} auth=${auth}
+# ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth}
# ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml
# ${resp}= POST On Session policy /onap/policy/clamp/acm/v2/compositions data=${postyaml} headers=${headers}
# Log Received response from runtime acm ${resp.text}
#InstantiateAutomationCompositionV1
# [Documentation] Instantiate automation composition.
# ${auth}= Create List runtimeUser zb!XztG34
-# Log Creating session http://localhost:${POLICY_RUNTIME_ACM_PORT}
+# Log Creating session http://${POLICY_RUNTIME_ACM_IP}
# ${postjson}= Get file ${CURDIR}/data/AutomationComposition.json
# ${updatedpostjson}= Replace String ${postjson} COMPOSITIONIDPLACEHOLDER ${compositionId}
-# ${session}= Create Session policy http://localhost:${POLICY_RUNTIME_ACM_PORT} auth=${auth}
+# ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth}
# ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
# ${resp}= POST On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances data=${updatedpostjson} headers=${headers}
# Log Received response from runtime acm ${resp.text}
#PassivateAutomationComposition
# [Documentation] Passivate automation composition.
# ${auth}= Create List runtimeUser zb!XztG34
-# Log Creating session http://localhost:${POLICY_RUNTIME_ACM_PORT}
+# Log Creating session http://${POLICY_RUNTIME_ACM_IP}
# ${postjson}= Get file ${CURDIR}/data/PassiveCommand.json
-# ${session}= Create Session policy http://localhost:${POLICY_RUNTIME_ACM_PORT} auth=${auth}
+# ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth}
# ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
# ${resp}= PUT On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances/${instanceId} data=${postjson} headers=${headers}
# Log Received response from runtime acm ${resp.text}
#QueryPolicies
# [Documentation] Runs Policy Participant Query New Policies
# ${auth}= Create List policyadmin zb!XztG34
-# Log Creating session http://localhost:${POLICY_API_PORT}
-# ${session}= Create Session policy http://localhost:${POLICY_API_PORT} auth=${auth}
+# Log Creating session http://${POLICY_API_IP}
+# ${session}= Create Session policy http://${POLICY_API_IP} auth=${auth}
# ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
# ${resp}= GET On Session policy /policy/api/v1/policies headers=${headers}
# Log Received response from policy-api {resp.text}
#QueryPolicyTypes
# [Documentation] Runs Policy Participant Query New Policy Types
# ${auth}= Create List policyadmin zb!XztG34
-# Log Creating session http://localhost:${POLICY_API_PORT}}:6969
-# ${session}= Create Session policy http://localhost:${POLICY_API_PORT} auth=${auth}
+# Log Creating session http://${POLICY_API_IP}}:6969
+# ${session}= Create Session policy http://${POLICY_API_IP} auth=${auth}
# ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
# ${resp}= GET On Session policy /policy/api/v1/policytypes headers=${headers}
# Log Received response from policy-api ${resp.text}
#StateChangeRunningAutomationComposition
# [Documentation] AutomationComposition State Change to RUNNING.
# ${auth}= Create List runtimeUser zb!XztG34
-# Log Creating session http://localhost:${POLICY_RUNTIME_ACM_PORT}
+# Log Creating session http://${POLICY_RUNTIME_ACM_IP}
# ${postjson}= Get file ${CURDIR}/data/RunningCommand.json
-# ${session}= Create Session policy http://localhost:${POLICY_RUNTIME_ACM_PORT} auth=${auth}
+# ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth}
# ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
# ${resp}= PUT On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances/${instanceId} data=${postjson} headers=${headers} expected_status=400
# Log Received response from runtime acm ${resp.text}
#QueryInstantiatedACs
# [Documentation] Get Instantiated AutomationCompositions
# ${auth}= Create List runtimeUser zb!XztG34
-# Log Creating session http://localhost:${POLICY_RUNTIME_ACM_PORT}
-# ${session}= Create Session policy http://localhost:${POLICY_RUNTIME_ACM_PORT} auth=${auth}
+# Log Creating session http://${POLICY_RUNTIME_ACM_IP}
+# ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth}
# ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
# ${resp}= GET On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances/${instanceId} headers=${headers}
# Log Received response from runtime acm ${resp.text}
Library OperatingSystem
Library Process
Library json
-Resource ${CURDIR}/../../common-library.robot
+Resource ${CURDIR}/common-library.robot
*** Test Cases ***
Healthcheck
MakeTopics
[Documentation] Creates the Policy topics
- ${result}= Run Process ${SCR_DMAAP}/make_topic.sh POLICY-PDP-PAP
+ ${result}= Run Process ${CURDIR}/data/make_topic.sh POLICY-PDP-PAP
Should Be Equal As Integers ${result.rc} 0
ExecuteXacmlPolicy
CreateMonitorPolicy
[Documentation] Create a Monitoring policy
- ${postjson}= Get file ${DATA2}/vCPE.policy.monitoring.input.tosca.json
+ ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json
CreatePolicy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies 200 ${postjson} onap.restart.tca 1.0.0
CreateOptimizationPolicy
[Documentation] Create an Optimization policy
- ${postjson}= Get file ${DATA2}/vCPE.policies.optimization.input.tosca.json
+ ${postjson}= Get file ${DATA}/vCPE.policies.optimization.input.tosca.json
CreatePolicy /policy/api/v1/policytypes/onap.policies.optimization.resource.AffinityPolicy/versions/1.0.0/policies 200 ${postjson} OSDF_CASABLANCA.Affinity_Default 1.0.0
GetDefaultDecision
[Documentation] Runs Policy PAP to deploy a policy
${postjson}= Get file ${CURDIR}/data/vCPE.policy.input.tosca.deploy.json
${policyadmin}= PolicyAdminAuth
- PerformPostRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/policies 202 ${postjson} null ${policyadmin}
- ${result}= Run Process ${SCR_DMAAP}/wait_topic.sh POLICY-PDP-PAP
+ PerformPostRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/policies 202 ${postjson} null ${policyadmin}
+ ${result}= Run Process ${CURDIR}/data/wait_topic.sh POLICY-PDP-PAP
... responseTo xacml ACTIVE onap.restart.tca
Should Be Equal As Integers ${result.rc} 0
UndeployMonitorPolicy
[Documentation] Runs Policy PAP to undeploy a policy
${policyadmin}= PolicyAdminAuth
- PerformDeleteRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/policies/onap.restart.tca 202 ${policyadmin}
+ PerformDeleteRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/policies/onap.restart.tca 202 ${policyadmin}
GetStatisticsAfterUndeploy
[Documentation] Runs Policy Xacml PDP Statistics after policy is undeployed
PdpxGetReq
[Arguments] ${url}
${hcauth}= HealthCheckAuth
- ${resp}= PerformGetRequest ${POLICY_PDPX_PORT} ${url} 200 null ${hcauth}
+ ${resp}= PerformGetRequest ${POLICY_PDPX_IP} ${url} 200 null ${hcauth}
[return] ${resp}
DecisionPostReq
[Arguments] ${postjson} ${abbr}
${hcauth}= HealthCheckAuth
- ${resp}= PerformPostRequest ${POLICY_PDPX_PORT} /policy/pdpx/v1/decision 200 ${postjson} ${abbr} ${hcauth}
+ ${resp}= PerformPostRequest ${POLICY_PDPX_IP} /policy/pdpx/v1/decision 200 ${postjson} ${abbr} ${hcauth}
[return] ${resp}
# Record list of active docker containers
docker ps --format "table {{ .Names }}\t{{ .Status }}"
- # Show the logs from all containers
- docker-compose -f "${WORKSPACE}/csit/docker-compose-all.yml" logs > docker_compose.log
-
# show memory consumption after all docker instances initialized
docker_stats
+ source_safely ${WORKSPACE}/compose/stop-compose.sh
+
if [[ ${WORKDIR} ]]; then
rsync -av "${WORKDIR}/" "${WORKSPACE}/csit/archives/${PROJECT}"
fi
- fi
- # Run teardown script plan if it exists
- cd "${TESTPLANDIR}/plans/"
- TEARDOWN="${TESTPLANDIR}/plans/teardown.sh"
- if [ -f "${TEARDOWN}" ]; then
- echo "Running teardown script ${TEARDOWN}"
- source_safely "${TEARDOWN}"
+ rm -rf ${WORKSPACE}/models
fi
# TODO: do something with the output
exit $rc
# main
#
-if $(docker images | grep -q "onap\/policy-api")
-then
- export CONTAINER_LOCATION=$(
- docker images |
- grep onap/policy-api |
- head -1 |
- sed 's/onap\/policy-api.*$//'
- )
-else
- export CONTAINER_LOCATION="nexus3.onap.org:10001/"
-fi
-
# set and save options for quick failure
harden_set && save_set
fi
if [ -z "${WORKSPACE}" ]; then
- export WORKSPACE=$(git rev-parse --show-toplevel)
+ WORKSPACE=$(git rev-parse --show-toplevel)
+ export WORKSPACE
fi
# Add csit scripts to PATH
export PATH="${PATH}:${WORKSPACE}/csit:${WORKSPACE}/scripts:${ROBOT_VENV}/bin"
-export SCRIPTS="${WORKSPACE}/csit"
+export SCRIPTS="${WORKSPACE}/csit/resources/scripts"
export ROBOT_VARIABLES=
-# get the plan from git clone
-source "${SCRIPTS}"/get-branch.sh
-
export PROJECT="${1}"
-cd ${WORKSPACE}
-
-export TESTPLANDIR="${WORKSPACE}/csit/${PROJECT}"
-export TESTOPTIONS="${2}"
+cd "${WORKSPACE}"
rm -rf "${WORKSPACE}/csit/archives/${PROJECT}"
mkdir -p "${WORKSPACE}/csit/archives/${PROJECT}"
-# Run installation of prerequired libraries
+# Run installation of pre-required libraries
source_safely "${SCRIPTS}/prepare-robot-env.sh"
# Activate the virtualenv containing all the required libraries installed by prepare-robot-env.sh
source_safely "${ROBOT_VENV}/bin/activate"
+export TEST_PLAN_DIR="${WORKSPACE}/csit/resources/tests"
+export TEST_OPTIONS="${2}"
+
WORKDIR=$(mktemp -d)
cd "${WORKDIR}"
docker login -u docker -p docker nexus3.onap.org:10001
# Run setup script plan if it exists
-cd "${TESTPLANDIR}/plans/"
-SETUP="${TESTPLANDIR}/plans/setup.sh"
+SETUP="${SCRIPTS}/setup-${PROJECT}.sh"
if [ -f "${SETUP}" ]; then
echo "Running setup script ${SETUP}"
source_safely "${SETUP}"
# Run test plan
cd "${WORKDIR}"
echo "Reading the testplan:"
-cat "${TESTPLANDIR}/plans/testplan.txt" | egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' | sed "s|^|${TESTPLANDIR}/tests/|" > testplan.txt
+echo "${SUITES}" | egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' | sed "s|^|${TEST_PLAN_DIR}/|" > testplan.txt
cat testplan.txt
SUITES=$( xargs < testplan.txt )
echo ROBOT_VARIABLES="${ROBOT_VARIABLES}"
echo "Starting Robot test suites ${SUITES} ..."
relax_set
-python3 -m robot.run -N ${PROJECT} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${SUITES}
+python3 -m robot.run -N "${PROJECT}" -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${SUITES}
RESULT=$?
load_set
echo "RESULT: ${RESULT}"
+++ /dev/null
-# ============LICENSE_START====================================================
-# Copyright (C) 2022 Nordix Foundation.
-# =============================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END======================================================
-SCRIPTS=$(git rev-parse --show-toplevel)
-export SCRIPTS="${SCRIPTS}"/csit
-
-source "${SCRIPTS}"/get-versions.sh
-
-docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d policy-gui
-
-echo "Clamp GUI: https://localhost:2445/clamp"
+++ /dev/null
-#!/bin/bash
-#
-# ============LICENSE_START====================================================
-# Copyright (C) 2022 Nordix Foundation.
-# =============================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END======================================================
-
-SCRIPTS=$(git rev-parse --show-toplevel)
-export SCRIPTS="${SCRIPTS}"/csit
-
-source "${SCRIPTS}"/get-versions.sh
-
-docker-compose -f "${SCRIPTS}"/docker-compose-all.yml down -v
+++ /dev/null
-#!/bin/bash
-# ============LICENSE_START=======================================================
-# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
-# Modifications Copyright 2021-2023 Nordix Foundation.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-echo "Uninstall docker-py and reinstall docker."
-python3 -m pip uninstall -y docker-py
-python3 -m pip uninstall -y docker
-python3 -m pip install -U docker
-
-sudo apt-get -y install libxml2-utils
-
-source "${SCRIPTS}"/get-versions.sh
-bash "${SCRIPTS}"/get-models-examples.sh
-
-docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d xacml-pdp
-
-unset http_proxy https_proxy
-
-POLICY_API_IP=$(get-instance-ip.sh policy-api)
-POLICY_API_PORT=30440
-MARIADB_IP=$(get-instance-ip.sh mariadb)
-POLICY_PDPX_IP=$(get-instance-ip.sh policy-xacml-pdp)
-POLICY_PDPX_PORT=30441
-SIM_IP=$(get-instance-ip.sh simulator)
-POLICY_PAP_IP=$(get-instance-ip.sh policy-pap)
-POLICY_PAP_PORT=30442
-
-export SIM_IP
-
-echo XACML-PDP IP IS "${POLICY_PDPX_IP}"
-echo API IP IS "${POLICY_API_IP}"
-echo PAP IP IS "${POLICY_PAP_IP}"
-echo MARIADB IP IS "${MARIADB_IP}"
-echo SIM_IP IS "${SIM_IP}"
-
-# wait for the app to start up
-"${SCRIPTS}"/wait_for_rest.sh localhost "${POLICY_PDPX_PORT}"
-
-DATA2=${WORKSPACE}/models/models-examples/src/main/resources/policies
-
-ROBOT_VARIABLES=""
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR_DMAAP:${SCRIPTS}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA2:${DATA2}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PDPX_IP:${POLICY_PDPX_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PDPX_PORT:${POLICY_PDPX_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_PORT:${POLICY_API_PORT}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}"
-ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_PORT:${POLICY_PAP_PORT}"
+++ /dev/null
-# Test suites are relative paths under [policy/docker.git]/csit/[project]/tests.
-# Place the suites in run order.
-xacml-pdp-test.robot