summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--csit/clamp/plans/setup.sh57
-rw-r--r--csit/clamp/plans/teardown.sh20
-rw-r--r--csit/clamp/plans/testplan.txt3
-rw-r--r--csit/clamp/tests/data/InstantiateCL.json59
-rw-r--r--csit/clamp/tests/data/PMSHMultipleCLTosca.yaml242
-rw-r--r--csit/clamp/tests/data/PassivateCL.json9
-rw-r--r--csit/clamp/tests/data/StateChangeRunningCL.json9
-rw-r--r--csit/clamp/tests/policy-clamp-test.robot82
-rw-r--r--csit/config/clamp/ClRuntimeParameters.json56
-rw-r--r--csit/config/clamp/DcaeParticipantParameters.json65
-rw-r--r--csit/config/clamp/PolicyParticipantParameters.json49
-rwxr-xr-xcsit/config/db/db.sh2
-rw-r--r--csit/detmVers.sh4
-rw-r--r--csit/docker-compose-all.yml55
14 files changed, 711 insertions, 1 deletions
diff --git a/csit/clamp/plans/setup.sh b/csit/clamp/plans/setup.sh
new file mode 100644
index 00000000..746a16e2
--- /dev/null
+++ b/csit/clamp/plans/setup.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+# ============LICENSE_START=======================================================
+# Copyright (C) 2021 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=========================================================
+source ${SCRIPTS}/get-branch-mariadb.sh
+
+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}/detmVers.sh
+
+docker-compose -f ${SCRIPTS}/docker-compose-all.yml up -d policy-controlloop-runtime
+
+sleep 10
+unset http_proxy https_proxy
+
+POLICY_CONTROLLOOP_RUNTIME_IP=`get-instance-ip.sh policy-controlloop-runtime`
+POLICY_PARTICIPANT_IP=`get-instance-ip.sh policy-participant`
+DCAE_PARTICIPANT_IP=`get-instance-ip.sh dcae-participant`
+MARIADB_IP=`get-instance-ip.sh mariadb`
+DMAAP_IP=`get-instance-ip.sh simulator`
+POLICY_API_IP=`get-instance-ip.sh policy-api`
+
+echo MARIADB IP IS ${MARIADB_IP}
+echo DMAAP_IP IS ${DMAAP_IP}
+echo API IP IS ${POLICY_API_IP}
+echo POLICY CONTROLLOOP RUNTIME IP IS ${POLICY_CONTROLLOOP_RUNTIME_IP}
+echo POLICY PARTICIPANT IP IS ${POLICY_PARTICIPANT_IP}
+echo DCAE PARTICIPANT IP IS ${DCAE_PARTICIPANT_IP}
+
+# wait for the app to start up
+${SCRIPTS}/wait_for_port.sh ${POLICY_CONTROLLOOP_RUNTIME_IP} 6970
+${SCRIPTS}/wait_for_port.sh ${POLICY_API_IP} 6969
+
+ROBOT_VARIABLES=""
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_CONTROLLOOP_RUNTIME_IP:${POLICY_CONTROLLOOP_RUNTIME_IP}"
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PARTICIPANT_IP:${POLICY_PARTICIPANT_IP}"
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DCAE_PARTICIPANT_IP:${DCAE_PARTICIPANT_IP}"
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
diff --git a/csit/clamp/plans/teardown.sh b/csit/clamp/plans/teardown.sh
new file mode 100644
index 00000000..e0fc58ed
--- /dev/null
+++ b/csit/clamp/plans/teardown.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+# ============LICENSE_START=======================================================
+# Copyright (C) 2021 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}/docker-compose-all.yml down -v
diff --git a/csit/clamp/plans/testplan.txt b/csit/clamp/plans/testplan.txt
new file mode 100644
index 00000000..3c4f4bc2
--- /dev/null
+++ b/csit/clamp/plans/testplan.txt
@@ -0,0 +1,3 @@
+# Test suites are relative paths under [policy/docker.git]/csit/[project]/tests.
+# Place the suites in run order.
+policy-clamp-test.robot
diff --git a/csit/clamp/tests/data/InstantiateCL.json b/csit/clamp/tests/data/InstantiateCL.json
new file mode 100644
index 00000000..d7402031
--- /dev/null
+++ b/csit/clamp/tests/data/InstantiateCL.json
@@ -0,0 +1,59 @@
+{
+ "controlLoopList": [
+ {
+ "name": "PMSHInstance0",
+ "version": "1.0.1",
+ "definition": {
+ "name": "org.onap.domain.pmsh.PMSHControlLoopDefinition",
+ "version": "1.2.3"
+ },
+ "state": "UNINITIALISED",
+ "orderedState": "UNINITIALISED",
+ "description": "PMSH control loop instance 0",
+ "elements": {
+ "709c62b3-8918-41b9-a747-d21eb79c6c20": {
+ "id": "709c62b3-8918-41b9-a747-d21eb79c6c20",
+ "definition": {
+ "name": "org.onap.domain.pmsh.PMSH_DCAEMicroservice",
+ "version": "1.2.3"
+ },
+ "participantType": {
+ "name": "org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant",
+ "version": "2.3.4"
+ },
+ "state": "UNINITIALISED",
+ "orderedState": "UNINITIALISED",
+ "description": "DCAE Control Loop Element for the PMSH instance 0 control loop"
+ },
+ "709c62b3-8918-41b9-a747-d21eb79c6c21": {
+ "id": "709c62b3-8918-41b9-a747-d21eb79c6c21",
+ "definition": {
+ "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement",
+ "version": "1.2.3"
+ },
+ "participantType": {
+ "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
+ "version": "2.3.1"
+ },
+ "state": "UNINITIALISED",
+ "orderedState": "UNINITIALISED",
+ "description": "Monitoring Policy Control Loop Element for the PMSH instance 0 control loop"
+ },
+ "709c62b3-8918-41b9-a747-d21eb79c6c22": {
+ "id": "709c62b3-8918-41b9-a747-d21eb79c6c22",
+ "definition": {
+ "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement",
+ "version": "1.2.3"
+ },
+ "participantType": {
+ "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
+ "version": "2.3.1"
+ },
+ "state": "UNINITIALISED",
+ "orderedState": "UNINITIALISED",
+ "description": "Operational Policy Control Loop Element for the PMSH instance 0 control loop"
+ }
+ }
+ }
+ ]
+}
diff --git a/csit/clamp/tests/data/PMSHMultipleCLTosca.yaml b/csit/clamp/tests/data/PMSHMultipleCLTosca.yaml
new file mode 100644
index 00000000..b0b35158
--- /dev/null
+++ b/csit/clamp/tests/data/PMSHMultipleCLTosca.yaml
@@ -0,0 +1,242 @@
+tosca_definitions_version: tosca_simple_yaml_1_3
+data_types:
+ onap.datatypes.ToscaConceptIdentifier:
+ derived_from: tosca.datatypes.Root
+ properties:
+ name:
+ type: string
+ required: true
+ version:
+ type: string
+ required: true
+node_types:
+ org.onap.policy.clamp.controlloop.Participant:
+ version: 1.0.1
+ derived_from: tosca.nodetypes.Root
+ properties:
+ provider:
+ type: string
+ requred: false
+ org.onap.policy.clamp.controlloop.ControlLoopElement:
+ version: 1.0.1
+ derived_from: tosca.nodetypes.Root
+ properties:
+ provider:
+ type: string
+ requred: false
+ participant_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: true
+ org.onap.policy.clamp.controlloop.ControlLoop:
+ version: 1.0.1
+ derived_from: tosca.nodetypes.Root
+ properties:
+ provider:
+ type: string
+ requred: false
+ elements:
+ type: list
+ required: true
+ entry_schema:
+ type: onap.datatypes.ToscaConceptIdentifier
+ org.onap.policy.clamp.controlloop.DCAEMicroserviceControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
+ properties:
+ dcae_blueprint_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: true
+ org.onap.policy.clamp.controlloop.PolicyTypeControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
+ properties:
+ policy_type_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: true
+ org.onap.policy.clamp.controlloop.CDSControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
+ properties:
+ cds_blueprint_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: true
+topology_template:
+ node_templates:
+ org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant:
+ version: 2.3.4
+ type: org.onap.policy.clamp.controlloop.Participant
+ type_version: 1.0.1
+ description: Participant for DCAE microservices
+ properties:
+ provider: ONAP
+ org.onap.policy.controlloop.PolicyControlLoopParticipant:
+ version: 2.2.1
+ type: org.onap.policy.clamp.controlloop.Participant
+ type_version: 1.0.1
+ description: Participant for DCAE microservices
+ properties:
+ provider: ONAP
+ org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant:
+ version: 2.2.1
+ type: org.onap.policy.clamp.controlloop.Participant
+ type_version: 1.0.1
+ description: Participant for DCAE microservices
+ properties:
+ provider: ONAP
+ org.onap.domain.pmsh.PMSH_DCAEMicroservice:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.DCAEMicroserviceControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the DCAE microservice for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participant_id:
+ name: org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant
+ version: 2.3.4
+ dcae_blueprint_id:
+ name: org.onap.dcae.blueprints.PMSHBlueprint
+ version: 1.0.0
+ org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.PolicyTypeControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the monitoring policy for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participant_id:
+ name: org.onap.policy.controlloop.PolicyControlLoopParticipant
+ version: 2.2.1
+ policy_type_id:
+ name: onap.policies.monitoring.pm-subscription-handler
+ version: 1.0.0
+ org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.PolicyTypeControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the operational policy for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participant_id:
+ name: org.onap.policy.controlloop.PolicyControlLoopParticipant
+ version: 2.2.1
+ policy_type_id:
+ name: onap.policies.operational.pm-subscription-handler
+ version: 1.0.0
+ org.onap.domain.pmsh.PMSH_CDS_ControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.ControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for CDS for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participant_Id:
+ name: org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant
+ version: 3.2.1
+ cds_blueprint_id:
+ name: org.onap.ccsdk.cds.PMSHCdsBlueprint
+ version: 1.0.0
+ org.onap.domain.pmsh.PMSHControlLoopDefinition:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.ControlLoop
+ type_version: 1.0.0
+ description: Control loop for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ elements:
+ - name: org.onap.domain.pmsh.PMSH_DCAEMicroservice
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.PMSH_CDS_ControlLoopElement
+ version: 1.2.3
+ org.onap.domain.pmsh.PMSD_DCAEMicroservice:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.DCAEMicroserviceControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the DCAE microservice for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participant_id:
+ name: org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant
+ version: 2.3.4
+ dcae_blueprint_id:
+ name: org.onap.dcae.blueprints.PMSDBlueprint
+ version: 1.0.0
+ org.onap.domain.pmsh.PMSD_MonitoringPolicyControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.PolicyTypeControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the monitoring policy for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participant_id:
+ name: org.onap.policy.controlloop.PolicyControlLoopParticipant
+ version: 2.2.1
+ policy_type_id:
+ name: onap.policies.monitoring.pm-subscription-handler
+ version: 1.0.0
+ org.onap.domain.pmsh.PMSD_OperationalPolicyControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.PolicyTypeControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the operational policy for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participant_id:
+ name: org.onap.policy.controlloop.PolicyControlLoopParticipant
+ version: 2.2.1
+ policy_type_id:
+ name: onap.policies.operational.pm-subscription-handler
+ version: 1.0.0
+ org.onap.domain.pmsh.PMSD_CDS_ControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.ControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for CDS for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participant_Id:
+ name: org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant
+ version: 3.2.1
+ cds_blueprint_id:
+ name: org.onap.ccsdk.cds.PMSDCdsBlueprint
+ version: 1.0.0
+ org.onap.domain.pmsh.PMSDControlLoopDefinition:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.ControlLoop
+ type_version: 1.0.0
+ description: Control loop for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ elements:
+ - name: org.onap.domain.pmsh.PMSD_DCAEMicroservice
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.PMSD_MonitoringPolicyControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.PMSD_OperationalPolicyControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.PMSD_CDS_ControlLoopElement
+ version: 1.2.3
+policies:
+ - TestCheckPolicy:
+ type: onap.policies.DemoCheckPolicyType
+ type_version: 1.0.0
+ name: TestCheckPolicy
+ version: 1.0.0
+ metadata:
+ policy-id: TestCheckPolicy
+ policy-version: 1.0.0
+ properties:
+ pmsh_policy:
+ fileBasedGP: 15
+ fileLocation: /pm/pm.xml
+ subscriptionName: subscriptiona
+ administrativeState: UNLOCKED
+policy_types:
+ onap.policies.DemoCheckPolicyType:
+ derived_from: tosca.policies.Root
+ description: a base policy type for all policies that govern monitoring provisioning
+ version: 1.0.0
+ name: onap.policies.DemoCheckPolicyType
diff --git a/csit/clamp/tests/data/PassivateCL.json b/csit/clamp/tests/data/PassivateCL.json
new file mode 100644
index 00000000..472d5f4e
--- /dev/null
+++ b/csit/clamp/tests/data/PassivateCL.json
@@ -0,0 +1,9 @@
+{
+ "orderedState": "PASSIVE",
+ "controlLoopIdentifierList": [
+ {
+ "name": "PMSHInstance0",
+ "version": "1.0.1"
+ }
+ ]
+}
diff --git a/csit/clamp/tests/data/StateChangeRunningCL.json b/csit/clamp/tests/data/StateChangeRunningCL.json
new file mode 100644
index 00000000..bbba0b16
--- /dev/null
+++ b/csit/clamp/tests/data/StateChangeRunningCL.json
@@ -0,0 +1,9 @@
+{
+ "orderedState": "RUNNING",
+ "controlLoopIdentifierList": [
+ {
+ "name": "PMSHInstance0",
+ "version": "1.0.1"
+ }
+ ]
+}
diff --git a/csit/clamp/tests/policy-clamp-test.robot b/csit/clamp/tests/policy-clamp-test.robot
new file mode 100644
index 00000000..c9ad34af
--- /dev/null
+++ b/csit/clamp/tests/policy-clamp-test.robot
@@ -0,0 +1,82 @@
+*** Settings ***
+Library Collections
+Library RequestsLibrary
+Library OperatingSystem
+Library json
+
+*** Test Cases ***
+
+CommissionControlLoopV1
+ [Documentation] Commission control loop.
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session http://${POLICY_CONTROLLOOP_RUNTIME_IP}:6970
+ ${postyaml}= Get file ${CURDIR}/data/PMSHMultipleCLTosca.yaml
+ ${session}= Create Session policy http://${POLICY_CONTROLLOOP_RUNTIME_IP}:6970 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml
+ ${resp}= POST On Session policy /onap/controlloop/v2/commission data=${postyaml} headers=${headers}
+ Log Received response from controlloop runtime ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+InstantiateControlLoopV1
+ [Documentation] Instantiate control loop.
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session http://${POLICY_CONTROLLOOP_RUNTIME_IP}:6970
+ ${postjson}= Get file ${CURDIR}/data/InstantiateCL.json
+ ${session}= Create Session policy http://${POLICY_CONTROLLOOP_RUNTIME_IP}:6970 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= POST On Session policy /onap/controlloop/v2/instantiation data=${postjson} headers=${headers}
+ Log Received response from controlloop runtime ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+PassivateControlLoop
+ [Documentation] Passivate control loop.
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session http://${POLICY_CONTROLLOOP_RUNTIME_IP}:6970
+ ${postjson}= Get file ${CURDIR}/data/PassivateCL.json
+ ${session}= Create Session policy http://${POLICY_CONTROLLOOP_RUNTIME_IP}:6970 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= PUT On Session policy /onap/controlloop/v2/instantiation/command data=${postjson} headers=${headers}
+ Log Received response from controlloop runtime ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 202
+
+QueryPolicies
+ [Documentation] Runs Policy Participant Query New Policies
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session https://${POLICY_API_IP}:6969
+ ${session}= Create Session policy https://${POLICY_API_IP}:6969 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}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+QueryPolicyTypes
+ [Documentation] Runs Policy Participant Query New Policy Types
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session https://${POLICY_API_IP}:6969
+ ${session}= Create Session policy https://${POLICY_API_IP}:6969 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}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+StateChangeRunningControlLoop
+ [Documentation] ControlLoop State Change to RUNNING.
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session http://${POLICY_CONTROLLOOP_RUNTIME_IP}:6970
+ ${postjson}= Get file ${CURDIR}/data/StateChangeRunningCL.json
+ ${session}= Create Session policy http://${POLICY_CONTROLLOOP_RUNTIME_IP}:6970 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= PUT On Session policy /onap/controlloop/v2/instantiation/command data=${postjson} headers=${headers} expected_status=406
+ Log Received response from controlloop runtime ${resp.text}
+
+QueryInstantiatedCLs
+ [Documentation] Get Instantiated ControlLoops
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session http://${POLICY_CONTROLLOOP_RUNTIME_IP}:6970
+ ${session}= Create Session policy http://${POLICY_CONTROLLOOP_RUNTIME_IP}:6970 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= GET On Session policy /onap/controlloop/v2/instantiation headers=${headers}
+ Log Received response from controlloop runtime ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Be Equal As Strings ${resp.json()['controlLoopList'][0]['state']} UNINITIALISED2PASSIVE
+ Should Be Equal As Strings ${resp.json()['controlLoopList'][0]['orderedState']} RUNNING
diff --git a/csit/config/clamp/ClRuntimeParameters.json b/csit/config/clamp/ClRuntimeParameters.json
new file mode 100644
index 00000000..f73899fb
--- /dev/null
+++ b/csit/config/clamp/ClRuntimeParameters.json
@@ -0,0 +1,56 @@
+{
+ "name": "ControlLoopRuntimeGroup",
+ "restServerParameters": {
+ "host": "0.0.0.0",
+ "port": 6970,
+ "userName": "healthcheck",
+ "password": "zb!XztG34",
+ "https": false,
+ "aaf": false
+ },
+ "participantParameters": {
+ "heartBeatMs": 120000,
+ "updateParameters": {
+ "maxRetryCount": 1,
+ "maxWaitMs": 30000
+ },
+ "stateChangeParameters": {
+ "maxRetryCount": 1,
+ "maxWaitMs": 30000
+ }
+ },
+ "databaseProviderParameters": {
+ "name": "PolicyProviderParameterGroup",
+ "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
+ "databaseDriver": "org.mariadb.jdbc.Driver",
+ "databaseUrl": "jdbc:mariadb://mariadb:3306/controlloop",
+ "databaseUser": "policy_user",
+ "databasePassword": "policy_user",
+ "persistenceUnit": "CommissioningMariaDb"
+ },
+ "topicParameterGroup": {
+ "topicSources": [
+ {
+ "topic": "POLICY-CLRUNTIME-PARTICIPANT",
+ "servers" : [ "message-router" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps" : true,
+ "fetchTimeout": 15000
+ }
+ ],
+ "topicSinks": [
+ {
+ "topic": "POLICY-CLRUNTIME-PARTICIPANT",
+ "servers" : [ "message-router" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps" : true
+ },
+ {
+ "topic": "POLICY-NOTIFICATION",
+ "servers" : [ "message-router" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps" : true
+ }
+ ]
+ }
+}
diff --git a/csit/config/clamp/DcaeParticipantParameters.json b/csit/config/clamp/DcaeParticipantParameters.json
new file mode 100644
index 00000000..e0f1ba9a
--- /dev/null
+++ b/csit/config/clamp/DcaeParticipantParameters.json
@@ -0,0 +1,65 @@
+{
+ "name": "ControlLoopParticipantDcae",
+ "clampClientParameters": {
+ "clientName": "Clamp",
+ "hostname": "0.0.0.0",
+ "port": 8443,
+ "userName": "admin",
+ "password": "password",
+ "useHttps": true
+ },
+ "consulClientParameters": {
+ "clientName": "Consul",
+ "hostname": "consul",
+ "port": 31321,
+ "userName": "admin",
+ "password": "password",
+ "useHttps": false
+ },
+ "intermediaryParameters": {
+ "name": "Participant parameters",
+ "reportingTimeInterval": 120000,
+ "description": "Participant Description",
+ "participantId": {
+ "name": "DCAEParticipant0",
+ "version": "1.0.0"
+ },
+ "participantType": {
+ "name": "org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant",
+ "version": "2.3.4"
+ },
+ "clampControlLoopTopics": {
+ "topicSources": [
+ {
+ "topic": "POLICY-CLRUNTIME-PARTICIPANT",
+ "servers" : [ "message-router" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps" : true
+ }
+ ],
+ "topicSinks": [
+ {
+ "topic": "POLICY-CLRUNTIME-PARTICIPANT",
+ "servers" : [ "message-router" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps" : true
+ },
+ {
+ "topic": "POLICY-NOTIFICATION",
+ "servers" : [ "message-router" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps" : true
+ }
+ ]
+ }
+ },
+ "databaseProviderParameters": {
+ "name": "PolicyProviderParameterGroup",
+ "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
+ "databaseDriver": "org.mariadb.jdbc.Driver",
+ "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin",
+ "databaseUser": "policy_user",
+ "databasePassword": "policy_user",
+ "persistenceUnit": "PolicyMariaDb"
+ }
+}
diff --git a/csit/config/clamp/PolicyParticipantParameters.json b/csit/config/clamp/PolicyParticipantParameters.json
new file mode 100644
index 00000000..242df20d
--- /dev/null
+++ b/csit/config/clamp/PolicyParticipantParameters.json
@@ -0,0 +1,49 @@
+{
+ "name": "ControlLoopParticipantGroup",
+ "intermediaryParameters": {
+ "name": "Participant parameters",
+ "reportingTimeInterval": 120000,
+ "description": "Participant Description",
+ "participantType":{
+ "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
+ "version":"2.2.1"
+ },
+ "participantId": {
+ "name": "org.onap.PM_Policy",
+ "version": "1.0.0"
+ },
+ "clampControlLoopTopics": {
+ "topicSources": [
+ {
+ "topic": "POLICY-CLRUNTIME-PARTICIPANT",
+ "servers" : [ "message-router" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps" : true,
+ "fetchTimeout": 15000
+ }
+ ],
+ "topicSinks": [
+ {
+ "topic": "POLICY-CLRUNTIME-PARTICIPANT",
+ "servers" : [ "message-router" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps" : true
+ },
+ {
+ "topic": "POLICY-NOTIFICATION",
+ "servers" : [ "message-router" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps" : true
+ }
+ ]
+ }
+ },
+ "policyApiParameters": {
+ "clientName": "api",
+ "hostname": "policy-api",
+ "port": "6969",
+ "userName": "healthcheck",
+ "password": "zb!XztG34",
+ "https": true
+ }
+}
diff --git a/csit/config/db/db.sh b/csit/config/db/db.sh
index a5c81296..e6cd5617 100755
--- a/csit/config/db/db.sh
+++ b/csit/config/db/db.sh
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-for db in support onap_sdk log migration operationshistory10 pooling policyadmin operationshistory
+for db in support onap_sdk log migration operationshistory10 pooling policyadmin operationshistory controlloop
do
mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};"
mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;"
diff --git a/csit/detmVers.sh b/csit/detmVers.sh
index 56e516c7..a20cdf63 100644
--- a/csit/detmVers.sh
+++ b/csit/detmVers.sh
@@ -60,3 +60,7 @@ echo POLICY_APEX_PDP_VERSION=${POLICY_APEX_PDP_VERSION}
POLICY_DISTRIBUTION_VERSION=$(getVersion distribution)
export POLICY_DISTRIBUTION_VERSION=${POLICY_DISTRIBUTION_VERSION:0:3}-SNAPSHOT-latest
echo POLICY_DISTRIBUTION_VERSION=${POLICY_DISTRIBUTION_VERSION}
+
+POLICY_CLAMP_VERSION=$(getVersion clamp)
+export POLICY_CLAMP_VERSION=${POLICY_CLAMP_VERSION:0:5}-SNAPSHOT-latest
+echo POLICY_CLAMP_VERSION=${POLICY_CLAMP_VERSION}
diff --git a/csit/docker-compose-all.yml b/csit/docker-compose-all.yml
index c2a1d633..5d0f687d 100644
--- a/csit/docker-compose-all.yml
+++ b/csit/docker-compose-all.yml
@@ -211,3 +211,58 @@ services:
'pap', '6969',
'apex-pdp', '6969'
]
+ policy-controlloop-runtime:
+ image: onap/policy-controlloop-runtime:latest
+ container_name: policy-controlloop-runtime
+ depends_on:
+ - mariadb
+ - simulator
+ - policy-participant
+ - dcae-participant
+ hostname: policy-controlloop-runtime
+ expose:
+ - 6970
+ volumes:
+ - ./config/clamp/ClRuntimeParameters.json:/opt/app/policy/clamp/etc/ClRuntimeParameters.json:ro
+ - ./config/policy-truststore:/opt/app/policy/api/etc/ssl/policy-truststore: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', './controlloop-runtime.sh',
+ 'message-router', '3905'
+ ]
+ dcae-participant:
+ image: onap/dcae-participant:latest
+ container_name: dcae-participant
+ depends_on:
+ - simulator
+ hostname: dcae-participant
+ expose:
+ - 6971
+ volumes:
+ - ./config/clamp/DcaeParticipantParameters.json:/opt/app/policy/clamp/etc/DcaeParticipantParameters.json:ro
+ - ./config/policy-truststore:/opt/app/policy/api/etc/ssl/policy-truststore: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', './dcae-participant.sh',
+ 'message-router', '3905'
+ ]
+ policy-participant:
+ image: onap/policy-participant:latest
+ container_name: policy-participant
+ depends_on:
+ - simulator
+ - api
+ hostname: policy-participant
+ expose:
+ - 6972
+ volumes:
+ - ./config/clamp/PolicyParticipantParameters.json:/opt/app/policy/clamp/etc/PolicyParticipantParameters.json:ro
+ - ./config/policy-truststore:/opt/app/policy/api/etc/ssl/policy-truststore: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', './policy-participant.sh',
+ 'message-router', '3905'
+ ]