aboutsummaryrefslogtreecommitdiffstats
path: root/tests/policy/xacml-pdp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/policy/xacml-pdp')
-rw-r--r--tests/policy/xacml-pdp/data/onap.policy.guard.decision.request.json16
-rw-r--r--tests/policy/xacml-pdp/data/onap.policy.monitoring.decision.request.json9
-rw-r--r--tests/policy/xacml-pdp/data/onap.policy.naming.decision.request.json13
-rw-r--r--tests/policy/xacml-pdp/data/onap.policy.optimization.decision.request.json15
-rw-r--r--tests/policy/xacml-pdp/data/vCPE.policy.input.tosca.deploy.json5
-rw-r--r--tests/policy/xacml-pdp/xacml-pdp-test.robot217
6 files changed, 0 insertions, 275 deletions
diff --git a/tests/policy/xacml-pdp/data/onap.policy.guard.decision.request.json b/tests/policy/xacml-pdp/data/onap.policy.guard.decision.request.json
deleted file mode 100644
index ee90feaa..00000000
--- a/tests/policy/xacml-pdp/data/onap.policy.guard.decision.request.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "ONAPName": "Guard",
- "ONAPComponent": "Guard-component",
- "ONAPInstance": "Guard-component-instance",
- "requestId": "unique-request-guard-1",
- "action": "guard",
- "resource": {
- "guard": {
- "actor": "APPC",
- "operation": "ModifyConfig",
- "target": "f17face5-69cb-4c88-9e0b-7426db7edddd",
- "requestId": "c7c6a4aa-bb61-4a15-b831-ba1472dd4a65",
- "clname": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a"
- }
- }
-}
diff --git a/tests/policy/xacml-pdp/data/onap.policy.monitoring.decision.request.json b/tests/policy/xacml-pdp/data/onap.policy.monitoring.decision.request.json
deleted file mode 100644
index f79f4eb6..00000000
--- a/tests/policy/xacml-pdp/data/onap.policy.monitoring.decision.request.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "ONAPName": "DCAE",
- "ONAPComponent": "PolicyHandler",
- "ONAPInstance": "622431a4-9dea-4eae-b443-3b2164639c64",
- "action": "configure",
- "resource": {
- "policy-id": "onap.restart.tca"
- }
-} \ No newline at end of file
diff --git a/tests/policy/xacml-pdp/data/onap.policy.naming.decision.request.json b/tests/policy/xacml-pdp/data/onap.policy.naming.decision.request.json
deleted file mode 100644
index 3833a241..00000000
--- a/tests/policy/xacml-pdp/data/onap.policy.naming.decision.request.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "ONAPName": "SDNC",
- "ONAPComponent": "SDNC-component",
- "ONAPInstance": "SDNC-component-instance",
- "requestId": "unique-request-sdnc-1",
- "action": "naming",
- "resource": {
- "nfRole": [],
- "naming-type": [],
- "property-name": [],
- "policy-type": ["onap.policies.Naming"]
- }
-}
diff --git a/tests/policy/xacml-pdp/data/onap.policy.optimization.decision.request.json b/tests/policy/xacml-pdp/data/onap.policy.optimization.decision.request.json
deleted file mode 100644
index d997099c..00000000
--- a/tests/policy/xacml-pdp/data/onap.policy.optimization.decision.request.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "ONAPName": "OOF",
- "ONAPComponent": "OOF-component",
- "ONAPInstance": "OOF-component-instance",
- "context" : {
- "subscriberName": []
- },
- "action": "optimize",
- "resource": {
- "scope": [],
- "services": [],
- "resources": [],
- "geography": []
- }
-}
diff --git a/tests/policy/xacml-pdp/data/vCPE.policy.input.tosca.deploy.json b/tests/policy/xacml-pdp/data/vCPE.policy.input.tosca.deploy.json
deleted file mode 100644
index 7ace047b..00000000
--- a/tests/policy/xacml-pdp/data/vCPE.policy.input.tosca.deploy.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{"policies":[
- {"policy-id":"onap.restart.tca"},
- {"policy-id":"OSDF_CASABLANCA.Affinity_Default"}
- ]
-}
diff --git a/tests/policy/xacml-pdp/xacml-pdp-test.robot b/tests/policy/xacml-pdp/xacml-pdp-test.robot
deleted file mode 100644
index 03b0ca7a..00000000
--- a/tests/policy/xacml-pdp/xacml-pdp-test.robot
+++ /dev/null
@@ -1,217 +0,0 @@
-*** Settings ***
-Library Collections
-Library RequestsLibrary
-Library OperatingSystem
-Library Process
-Library json
-
-*** Test Cases ***
-Healthcheck
- [Documentation] Runs Policy Xacml PDP Health check
- ${auth}= Create List healthcheck zb!XztG34
- Log Creating session https://${POLICY_PDPX_IP}:6969
- ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Get Request policy /policy/pdpx/v1/healthcheck 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()['code']} 200
-
-Statistics
- [Documentation] Runs Policy Xacml PDP Statistics
- ${auth}= Create List healthcheck zb!XztG34
- Log Creating session https://${POLICY_PDPX_IP}:6969
- ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Get Request policy /policy/pdpx/v1/statistics 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()['code']} 200
-
-MakeTopics
- [Documentation] Creates the Policy topics
- ${result}= Run Process ${SCR_DMAAP}/make_topic.sh POLICY-PDP-PAP
- Should Be Equal As Integers ${result.rc} 0
-
-ExecuteXacmlPolicy
- Wait Until Keyword Succeeds 0 min 15 sec CreateMonitorPolicy
- Wait Until Keyword Succeeds 0 min 15 sec CreateOptimizationPolicy
- Wait Until Keyword Succeeds 0 min 15 sec GetDefaultDecision
- Wait Until Keyword Succeeds 0 min 15 sec DeployPolicies
- Wait Until Keyword Succeeds 0 min 15 sec GetAbbreviatedDecisionResult
- Wait Until Keyword Succeeds 0 min 15 sec GetMonitoringDecision
- Wait Until Keyword Succeeds 0 min 15 sec GetNamingDecision
- Wait Until Keyword Succeeds 0 min 15 sec GetOptimizationDecision
-
-*** Keywords ***
-
-CreateMonitorPolicy
- [Documentation] Create a Monitoring policy
- ${auth}= Create List healthcheck zb!XztG34
- ${postjson}= Get file ${DATA2}/vCPE.policy.monitoring.input.tosca.json
- 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}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies data=${postjson} headers=${headers}
- Log Received response from policy4 ${resp.text}
- ${postjsonobject} To Json ${postjson}
- Should Be Equal As Strings ${resp.status_code} 200
- Dictionary Should Contain Key ${resp.json()} tosca_definitions_version
- Dictionary Should Contain Key ${postjsonobject} tosca_definitions_version
-
-CreateOptimizationPolicy
- [Documentation] Create an Optimization policy
- ${auth}= Create List healthcheck zb!XztG34
- ${postjson}= Get file ${DATA2}/vCPE.policies.optimization.input.tosca.json
- 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}= Post Request policy /policy/api/v1/policytypes/onap.policies.optimization.resource.AffinityPolicy/versions/1.0.0/policies data=${postjson} headers=${headers}
- Log Received response from policy4 ${resp.text}
- ${postjsonobject} To Json ${postjson}
- Should Be Equal As Strings ${resp.status_code} 200
- Dictionary Should Contain Key ${resp.json()} tosca_definitions_version
- Dictionary Should Contain Key ${postjsonobject} tosca_definitions_version
-
-DeployPolicies
- [Documentation] Runs Policy PAP to deploy a policy
- ${auth}= Create List healthcheck zb!XztG34
- ${postjson}= Get file ${CURDIR}/data/vCPE.policy.input.tosca.deploy.json
- 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}= Post Request policy /policy/pap/v1/pdps/policies data=${postjson} headers=${headers}
- Log Received response from policy5 ${resp.text}
- ${postjsonobject} To Json ${postjson}
- Should Be Equal As Strings ${resp.status_code} 202
- ${result}= Run Process ${SCR_DMAAP}/wait_topic.sh POLICY-PDP-PAP
- ... responseTo xacml ACTIVE onap.restart.tca
-
-GetStatisticsAfterDeployed
- [Documentation] Runs Policy Xacml PDP Statistics after policy is deployed
- ${auth}= Create List healthcheck zb!XztG34
- Log Creating session https://${POLICY_PDPX_IP}:6969
- ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Get Request policy /policy/pdpx/v1/statistics 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()['code']} 200
- Should Be Equal As Strings ${resp.json()['totalPoliciesCount'] 1
-
-GetDefaultDecision
- [Documentation] Get Default Decision with no policies in Xacml PDP
- ${auth}= Create List healthcheck zb!XztG34
- ${postjson}= Get file ${CURDIR}/data/onap.policy.guard.decision.request.json
- Log Creating session https://${POLICY_PDPX_IP}:6969
- ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${params}= Create Dictionary abbrev=true
- ${resp}= Post Request policy /policy/pdpx/v1/decision params=${params} data=${postjson} headers=${headers}
- Log Received response from policy ${resp.text}
- ${status}= Get From Dictionary ${resp.json()} status
- Should Be Equal As Strings ${resp.status_code} 200
- Should Be Equal As Strings ${status} Permit
-
-GetAbbreviatedDecisionResult
- [Documentation] Get Decision with abbreviated results from Policy Xacml PDP
- ${auth}= Create List healthcheck zb!XztG34
- ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.decision.request.json
- Log Creating session https://${POLICY_PDPX_IP}:6969
- ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${params}= Create Dictionary abbrev=true
- ${resp}= Post Request policy /policy/pdpx/v1/decision params=${params} data=${postjson} headers=${headers}
- Log Received response from policy ${resp.text}
- ${policy}= Get From Dictionary ${resp.json()['policies']} onap.restart.tca
- Should Be Equal As Strings ${resp.status_code} 200
- Dictionary Should Contain Key ${policy} type
- Dictionary Should Contain Key ${policy} metadata
- Dictionary Should Not Contain Key ${policy} type_version
- Dictionary Should Not Contain Key ${policy} properties
- Dictionary Should Not Contain Key ${policy} name
- Dictionary Should Not Contain Key ${policy} version
-
-GetMonitoringDecision
- [Documentation] Get Decision from Monitoring Policy Xacml PDP
- ${auth}= Create List healthcheck zb!XztG34
- ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.decision.request.json
- Log Creating session https://${POLICY_PDPX_IP}:6969
- ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Post Request policy /policy/pdpx/v1/decision data=${postjson} headers=${headers}
- Log Received response from policy ${resp.text}
- ${policy}= Get From Dictionary ${resp.json()['policies']} onap.restart.tca
- Should Be Equal As Strings ${resp.status_code} 200
- Dictionary Should Contain Key ${policy} type
- Dictionary Should Contain Key ${policy} metadata
- Dictionary Should Contain Key ${policy} type_version
- Dictionary Should Contain Key ${policy} properties
- Dictionary Should Contain Key ${policy} name
- Dictionary Should Contain Key ${policy} version
-
-GetNamingDecision
- [Documentation] Get Decision from Naming Policy Xacml PDP
- ${auth}= Create List healthcheck zb!XztG34
- ${postjson}= Get file ${CURDIR}/data/onap.policy.naming.decision.request.json
- Log Creating session https://${POLICY_PDPX_IP}:6969
- ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Post Request policy /policy/pdpx/v1/decision data=${postjson} headers=${headers}
- Log Received response from policy ${resp.text}
- ${policy}= Get From Dictionary ${resp.json()['policies']} SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP
- Should Be Equal As Strings ${resp.status_code} 200
- Dictionary Should Contain Key ${policy} type
- Dictionary Should Contain Key ${policy} type_version
- Dictionary Should Contain Key ${policy} properties
- Dictionary Should Contain Key ${policy} name
-
-GetOptimizationDecision
- [Documentation] Get Decision from Optimization Policy Xacml PDP
- ${auth}= Create List healthcheck zb!XztG34
- ${postjson}= Get file ${CURDIR}/data/onap.policy.optimization.decision.request.json
- Log Creating session https://${POLICY_PDPX_IP}:6969
- ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Post Request policy /policy/pdpx/v1/decision data=${postjson} headers=${headers}
- Log Received response from policy ${resp.text}
- ${policy}= Get From Dictionary ${resp.json()['policies']} OSDF_CASABLANCA.Affinity_Default
- Should Be Equal As Strings ${resp.status_code} 200
- Dictionary Should Contain Key ${policy} type
- Dictionary Should Contain Key ${policy} type_version
- Dictionary Should Contain Key ${policy} properties
- Dictionary Should Contain Key ${policy} name
-
-GetStatisticsAfterDecision
- [Documentation] Runs Policy Xacml PDP Statistics after Decision request
- ${auth}= Create List healthcheck zb!XztG34
- Log Creating session https://${POLICY_PDPX_IP}:6969
- ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Get Request policy /policy/pdpx/v1/statistics 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()['code']} 200
- Should Be Equal As Strings ${resp.json()['totalDecisionsCount'] 1
-
-UndeployMonitorPolicy
- [Documentation] Runs Policy PAP to undeploy a policy
- ${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} 202
-
-GetStatisticsAfterUndeploy
- [Documentation] Runs Policy Xacml PDP Statistics after policy is undeployed
- ${auth}= Create List healthcheck zb!XztG34
- Log Creating session https://${POLICY_PDPX_IP}:6969
- ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Get Request policy /policy/pdpx/v1/statistics 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()['code']} 200
- Should Be Equal As Strings ${resp.json()['totalPoliciesCount'] 0