Merge "Updated CSIT to reference new repo location"
authorGary Wu <gary.i.wu@huawei.com>
Mon, 22 Apr 2019 16:51:09 +0000 (16:51 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 22 Apr 2019 16:51:09 +0000 (16:51 +0000)
65 files changed:
plans/modeling-toscaparsers-genericparser/sanity-check/setup.sh [new file with mode: 0644]
plans/modeling-toscaparsers-genericparser/sanity-check/teardown.sh [new file with mode: 0644]
plans/modeling-toscaparsers-genericparser/sanity-check/testplan.txt [new file with mode: 0644]
plans/policy/drools-applications/setup.sh [new file with mode: 0755]
plans/policy/drools-applications/teardown.sh [moved from scripts/policy/mock-hello.sh with 63% similarity]
plans/policy/drools-applications/testplan.txt [new file with mode: 0644]
plans/policy/drools-pdp/setup.sh
plans/policy/drools-pdp/teardown.sh
plans/policy/health/setup.sh
plans/policy/health/teardown.sh
plans/policy/health/testplan.txt
plans/policy/pap/setup.sh
plans/policy/pap/teardown.sh
plans/vfc-gvnfm-vnfmgr/sanity-check/setup.sh
plans/vfc-gvnfm-vnfmgr/sanity-check/teardown.sh
plans/vfc-gvnfm-vnfres/sanity-check/setup.sh
plans/vfc-gvnfm-vnfres/sanity-check/teardown.sh
plans/vfc-nfvo-catalog/sanity-check/setup.sh
plans/vfc-nfvo-catalog/sanity-check/teardown.sh
plans/vfc-nfvo-lcm/sanity-check/setup.sh
plans/vfc-nfvo-lcm/sanity-check/teardown.sh
scripts/policy/config/drools/base.conf [new file with mode: 0644]
scripts/policy/config/drools/feature-healthcheck.conf [new file with mode: 0644]
scripts/policy/config/pap/onap.policies.monitoring.cdap.tca.hi.lo.app.json [new file with mode: 0644]
scripts/policy/config/pap/vCPE.policy.monitoring.input.tosca.json [new file with mode: 0644]
scripts/policy/docker-compose-drools-apps.yml [new file with mode: 0644]
scripts/policy/docker-compose-drools.yml [new file with mode: 0644]
scripts/policy/docker-compose-engine.yml [new file with mode: 0644]
scripts/policy/docker-compose-pap.yml
scripts/policy/engine.sh [moved from scripts/policy/script1.sh with 99% similarity]
tests/modeling-toscaparsers-genericparser/test.robot [new file with mode: 0644]
tests/policy/drools-applications/drools-applications-test.robot [new file with mode: 0644]
tests/policy/engine/Policy-CSIT.robot [moved from tests/policy/suite1/Policy-CSIT.robot with 100% similarity]
tests/policy/engine/__init__.robot [moved from tests/policy/suite1/__init__.robot with 100% similarity]
tests/policy/engine/configpolicy_vCPE.template [moved from tests/policy/suite1/configpolicy_vCPE.template with 100% similarity]
tests/policy/engine/configpolicy_vCPE_R1.template [moved from tests/policy/suite1/configpolicy_vCPE_R1.template with 100% similarity]
tests/policy/engine/configpolicy_vDNS.template [moved from tests/policy/suite1/configpolicy_vDNS.template with 100% similarity]
tests/policy/engine/configpolicy_vDNS_R1.template [moved from tests/policy/suite1/configpolicy_vDNS_R1.template with 100% similarity]
tests/policy/engine/configpolicy_vFW.template [moved from tests/policy/suite1/configpolicy_vFW.template with 100% similarity]
tests/policy/engine/configpolicy_vFW_R1.template [moved from tests/policy/suite1/configpolicy_vFW_R1.template with 100% similarity]
tests/policy/engine/createpolicy.template [moved from tests/policy/suite1/createpolicy.template with 100% similarity]
tests/policy/engine/deletepolicy.template [moved from tests/policy/suite1/deletepolicy.template with 100% similarity]
tests/policy/engine/getconfigpolicy.template [moved from tests/policy/suite1/getconfigpolicy.template with 100% similarity]
tests/policy/engine/getoofpolicy.template [moved from tests/policy/suite1/getoofpolicy.template with 100% similarity]
tests/policy/engine/global_properties.robot [moved from tests/policy/suite1/global_properties.robot with 100% similarity]
tests/policy/engine/json_templater.robot [moved from tests/policy/suite1/json_templater.robot with 100% similarity]
tests/policy/engine/listpolicy.template [moved from tests/policy/suite1/listpolicy.template with 100% similarity]
tests/policy/engine/multiple_pushpolicy.template [moved from tests/policy/suite1/multiple_pushpolicy.template with 100% similarity]
tests/policy/engine/multiple_unpushpolicy.template [moved from tests/policy/suite1/multiple_unpushpolicy.template with 100% similarity]
tests/policy/engine/oofpolicy_HPA_R1.template [moved from tests/policy/suite1/oofpolicy_HPA_R1.template with 100% similarity]
tests/policy/engine/opspolicy_VDNS.template [moved from tests/policy/suite1/opspolicy_VDNS.template with 100% similarity]
tests/policy/engine/opspolicy_VDNS_R1.template [moved from tests/policy/suite1/opspolicy_VDNS_R1.template with 100% similarity]
tests/policy/engine/opspolicy_VFW.template [moved from tests/policy/suite1/opspolicy_VFW.template with 100% similarity]
tests/policy/engine/opspolicy_VFW_R1.template [moved from tests/policy/suite1/opspolicy_VFW_R1.template with 100% similarity]
tests/policy/engine/opspolicy_vCPE.template [moved from tests/policy/suite1/opspolicy_vCPE.template with 100% similarity]
tests/policy/engine/opspolicy_vCPE_R1.template [moved from tests/policy/suite1/opspolicy_vCPE_R1.template with 100% similarity]
tests/policy/engine/opspolicy_vOLTE.template [moved from tests/policy/suite1/opspolicy_vOLTE.template with 100% similarity]
tests/policy/engine/opspolicy_vOLTE_R1.template [moved from tests/policy/suite1/opspolicy_vOLTE_R1.template with 100% similarity]
tests/policy/engine/policy_interface.robot [moved from tests/policy/suite1/policy_interface.robot with 100% similarity]
tests/policy/engine/pushpolicy.template [moved from tests/policy/suite1/pushpolicy.template with 100% similarity]
tests/policy/engine/sdncnamingpolicy_vFW.template [moved from tests/policy/suite1/sdncnamingpolicy_vFW.template with 100% similarity]
tests/policy/engine/sdncnamingpolicy_vPG.template [moved from tests/policy/suite1/sdncnamingpolicy_vPG.template with 100% similarity]
tests/policy/pap/data/create.group.request.json [new file with mode: 0644]
tests/policy/pap/pap-test.robot
tests/vfc/nfvo-lcm/test.robot

diff --git a/plans/modeling-toscaparsers-genericparser/sanity-check/setup.sh b/plans/modeling-toscaparsers-genericparser/sanity-check/setup.sh
new file mode 100644 (file)
index 0000000..1ca35be
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/bash
+#
+# Copyright 2017 ZTE Corporation.
+#
+# 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.
+#
+# Place the scripts in run order:
+# Start all process required for executing test case
+
+#login to the onap nexus docker repo
+docker login -u docker -p docker nexus3.onap.org:10001
+
+# start msb
+docker run -d -p 8500:8500 --name msb_consul consul:0.9.3
+CONSUL_IP=`get-instance-ip.sh msb_consul`
+echo CONSUL_IP=${CONSUL_IP}
+
+docker run -d -p 10081:10081 -e CONSUL_IP=$CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery
+DISCOVERY_IP=`get-instance-ip.sh msb_discovery`
+echo DISCOVERY_IP=${DISCOVERY_IP}
+
+docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP -e "ROUTE_LABELS=visualRange:1" --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway
+MSB_IP==`get-instance-ip.sh msb_internal_apigateway`
+echo MSB_IP=${MSB_IP}
+
+docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql nexus3.onap.org:10001/onap/vfc/db
+VFC_DB_IP=`get-instance-ip.sh vfc-db`
+echo VFC_DB_IP=${VFC_DB_IP}
+
+# Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway)
+for i in {1..10}; do
+    curl -sS -m 1 ${CONSUL_IP}:8500 && curl -sS -m 1 ${DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IP}:80 && break
+    echo sleep $i
+    sleep $i
+done
+
+# Wait for initialization(3306 DB)
+for i in {1..3}; do
+    curl -sS -m 1 ${VFC_DB_IP}:3306 && break
+    echo sleep $i
+    sleep $i
+done
+
+# Need some time so service info can be synced from discovery to api gateway
+echo sleep 60
+sleep 60
+
+# start modeling-genericparser
+docker run -d --name modeling-genericparser -v /var/lib/mysql -e MSB_ADDR=${DISCOVERY_IP}:10081 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/catalog
+GenericParser_IP=`get-instance-ip.sh modeling-genericparser`
+for i in {1..10}; do
+    curl -sS -m 1 ${GenericParser_IP}:8806 && break
+    echo sleep $i
+    sleep $i
+done
+
+# Pass any variables required by Robot test suites in ROBOT_VARIABLES
+ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v GenericParser_IP:${GenericParser_IP} -v MSB_DISCOVERY_IP:${DISCOVERY_IP}"
diff --git a/plans/modeling-toscaparsers-genericparser/sanity-check/teardown.sh b/plans/modeling-toscaparsers-genericparser/sanity-check/teardown.sh
new file mode 100644 (file)
index 0000000..3982a1e
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# Copyright 2017 ZTE Corporation.
+#
+# 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.
+#
+
+# This script is sourced by run-csit.sh after Robot test completion.
+kill-instance.sh msb_internal_apigateway
+kill-instance.sh msb_discovery
+kill-instance.sh msb_consul
+kill-instance.sh vfc-db
+kill-instance.sh modeling-genericparser
diff --git a/plans/modeling-toscaparsers-genericparser/sanity-check/testplan.txt b/plans/modeling-toscaparsers-genericparser/sanity-check/testplan.txt
new file mode 100644 (file)
index 0000000..13456ae
--- /dev/null
@@ -0,0 +1,3 @@
+# Test suites are relative paths under [integration/csit.git]/tests/.
+# Place the suites in run order.
+modeling-toscaparsers-genericparser/test.robot
diff --git a/plans/policy/drools-applications/setup.sh b/plans/policy/drools-applications/setup.sh
new file mode 100755 (executable)
index 0000000..24422a6
--- /dev/null
@@ -0,0 +1,58 @@
+#!/bin/bash
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2019 AT&T Intellectual Property. 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."
+pip uninstall -y docker-py
+pip uninstall -y docker
+pip install -U docker==2.7.0
+
+docker login -u docker -p docker nexus3.onap.org:10001
+
+# Adding this waiting container to avoid race condition between api and mariadb containers.
+docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools-apps.yml run --rm start_dependencies
+docker logs mariadb
+docker container ls -a
+
+docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools-apps.yml up -d
+sleep 1m
+
+docker logs mariadb
+docker logs drools
+docker container ls -a
+
+POLICY_DROOLS_IP=`get-instance-ip.sh drools`
+MARIADB_IP=`get-instance-ip.sh mariadb`
+
+echo DROOLS IP IS ${POLICY_DROOLS_IP}
+echo MARIADB IP IS ${MARIADB_IP}
+
+# Wait for initialization
+for i in {1..10}; do
+   curl -sS ${MARIADB_IP}:3306 && break
+   echo sleep $i
+   sleep $i
+done
+
+for i in {1..10}; do
+   curl -sS ${POLICY_DROOLS_IP}:6969 && break
+   echo sleep $i
+   sleep $i
+done
+
+ROBOT_VARIABLES="-v POLICY_DROOLS_IP:${POLICY_DROOLS_IP}"
similarity index 63%
rename from scripts/policy/mock-hello.sh
rename to plans/policy/drools-applications/teardown.sh
index 6092dcb..48ab171 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright 2019 AT&T Intellectual Property. 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.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-# $1 ip address of the mock server
-
-curl -v -X PUT -d @- http://$1:1080/expectation <<EOF
-{
-    "httpRequest": {
-        "method": "GET",
-        "path": "/hello"
-    },
-    "httpResponse": {
-        "body": "Hello world!",
-        "statusCode": 200
-    }
-}
-EOF
-
+kill-instance.sh drools
+kill-instance.sh mariadb
diff --git a/plans/policy/drools-applications/testplan.txt b/plans/policy/drools-applications/testplan.txt
new file mode 100644 (file)
index 0000000..3878a4e
--- /dev/null
@@ -0,0 +1,3 @@
+# Test suites are relative paths under [integration/csit.git]/tests/.
+# Place the suites in run order.
+policy/drools-applications
index a7ed440..459805b 100755 (executable)
 # Place the scripts in run order:
 source ${SCRIPTS}/common_functions.sh
 
-docker run --name i-mock -d jamesdbloom/mockserver
-MOCK_IP=`get-instance-ip.sh i-mock`
-echo ${MOCK_IP}
-
-docker inspect i-mock
-
-# Wait for initialization
-for i in {1..10}; do
-    curl -sS ${MOCK_IP}:1080 && break
-    echo sleep $i
-    sleep $i
-done
-
-${WORKSPACE}/scripts/policy/mock-hello.sh ${MOCK_IP}
-
 source ${WORKSPACE}/scripts/policy/drools-pdp-script.sh
 
 # Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v MOCK_IP:${MOCK_IP} -v IP:${IP} -v POLICY_IP:${POLICY_IP} -v PDP_IP:${PDP_IP} -v DOCKER_IP:${DOCKER_IP}" 
+ROBOT_VARIABLES="-v IP:${IP} -v POLICY_IP:${POLICY_IP} -v PDP_IP:${PDP_IP} -v DOCKER_IP:${DOCKER_IP}" 
 export PDP_IP=${PDP_IP}
 export POLICY_IP=${POLICY_IP}
 export DOCKER_IP=${DOCKER_IP}
index f1f0b21..303ccff 100755 (executable)
@@ -24,7 +24,6 @@ docker rm -v "${name}"
 
 mkdir -p "${WORKSPACE}"/archives
 
-kill_instance i-mock
 kill_instance drools
 kill_instance pdp
 kill_instance brmsgw
index 890df9b..c99af3f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright 2017, 2019 AT&T Intellectual Property. 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.
 # Place the scripts in run order:
 source ${SCRIPTS}/common_functions.sh
 
-docker run --name i-mock -d jamesdbloom/mockserver
-MOCK_IP=`get-instance-ip.sh i-mock`
-echo ${MOCK_IP}
-
-docker inspect i-mock
-
-# Wait for initialization
-for i in {1..10}; do
-    curl -sS ${MOCK_IP}:1080 && break
-    echo sleep $i
-    sleep $i
-done
-
-${WORKSPACE}/scripts/policy/mock-hello.sh ${MOCK_IP}
-
-source ${WORKSPACE}/scripts/policy/script1.sh
+source ${WORKSPACE}/scripts/policy/engine.sh
 
 # Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v MOCK_IP:${MOCK_IP} -v IP:${IP} -v POLICY_IP:${POLICY_IP} -v PDP_IP:${PDP_IP} -v DOCKER_IP:${DOCKER_IP}" 
+ROBOT_VARIABLES="-v IP:${IP} -v POLICY_IP:${POLICY_IP} -v PDP_IP:${PDP_IP} -v DOCKER_IP:${DOCKER_IP}" 
 export PDP_IP=${PDP_IP}
 export POLICY_IP=${POLICY_IP}
 export DOCKER_IP=${DOCKER_IP}
index f1f0b21..303ccff 100755 (executable)
@@ -24,7 +24,6 @@ docker rm -v "${name}"
 
 mkdir -p "${WORKSPACE}"/archives
 
-kill_instance i-mock
 kill_instance drools
 kill_instance pdp
 kill_instance brmsgw
index ab8a5b0..6bad34f 100644 (file)
@@ -1,3 +1,3 @@
 # Test suites are relative paths under [integration/csit.git]/tests/.
 # Place the suites in run order.
-policy/suite1
+policy/engine
index 2d31b9c..d1ba20c 100644 (file)
@@ -27,10 +27,14 @@ docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-pap.yml run --rm st
 docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-pap.yml up -d
 sleep 3
 
+unset http_proxy https_proxy
+
 POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
+POLICY_API_IP=`get-instance-ip.sh policy-api`
 MARIADB_IP=`get-instance-ip.sh mariadb`
 
 echo PAP IP IS ${POLICY_PAP_IP}
+echo API IP IS ${POLICY_API_IP}
 echo MARIADB IP IS ${MARIADB_IP}
 # Wait for initialization
 for i in {1..10}; do
@@ -43,9 +47,29 @@ for i in {1..10}; do
    echo sleep $i
    sleep $i
 done
+for i in {1..10}; do
+   curl -sS ${POLICY_API_IP}:6969 && break
+   echo sleep $i
+   sleep $i
+done
 
 #Configure the database
 docker exec -it mariadb  chmod +x /docker-entrypoint-initdb.d/db.sh
 docker exec -it mariadb  /docker-entrypoint-initdb.d/db.sh
 
+#Add policy type and policy to the database via the Policy Api
+AUTH="healthcheck:zb!XztG34"
+CONTYPE="Content-Type: application/json"
+URL=https://${POLICY_API_IP}:6969/policy/api/v1/policytypes
+CONFIGDIR=${WORKSPACE}/scripts/policy/config/pap
+POLTYPE=onap.policies.monitoring.cdap.tca.hi.lo.app
+
+SRCFILE=${CONFIGDIR}/${POLTYPE}.json
+curl -sS -k --user "${AUTH}" -H "${CONTYPE}" -d @${SRCFILE} $URL
+
+URL2=${URL}/${POLTYPE}/versions/1.0.0/policies
+SRCFILE=${CONFIGDIR}/vCPE.policy.monitoring.input.tosca.json
+curl -sS -k --user "${AUTH}" -H "${CONTYPE}" -d @${SRCFILE} $URL2
+
+
 ROBOT_VARIABLES="-v POLICY_PAP_IP:${POLICY_PAP_IP}"
index 8798697..f05d3af 100644 (file)
@@ -18,5 +18,6 @@
 # ============LICENSE_END=========================================================
 
 kill-instance.sh policy-pap
+kill-instance.sh policy-api
 kill-instance.sh mariadb
 kill-instance.sh policy-wait
index 28be184..22dd8ae 100755 (executable)
@@ -75,5 +75,11 @@ for i in {1..10}; do
     sleep $i
 done
 
+docker cp vfc-vnfmgr:/service/vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py ./
+cat config.py
+
+docker cp vfc-vnfmgr:/service/vfc/gvnfm/vnfmgr/mgr/logs/runtime_mgr.log ./
+cat runtime_mgr.log
+
 # Pass any variables required by Robot test suites in ROBOT_VARIABLES
 ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v VNFMGR_IP:${VNFMGR_IP} -v SCRIPTS:${SCRIPTS}"
index 8ca6676..cce8998 100755 (executable)
 # limitations under the License.
 #
 
+# print log for vnfmgr
+docker cp vfc-vnfmgr:/service/vfc/gvnfm/vnfmgr/mgr/logs/runtime_mgr.log ./
+cat runtime_mgr.log
+
 # This script is sourced by run-csit.sh after Robot test completion.
 kill-instance.sh msb_internal_apigateway
 kill-instance.sh msb_discovery
index 34be3c2..11b86c7 100755 (executable)
@@ -75,5 +75,11 @@ for i in {1..10}; do
     sleep $i
 done
 
+docker cp vfc-vnfres:/service/vfc/gvnfm/vnfres/res/res/pub/config/config.py ./
+cat config.py
+
+docker cp vfc-vnfres:/service/vfc/gvnfm/vnfres/res/logs/runtime_res.log ./
+cat runtime_res.log
+
 # Pass any variables required by Robot test suites in ROBOT_VARIABLES
 ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v VNFRES_IP:${VNFRES_IP} -v SCRIPTS:${SCRIPTS}"
index 8ca6676..4bc5984 100755 (executable)
 # limitations under the License.
 #
 
+# print log for vnfres
+docker cp vfc-vnfres:/service/vfc/gvnfm/vnfres/res/logs/runtime_res.log ./
+cat runtime_res.log
+
 # This script is sourced by run-csit.sh after Robot test completion.
 kill-instance.sh msb_internal_apigateway
 kill-instance.sh msb_discovery
index d839fa5..e622173 100644 (file)
@@ -64,5 +64,8 @@ for i in {1..10}; do
     sleep $i
 done
 
+docker cp vfc-catalog:/service/vfc/nfvo/catalog/logs/runtime_catalog.log ./
+cat runtime_catalog.log
+
 # Pass any variables required by Robot test suites in ROBOT_VARIABLES
 ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v CATALOG_IP:${CATALOG_IP} -v MSB_DISCOVERY_IP:${DISCOVERY_IP}"
index d498e34..cfccb3f 100644 (file)
 # limitations under the License.
 #
 
+# print log file for catalog
+docker cp vfc-catalog:/service/vfc/nfvo/catalog/logs/runtime_catalog.log ./
+cat runtime_catalog.log
+
 # This script is sourced by run-csit.sh after Robot test completion.
 kill-instance.sh msb_internal_apigateway
 kill-instance.sh msb_discovery
index 7a739ba..c206c0b 100755 (executable)
@@ -50,11 +50,11 @@ for i in {1..3}; do
     sleep $i
 done
 
-docker ps > 1.txt
-cat 1.txt
+docker ps > ps.txt
+cat ps.txt
 echo "****************************"
-docker logs -f vfc-db > 2.txt &
-cat 2.txt
+docker logs -f vfc-db > db.txt &
+cat db.txt
 
 # Need some time so service info can be synced from discovery to api gateway
 echo sleep 60
@@ -71,15 +71,11 @@ for i in {1..10}; do
     sleep $i
 done
 
-curl http://${NSLCM_IP}:8403/api/nslcm/v1/swagger.json
-
-docker logs -f vfc-nslcm > 3.txt &
-cat 3.txt
+docker logs -f vfc-nslcm > dockerlogs.txt &
+cat dockerlogs.txt
 
 docker cp vfc-nslcm:/service/vfc/nfvo/lcm/logs/runtime_lcm.log ./
 cat runtime_lcm.log
 
-
-
 # Pass any variables required by Robot test suites in ROBOT_VARIABLES
 ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v NSLCM_IP:${NSLCM_IP} -v SCRIPTS:${SCRIPTS}"
index 6ddf755..5fa0106 100755 (executable)
 # limitations under the License.
 #
 
+# print logs of lcm
+docker cp vfc-nslcm:/service/vfc/nfvo/lcm/logs/runtime_lcm.log ./
+cat runtime_lcm.log
+
 # This script is sourced by run-csit.sh after Robot test completion.
 kill-instance.sh msb_internal_apigateway
 kill-instance.sh msb_discovery
diff --git a/scripts/policy/config/drools/base.conf b/scripts/policy/config/drools/base.conf
new file mode 100644 (file)
index 0000000..d3164cb
--- /dev/null
@@ -0,0 +1,119 @@
+# ============LICENSE_START=======================================================
+# Copyright (C) 2019 AT&T Intellectual Property. 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.
+# ============LICENSE_END=========================================================
+
+# JVM options
+
+JVM_OPTIONS=-server -Xms512m -Xmx512m
+
+# SYSTEM software configuration
+
+POLICY_HOME=/opt/app/policy
+POLICY_LOGS=/var/log/onap/policy/pdpd
+JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
+KEYSTORE_PASSWD=Pol1cy_0nap
+TRUSTSTORE_PASSWD=Pol1cy_0nap
+
+# Telemetry credentials
+
+TELEMETRY_PORT=9696
+TELEMETRY_HOST=0.0.0.0
+TELEMETRY_USER=demo@people.osaaf.org
+TELEMETRY_PASSWORD=demo123456!
+
+# nexus repository
+
+SNAPSHOT_REPOSITORY_ID=
+SNAPSHOT_REPOSITORY_URL=
+RELEASE_REPOSITORY_ID=
+RELEASE_REPOSITORY_URL=
+REPOSITORY_USERNAME=
+REPOSITORY_PASSWORD=
+
+# Relational (SQL) DB access
+
+SQL_HOST=
+SQL_USER=
+SQL_PASSWORD=
+
+# AAF
+
+AAF=false
+AAF_NAMESPACE=org.onap.policy
+AAF_HOST=aaf.api.simpledemo.onap.org
+
+# PDP-D DMaaP configuration channel
+
+PDPD_CONFIGURATION_TOPIC=PDPD-CONFIGURATION
+PDPD_CONFIGURATION_API_KEY=
+PDPD_CONFIGURATION_API_SECRET=
+PDPD_CONFIGURATION_CONSUMER_GROUP=
+PDPD_CONFIGURATION_CONSUMER_INSTANCE=
+PDPD_CONFIGURATION_PARTITION_KEY=
+
+# PAP-PDP configuration channel
+
+POLICY_PDP_PAP_TOPIC=POLICY-PDP-PAP
+POLICY_PDP_PAP_API_KEY=
+POLICY_PDP_PAP_API_SECRET=
+
+# PAP
+
+PAP_HOST=pap
+PAP_USERNAME=testpap
+PAP_PASSWORD=alpha123
+
+# PDP-X
+
+PDP_HOST=pdp
+PDP_USERNAME=testpdp
+PDP_PASSWORD=alpha123
+PDP_CLIENT_USERNAME=python
+PDP_CLIENT_PASSWORD=test
+PDP_ENVIRONMENT=TEST
+
+# DCAE DMaaP
+
+DCAE_TOPIC=unauthenticated.DCAE_CL_OUTPUT
+DCAE_SERVERS=mr.api.simpledemo.onap.org
+DCAE_CONSUMER_GROUP=dcae.policy.shared
+
+# Open DMaaP
+
+DMAAP_SERVERS=mr.api.simpledemo.onap.org
+
+# AAI
+
+AAI_URL=https://aai.api.simpledemo.onap.org:8443
+AAI_USERNAME=policy@policy.onap.org
+AAI_PASSWORD=demo123456!
+
+# MSO
+
+SO_URL=http://vm1.mso.simpledemo.onap.org:8080/onap/so/infra
+SO_USERNAME=InfraPortalClient
+SO_PASSWORD=password1$
+
+# VFC
+
+VFC_URL=
+VFC_USERNAME=
+VFC_PASSWORD=
+
+# SDNC
+
+SDNC_URL=
+SDNC_USERNAME=
+SDNC_PASSWORD=
diff --git a/scripts/policy/config/drools/feature-healthcheck.conf b/scripts/policy/config/drools/feature-healthcheck.conf
new file mode 100644 (file)
index 0000000..c205e9f
--- /dev/null
@@ -0,0 +1,18 @@
+# ============LICENSE_START=======================================================
+# Copyright (C) 2019 AT&T Intellectual Property. 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.
+# ============LICENSE_END=========================================================
+
+HEALTHCHECK_USER=demo@people.osaaf.org
+HEALTHCHECK_PASSWORD=demo123456!
diff --git a/scripts/policy/config/pap/onap.policies.monitoring.cdap.tca.hi.lo.app.json b/scripts/policy/config/pap/onap.policies.monitoring.cdap.tca.hi.lo.app.json
new file mode 100644 (file)
index 0000000..1d1a4d6
--- /dev/null
@@ -0,0 +1,223 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
+    "policy_types": [
+        {
+            "onap.policies.Monitoring": {
+                "derived_from": "tosca.policies.Root",
+                "description": "a base policy type for all policies that governs monitoring provisioning"
+            }
+        },
+        {
+            "onap.policies.monitoring.cdap.tca.hi.lo.app": {
+                "derived_from": "onap.policies.Monitoring",
+                "version": "1.0.0",
+                "properties": {
+                    "tca_policy": {
+                        "type": "map",
+                        "description": "TCA Policy JSON",
+                        "entry_schema": {
+                            "type": "onap.datatypes.monitoring.tca_policy"
+                        }
+                    }
+                }
+            }
+        }
+    ],
+    "data_types": [
+        {
+            "onap.datatypes.monitoring.metricsPerEventName": {
+                "derived_from": "tosca.datatypes.Root",
+                "properties": {
+                    "controlLoopSchemaType": {
+                        "type": "string",
+                        "required": true,
+                        "description": "Specifies Control Loop Schema Type for the event Name e.g. VNF, VM",
+                        "constraints": [
+                            {
+                                "valid_values": [
+                                    "VM",
+                                    "VNF"
+                                ]
+                            }
+                        ]
+                    },
+                    "eventName": {
+                        "type": "string",
+                        "required": true,
+                        "description": "Event name to which thresholds need to be applied"
+                    },
+                    "policyName": {
+                        "type": "string",
+                        "required": true,
+                        "description": "TCA Policy Scope Name"
+                    },
+                    "policyScope": {
+                        "type": "string",
+                        "required": true,
+                        "description": "TCA Policy Scope"
+                    },
+                    "policyVersion": {
+                        "type": "string",
+                        "required": true,
+                        "description": "TCA Policy Scope Version"
+                    },
+                    "thresholds": {
+                        "type": "list",
+                        "required": true,
+                        "description": "Thresholds associated with eventName",
+                        "entry_schema": {
+                            "type": "onap.datatypes.monitoring.thresholds"
+                        }
+                    }
+                }
+            }
+        },
+        {
+            "onap.datatypes.monitoring.tca_policy": {
+                "derived_from": "tosca.datatypes.Root",
+                "properties": {
+                    "domain": {
+                        "type": "string",
+                        "required": true,
+                        "description": "Domain name to which TCA needs to be applied",
+                        "default": "measurementsForVfScaling",
+                        "constraints": [
+                            {
+                                "equal": "measurementsForVfScaling"
+                            }
+                        ]
+                    },
+                    "metricsPerEventName": {
+                        "type": "list",
+                        "required": true,
+                        "description": "Contains eventName and threshold details that need to be applied to given eventName",
+                        "entry_schema": {
+                            "type": "onap.datatypes.monitoring.metricsPerEventName"
+                        }
+                    }
+                }
+            }
+        },
+        {
+            "onap.datatypes.monitoring.thresholds": {
+                "derived_from": "tosca.datatypes.Root",
+                "properties": {
+                    "closedLoopControlName": {
+                        "type": "string",
+                        "required": true,
+                        "description": "Closed Loop Control Name associated with the threshold"
+                    },
+                    "closedLoopEventStatus": {
+                        "type": "string",
+                        "required": true,
+                        "description": "Closed Loop Event Status of the threshold",
+                        "constraints": [
+                            {
+                                "valid_values": [
+                                    "ONSET",
+                                    "ABATED"
+                                ]
+                            }
+                        ]
+                    },
+                    "direction": {
+                        "type": "string",
+                        "required": true,
+                        "description": "Direction of the threshold",
+                        "constraints": [
+                            {
+                                "valid_values": [
+                                    "LESS",
+                                    "LESS_OR_EQUAL",
+                                    "GREATER",
+                                    "GREATER_OR_EQUAL",
+                                    "EQUAL"
+                                ]
+                            }
+                        ]
+                    },
+                    "fieldPath": {
+                        "type": "string",
+                        "required": true,
+                        "description": "Json field Path as per CEF message which needs to be analyzed for TCA",
+                        "constraints": [
+                            {
+                                "valid_values": [
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated",
+                                    "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle",
+                                    "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt",
+                                    "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice",
+                                    "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq",
+                                    "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal",
+                                    "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem",
+                                    "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait",
+                                    "$.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage",
+                                    "$.event.measurementsForVfScalingFields.meanRequestLatency",
+                                    "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered",
+                                    "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached",
+                                    "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured",
+                                    "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree",
+                                    "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed",
+                                    "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value"
+                                ]
+                            }
+                        ]
+                    },
+                    "severity": {
+                        "type": "string",
+                        "required": true,
+                        "description": "Threshold Event Severity",
+                        "constraints": [
+                            {
+                                "valid_values": [
+                                    "CRITICAL",
+                                    "MAJOR",
+                                    "MINOR",
+                                    "WARNING",
+                                    "NORMAL"
+                                ]
+                            }
+                        ]
+                    },
+                    "thresholdValue": {
+                        "type": "integer",
+                        "required": true,
+                        "description": "Threshold value for the field Path inside CEF message"
+                    },
+                    "version": {
+                        "type": "string",
+                        "required": true,
+                        "description": "Version number associated with the threshold"
+                    }
+                }
+            }
+        }
+    ]
+}
\ No newline at end of file
diff --git a/scripts/policy/config/pap/vCPE.policy.monitoring.input.tosca.json b/scripts/policy/config/pap/vCPE.policy.monitoring.input.tosca.json
new file mode 100644 (file)
index 0000000..fac5cfa
--- /dev/null
@@ -0,0 +1,51 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
+    "topology_template": {
+        "policies": [
+            {
+                "onap.restart.tca": {
+                    "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+                    "version": "1.0.0",
+                    "type_version": "1.0.0",
+                    "metadata": {
+                        "policy-id": "onap.restart.tca"
+                    },
+                    "properties": {
+                        "tca_policy": {
+                            "domain": "measurementsForVfScaling",
+                            "metricsPerEventName": [
+                                {
+                                    "eventName": "Measurement_vGMUX",
+                                    "controlLoopSchemaType": "VNF",
+                                    "policyScope": "DCAE",
+                                    "policyName": "DCAE.Config_tca-hi-lo",
+                                    "policyVersion": "v0.0.1",
+                                    "thresholds": [
+                                        {
+                                            "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+                                            "version": "1.0.2",
+                                            "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
+                                            "thresholdValue": 0,
+                                            "direction": "EQUAL",
+                                            "severity": "MAJOR",
+                                            "closedLoopEventStatus": "ABATED"
+                                        },
+                                        {
+                                            "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+                                            "version": "1.0.2",
+                                            "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
+                                            "thresholdValue": 0,
+                                            "direction": "GREATER",
+                                            "severity": "CRITICAL",
+                                            "closedLoopEventStatus": "ONSET"
+                                        }
+                                    ]
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        ]
+    }
+}
diff --git a/scripts/policy/docker-compose-drools-apps.yml b/scripts/policy/docker-compose-drools-apps.yml
new file mode 100644 (file)
index 0000000..a42c299
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright 2019 AT&T Intellectual Property. 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.
+version: '2'
+services:
+   mariadb:
+      image: mariadb:10.2.14
+      container_name: mariadb
+      hostname: mariadb
+      command: ['--lower-case-table-names=1', '--wait_timeout=28800']
+      env_file: 
+         - ${WORKSPACE}/scripts/policy/config/db/db.conf
+      volumes:
+         - ${WORKSPACE}/scripts/policy/config/db:/docker-entrypoint-initdb.d
+      expose:
+       - 3306
+   drools:
+      image: nexus3.onap.org:10001/onap/policy-pdpd-cl:1.4-SNAPSHOT-latest
+      container_name: drools
+      depends_on: 
+       - mariadb
+      hostname: drools
+      expose:
+       - 6969
+       - 9696
+      volumes:
+       - ${WORKSPACE}/scripts/policy/config/drools:/tmp/policy-install/config
+      environment:
+       - DEBUG=y
+   start_dependencies:
+      image: dadarek/wait-for-dependencies
+      container_name: policy-wait
+      depends_on:
+       - mariadb
+      hostname: policy-wait
+      command: mariadb:3306
+
diff --git a/scripts/policy/docker-compose-drools.yml b/scripts/policy/docker-compose-drools.yml
new file mode 100644 (file)
index 0000000..ffee9cd
--- /dev/null
@@ -0,0 +1,55 @@
+# Copyright 2018 AT&T Intellectual Property. 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.
+version: '2'
+services:
+   mariadb:
+      image: mariadb:10.2.14
+      container_name: mariadb
+      hostname: mariadb
+      command: ['--lower-case-table-names=1', '--wait_timeout=28800']
+      env_file: config/db/db.conf
+      volumes:
+         - ./config/db:/docker-entrypoint-initdb.d
+      expose:
+       - 3306
+   nexus:
+      image: sonatype/nexus:2.14.8-01
+      container_name: nexus
+      hostname: nexus
+   pap:
+      image: onap/policy-pe
+      environment:
+       - PRELOAD_POLICIES=${PRELOAD_POLICIES}
+      container_name: pap
+      depends_on: 
+       - mariadb
+      hostname: pap
+      expose:
+       - 8443
+       - 9091
+      command: pap
+      volumes:
+       - ./config/pe:/tmp/policy-install/config
+   drools:
+      image: onap/policy-drools
+      container_name: drools
+      depends_on: 
+       - mariadb
+       - nexus
+      hostname: drools
+      expose:
+       - 6969
+       - 9696
+      volumes:
+       - ./config/drools:/tmp/policy-install/config
diff --git a/scripts/policy/docker-compose-engine.yml b/scripts/policy/docker-compose-engine.yml
new file mode 100644 (file)
index 0000000..e67729e
--- /dev/null
@@ -0,0 +1,75 @@
+# Copyright 2018 AT&T Intellectual Property. 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.
+version: '2'
+services:
+   mariadb:
+      image: mariadb:10.2.14
+      container_name: mariadb
+      hostname: mariadb
+      command: ['--lower-case-table-names=1', '--wait_timeout=28800']
+      env_file: config/db/db.conf
+      volumes:
+         - ./config/db:/docker-entrypoint-initdb.d
+      expose:
+       - 3306
+   nexus:
+      image: sonatype/nexus:2.14.8-01
+      container_name: nexus
+      hostname: nexus
+   pap:
+      image: onap/policy-pe
+      environment:
+       - PRELOAD_POLICIES=${PRELOAD_POLICIES}
+      container_name: pap
+      depends_on: 
+       - mariadb
+      hostname: pap
+      expose:
+       - 8443
+       - 9091
+      command: pap
+      volumes:
+       - ./config/pe:/tmp/policy-install/config
+   pdp:
+      image: onap/policy-pe
+      container_name: pdp
+      depends_on: 
+       - pap
+      hostname: pdp
+      expose:
+       - 8081
+      command: pdp
+      volumes:
+       - ./config/pe:/tmp/policy-install/config
+   brmsgw:
+      image: onap/policy-pe
+      container_name: brmsgw
+      depends_on: 
+       - pap
+      hostname: brmsgw
+      command: brmsgw
+      volumes:
+       - ./config/pe:/tmp/policy-install/config
+   drools:
+      image: onap/policy-drools
+      container_name: drools
+      depends_on: 
+       - mariadb
+       - nexus
+      hostname: drools
+      expose:
+       - 6969
+       - 9696
+      volumes:
+       - ./config/drools:/tmp/policy-install/config
index c5ff9cf..115f884 100644 (file)
@@ -34,6 +34,14 @@ services:
       hostname: policy-pap
       ports:
        - "6969:6969"
+   api:
+      image: nexus3.onap.org:10001/onap/policy-api
+      container_name: policy-api
+      depends_on:
+       - mariadb
+      hostname: policy-api
+      ports:
+       - "9969:6969"
    start_dependencies:
       image: dadarek/wait-for-dependencies
       container_name: policy-wait
similarity index 99%
rename from scripts/policy/script1.sh
rename to scripts/policy/engine.sh
index c47c4bf..b806cec 100755 (executable)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-echo "This is ${WORKSPACE}/scripts/policy/script1.sh"
+echo "This is ${WORKSPACE}/scripts/policy/engine.sh"
 
 
 # the directory of the script
diff --git a/tests/modeling-toscaparsers-genericparser/test.robot b/tests/modeling-toscaparsers-genericparser/test.robot
new file mode 100644 (file)
index 0000000..b83bee4
--- /dev/null
@@ -0,0 +1,31 @@
+*** settings ***
+Library     Collections
+Library     RequestsLibrary
+Library     OperatingSystem
+Library     json
+
+*** Variables ***
+@{return_ok_list}=         200  201  202
+${queryswagger_url}        /api/catalog/v1/swagger.json
+${queryVNFPackage_url}     /api/catalog/v1/vnfpackages
+${queryNSPackages_url}     /api/catalog/v1/nspackages
+${healthcheck_url}         /api/catalog/v1/health_check
+
+*** Test Cases ***
+GetVNFPackages
+    ${headers}            Create Dictionary    Content-Type=application/json    Accept=application/json
+    Create Session        web_session          http://${CATALOG_IP}:8806             headers=${headers}
+    ${resp}=              Get Request          web_session                      ${queryVNFPackage_url}
+    ${responese_code}=    Convert To String    ${resp.status_code}
+    List Should Contain Value    ${return_ok_list}   ${responese_code}
+
+CatalogHealthCheckTest
+    [Documentation]    check health for catalog by MSB
+    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
+    Create Session    web_session    http://${CATALOG_IP}:8806    headers=${headers}
+    ${resp}=  Get Request    web_session    ${healthcheck_url}
+    ${responese_code}=     Convert To String      ${resp.status_code}
+    List Should Contain Value    ${return_ok_list}   ${responese_code}
+    ${response_json}    json.loads    ${resp.content}
+    ${health_status}=    Convert To String      ${response_json['status']}
+    Should Be Equal    ${health_status}    active
diff --git a/tests/policy/drools-applications/drools-applications-test.robot b/tests/policy/drools-applications/drools-applications-test.robot
new file mode 100644 (file)
index 0000000..cf4d3ce
--- /dev/null
@@ -0,0 +1,17 @@
+*** Settings ***
+Library     Collections
+Library     RequestsLibrary
+Library     OperatingSystem
+Library     json
+
+*** Test Cases ***
+Alive
+     [Documentation]    Runs Policy PDP Alive Check
+     ${auth}=    Create List    demo@people.osaaf.org    demo123456!
+     Log    Creating session https://${POLICY_DROOLS_IP}:9696
+     ${session}=    Create Session      policy  https://${POLICY_DROOLS_IP}:9696   auth=${auth}
+     ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
+     ${resp}=   Get Request     policy  /policy/pdp/engine     headers=${headers}
+     Log    Received response from policy ${resp.text}
+     Should Be Equal As Strings    ${resp.status_code}     200
+     Should Be Equal As Strings    ${resp.json()['alive']}  True
diff --git a/tests/policy/pap/data/create.group.request.json b/tests/policy/pap/data/create.group.request.json
new file mode 100644 (file)
index 0000000..b0937f7
--- /dev/null
@@ -0,0 +1,42 @@
+{
+    "groups": [
+        {
+            "name": "create.group.request",
+            "pdpGroupState": "PASSIVE",
+            "properties": {
+                "hello": "world"
+            },
+            "pdpSubgroups": [
+                {
+                    "pdpType": "pdpTypeA",
+                    "desiredInstanceCount": 2,
+                    "properties": {},
+                    "supportedPolicyTypes": [
+                        {
+                            "name": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+                            "version": "1.0.0"
+                        }
+                    ],
+                    "policies": [
+                        {
+                            "name": "onap.restart.tca",
+                            "version": "1.0.0"
+                        }
+                    ]
+                },
+                {
+                    "pdpType": "pdpTypeB",
+                    "desiredInstanceCount": 1,
+                    "properties": {},
+                    "supportedPolicyTypes": [
+                        {
+                            "name": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+                            "version": "1.0.0"
+                        }
+                    ],
+                    "policies": []
+                }
+            ]
+        }
+    ]
+}
index d187d8f..0a6251d 100644 (file)
@@ -26,3 +26,92 @@ Statistics
      Log    Received response from policy ${resp.text}
      Should Be Equal As Strings    ${resp.status_code}     200
      Should Be Equal As Strings    ${resp.json()['code']}  200
+
+CreatePdpGroups
+     [Documentation]    Runs Policy PAP Create PDP Groups
+     ${auth}=    Create List    healthcheck    zb!XztG34
+     Log    Creating session https://${POLICY_PAP_IP}:6969
+     ${postjson}=  Get file  ${CURDIR}/data/create.group.request.json
+     ${session}=    Create Session      policy  https://${POLICY_PAP_IP}:6969   auth=${auth}
+     ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
+     ${resp}=   Post Request     policy  /policy/pap/v1/pdps    data=${postjson}     headers=${headers}
+     Log    Received response from policy ${resp.text}
+     Should Be Equal As Strings    ${resp.status_code}     200
+
+ActivatePdpGroup
+     [Documentation]    Runs Policy PAP Change PDP Group State to ACTIVE
+     ${auth}=    Create List    healthcheck    zb!XztG34
+     Log    Creating session https://${POLICY_PAP_IP}:6969
+     ${session}=    Create Session      policy  https://${POLICY_PAP_IP}:6969   auth=${auth}
+     ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
+     ${resp}=   Put Request     policy  /policy/pap/v1/pdps/groups/create.group.request?state=ACTIVE     headers=${headers}
+     Log    Received response from policy ${resp.text}
+     Should Be Equal As Strings    ${resp.status_code}     200
+
+QueryPdpGroups
+     [Documentation]    Runs Policy PAP Query PDP Groups
+     ${auth}=    Create List    healthcheck    zb!XztG34
+     Log    Creating session https://${POLICY_PAP_IP}:6969
+     ${session}=    Create Session      policy  https://${POLICY_PAP_IP}:6969   auth=${auth}
+     ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
+     ${resp}=   Get Request     policy  /policy/pap/v1/pdps     headers=${headers}
+     Log    Received response from policy ${resp.text}
+     Should Be Equal As Strings    ${resp.status_code}     200
+     Should Be Equal As Strings    ${resp.json()['groups'][0]['name']}  controlloop
+     Should Be Equal As Strings    ${resp.json()['groups'][1]['name']}  create.group.request
+     Should Be Equal As Strings    ${resp.json()['groups'][1]['pdpGroupState']}  ACTIVE
+     Should Be Equal As Strings    ${resp.json()['groups'][2]['name']}  monitoring
+
+UndeployPolicy
+     [Documentation]    Runs Policy PAP Undeploy a Policy from PDP Groups
+     ${auth}=    Create List    healthcheck    zb!XztG34
+     Log    Creating session https://${POLICY_PAP_IP}:6969
+     ${session}=    Create Session      policy  https://${POLICY_PAP_IP}:6969   auth=${auth}
+     ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
+     ${resp}=   Delete Request     policy  /policy/pap/v1/pdps/policies/onap.restart.tca     headers=${headers}
+     Log    Received response from policy ${resp.text}
+     Should Be Equal As Strings    ${resp.status_code}     200
+
+QueryPdpGroupsAfterUndeploy
+     [Documentation]    Runs Policy PAP Query PDP Groups after Undeploy
+     ${auth}=    Create List    healthcheck    zb!XztG34
+     Log    Creating session https://${POLICY_PAP_IP}:6969
+     ${session}=    Create Session      policy  https://${POLICY_PAP_IP}:6969   auth=${auth}
+     ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
+     ${resp}=   Get Request     policy  /policy/pap/v1/pdps     headers=${headers}
+     Log    Received response from policy ${resp.text}
+     Should Be Equal As Strings    ${resp.status_code}     200
+     Should Be Equal As Strings    ${resp.json()['groups'][1]['name']}  create.group.request
+     Should Be Equal As Strings    ${resp.json()['groups'][1]['pdpSubgroups'][0]['policies']}  []
+
+DeactivatePdpGroup
+     [Documentation]    Runs Policy PAP Change PDP Group State to PASSIVE
+     ${auth}=    Create List    healthcheck    zb!XztG34
+     Log    Creating session https://${POLICY_PAP_IP}:6969
+     ${session}=    Create Session      policy  https://${POLICY_PAP_IP}:6969   auth=${auth}
+     ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
+     ${resp}=   Put Request     policy  /policy/pap/v1/pdps/groups/create.group.request?state=PASSIVE     headers=${headers}
+     Log    Received response from policy ${resp.text}
+     Should Be Equal As Strings    ${resp.status_code}     200
+
+DeletePdpGroups
+     [Documentation]    Runs Policy PAP Delete PDP Groups
+     ${auth}=    Create List    healthcheck    zb!XztG34
+     Log    Creating session https://${POLICY_PAP_IP}:6969
+     ${session}=    Create Session      policy  https://${POLICY_PAP_IP}:6969   auth=${auth}
+     ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
+     ${resp}=   Delete Request     policy  /policy/pap/v1/pdps/groups/create.group.request     headers=${headers}
+     Log    Received response from policy ${resp.text}
+     Should Be Equal As Strings    ${resp.status_code}     200
+
+QueryPdpGroupsAfterDelete
+     [Documentation]    Runs Policy PAP Query PDP Groups after Delete
+     ${auth}=    Create List    healthcheck    zb!XztG34
+     Log    Creating session https://${POLICY_PAP_IP}:6969
+     ${session}=    Create Session      policy  https://${POLICY_PAP_IP}:6969   auth=${auth}
+     ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
+     ${resp}=   Get Request     policy  /policy/pap/v1/pdps     headers=${headers}
+     Log    Received response from policy ${resp.text}
+     Should Be Equal As Strings    ${resp.status_code}     200
+     Should Be Equal As Strings    ${resp.json()['groups'][0]['name']}  controlloop
+     Should Be Equal As Strings    ${resp.json()['groups'][1]['name']}  monitoring
index 833e24b..83040ad 100644 (file)
@@ -12,6 +12,7 @@ ${queryswagger_url}    /api/nslcm/v1/swagger.json
 ${create_ns_url}       /api/nslcm/v1/ns
 ${delete_ns_url}       /api/nslcm/v1/ns
 ${get_ns_url}          /api/nslcm/v1/ns
+${get_subscriptions_url}          /api/nslcm/v1/subscriptions
 ${healthcheck_url}     /api/nslcm/v1/health_check
 
 #json files
@@ -83,3 +84,11 @@ LcmGetNsTest
     ${resp}=  Get Request    web_session    ${get_ns_url}
     ${responese_code}=     Convert To String      ${resp.status_code}
     List Should Contain Value    ${return_ok_list}   ${responese_code}
+
+LcmGetSubscriptionsTest
+    [Documentation]    get subscriptions for nslcm by MSB
+    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
+    Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
+    ${resp}=  Get Request    web_session    ${get_subscriptions_url}
+    ${responese_code}=     Convert To String      ${resp.status_code}
+    List Should Contain Value    ${return_ok_list}   ${responese_code}