aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-04-15 08:43:54 -0400
committerJim Hahn <jrh3@att.com>2020-04-15 17:12:53 -0400
commitf340ddbd8422bf51dd537b851ebda62d25b1826f (patch)
tree30bf3be7a8032caee114234d08aba199ea08b008 /tests
parent426ddc1c61efc12b95aa1013d9137411a4e46d5e (diff)
End-to-end policy CSIT
Modified the CSIT for drools-apps to use more components: - api to create policies - pap to deploy policies Also removed tabs. Issue-ID: POLICY-2491 Change-Id: Iacd8d1953068bb718a63de8813dd1c307c21b1f8 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/policy/drools-applications/drools-applications-test.robot100
1 files changed, 94 insertions, 6 deletions
diff --git a/tests/policy/drools-applications/drools-applications-test.robot b/tests/policy/drools-applications/drools-applications-test.robot
index c5c8a797..2104566a 100644
--- a/tests/policy/drools-applications/drools-applications-test.robot
+++ b/tests/policy/drools-applications/drools-applications-test.robot
@@ -47,19 +47,107 @@ MakeTopics
${result}= Run Process ${SCR2}/make_topic.sh POLICY-CL-MGT
Should Be Equal As Integers ${result.rc} 0
-PolicyActivate
- [Documentation] Activates the Policies
- ${result}= Run Process ${SCR2}/manage.sh ${SCR2}/policies.json
- Should Be Equal As Integers ${result.rc} 0
- ${result}= Run Process ${SCR2}/manage.sh ${SCR2}/activate.drools.json
+CreateVcpeXacmlPolicy
+ [Documentation] Create VCPE Policy for Xacml
+ ${auth}= Create List healthcheck zb!XztG34
+ ${postyaml}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.yaml
+ Log Creating session https://${API_IP}:6969
+ ${session}= Create Session policy https://${API_IP}:6969 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml
+ ${resp}= Post Request policy /policy/api/v1/policies data=${postyaml} headers=${headers}
+ Log Received response from api ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+CreateVcpeDroolsPolicy
+ [Documentation] Create VCPE Policy for Drools
+ ${auth}= Create List healthcheck zb!XztG34
+ ${postyaml}= Get file ${DATA}/vCPE.policy.operational.input.tosca.yaml
+ Log Creating session https://${API_IP}:6969
+ ${session}= Create Session policy https://${API_IP}:6969 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml
+ ${resp}= Post Request policy /policy/api/v1/policies data=${postyaml} headers=${headers}
+ Log Received response from api ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+CreateVdnsXacmlPolicy
+ [Documentation] Create VDNS Policy for Xacml
+ ${auth}= Create List healthcheck zb!XztG34
+ ${postyaml}= Get file ${DATA}/vDNS.policy.monitoring.input.tosca.yaml
+ Log Creating session https://${API_IP}:6969
+ ${session}= Create Session policy https://${API_IP}:6969 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml
+ ${resp}= Post Request policy /policy/api/v1/policies data=${postyaml} headers=${headers}
+ Log Received response from api ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+CreateVdnsDroolsPolicy
+ [Documentation] Create VDNS Policy for Drools
+ ${auth}= Create List healthcheck zb!XztG34
+ ${postjson}= Get file ${DATA}/vDNS.policy.operational.input.tosca.json
+ Log Creating session https://${API_IP}:6969
+ ${session}= Create Session policy https://${API_IP}:6969 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Post Request policy /policy/api/v1/policies data=${postjson} headers=${headers}
+ Log Received response from api ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+CreateVfwXacmlPolicy
+ [Documentation] Create VFW Policy for Xacml
+ ${auth}= Create List healthcheck zb!XztG34
+ ${postyaml}= Get file ${DATA}/vFirewall.policy.monitoring.input.tosca.yaml
+ Log Creating session https://${API_IP}:6969
+ ${session}= Create Session policy https://${API_IP}:6969 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml
+ ${resp}= Post Request policy /policy/api/v1/policies data=${postyaml} headers=${headers}
+ Log Received response from api ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+CreateVfwDroolsPolicy
+ [Documentation] Create VFW Policy for Drools
+ ${auth}= Create List healthcheck zb!XztG34
+ ${postjson}= Get file ${DATA}/vFirewall.policy.operational.input.tosca.json
+ Log Creating session https://${API_IP}:6969
+ ${session}= Create Session policy https://${API_IP}:6969 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Post Request policy /policy/api/v1/policies data=${postjson} headers=${headers}
+ Log Received response from api ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+DeployXacmlPolicies
+ [Documentation] Deploys the Policies to Xacml
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session https://${PAP_IP}:6969
+ ${postjson}= Get file ${SCR2}/deploy.xacml.policies.json
+ ${session}= Create Session policy https://${PAP_IP}:6969 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Post Request policy /policy/pap/v1/pdps/deployments/batch data=${postjson} headers=${headers}
+ Log Received response from pap ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+ ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-PDP-PAP
+ ... responseTo xacml ACTIVE
+ Log Received status ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
+ Should Contain ${result.stdout} onap.restart.tca
+ Should Contain ${result.stdout} onap.scaleout.tca
+ Should Contain ${result.stdout} onap.vfirewall.tca
+
+DeployDroolsPolicies
+ [Documentation] Deploys the Policies to Drools
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session https://${PAP_IP}:6969
+ ${postjson}= Get file ${SCR2}/deploy.drools.policies.json
+ ${session}= Create Session policy https://${PAP_IP}:6969 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Post Request policy /policy/pap/v1/pdps/deployments/batch data=${postjson} headers=${headers}
+ Log Received response from pap ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
${result}= Run Process ${SCR2}/wait_topic.sh POLICY-PDP-PAP
... responseTo drools ACTIVE
Log Received status ${result.stdout}
Sleep 3s
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} operational.restart
- Should Contain ${result.stdout} operational.scale.up
+ Should Contain ${result.stdout} operational.scaleout
Should Contain ${result.stdout} operational.modifyconfig
VcpeExecute