Finish drools CSIT infra 01/85501/15
authorpdragosh <pdragosh@research.att.com>
Tue, 16 Apr 2019 17:19:45 +0000 (13:19 -0400)
committerjhh <jorge.hernandez-herrero@att.com>
Fri, 19 Apr 2019 03:52:14 +0000 (22:52 -0500)
Basic health check for now. Need to have ci-management
jobs enabled for this to work on every merge.

Cleaning out unused scripts and mock server. Renaming
policy engine script so its obvious that is what it is for.

Issue-ID: POLICY-1651
Change-Id: I469823795d4a9f5531d150610ba2ed0b75585677
Signed-off-by: pdragosh <pdragosh@research.att.com>
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Signed-off-by: pdragosh <pdragosh@research.att.com>
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
45 files changed:
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
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/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/engine.sh [moved from scripts/policy/script1.sh with 99% similarity]
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]

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
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/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
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/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