summaryrefslogtreecommitdiffstats
path: root/csit/clamp/tests
diff options
context:
space:
mode:
Diffstat (limited to 'csit/clamp/tests')
-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
5 files changed, 401 insertions, 0 deletions
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