aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Rose <dr695h@att.com>2019-12-11 14:47:37 +0000
committerGerrit Code Review <gerrit@onap.org>2019-12-11 14:47:37 +0000
commitf88e6d68f5a78f40d6f1c680d29f493d5e88fdfc (patch)
tree7f195bddc550b2e5cb136298036b03695239b657
parent43296a0bbe7b1b3fec1c638fc534749de073709d (diff)
parent25721ec832121ddb27f00e76f2673ac1089f3e20 (diff)
Merge "Update CSITs for policy delta API"
-rw-r--r--tests/policy/apex-pdp/apex-pdp-test.robot2
-rw-r--r--tests/policy/apex-pdp/data/pdp_update.json102
-rw-r--r--tests/policy/pap/data/create.group.request.json7
-rw-r--r--tests/policy/pap/data/deploy.group.request.json19
-rw-r--r--tests/policy/pap/pap-test.robot13
5 files changed, 36 insertions, 107 deletions
diff --git a/tests/policy/apex-pdp/apex-pdp-test.robot b/tests/policy/apex-pdp/apex-pdp-test.robot
index dcdf2d80..9956731d 100644
--- a/tests/policy/apex-pdp/apex-pdp-test.robot
+++ b/tests/policy/apex-pdp/apex-pdp-test.robot
@@ -60,7 +60,7 @@ DeployOperationalPolicy
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 data=${postjson} headers=${headers}
+ ${resp}= Post Request policy /policy/pap/v1/pdps/deployments/batch data=${postjson} headers=${headers}
Log Received response from policy5 ${resp.text}
${postjsonobject} To Json ${postjson}
Should Be Equal As Strings ${resp.status_code} 200
diff --git a/tests/policy/apex-pdp/data/pdp_update.json b/tests/policy/apex-pdp/data/pdp_update.json
index ee485998..e880d5ed 100644
--- a/tests/policy/apex-pdp/data/pdp_update.json
+++ b/tests/policy/apex-pdp/data/pdp_update.json
@@ -2,110 +2,14 @@
"groups": [
{
"name": "defaultGroup",
- "description": "The default group that registers all supported policy types and pdps.",
- "pdpGroupState": "ACTIVE",
- "properties": {},
- "pdpSubgroups": [
+ "deploymentSubgroups": [
{
"pdpType": "apex",
- "supportedPolicyTypes": [
- {
- "name": "onap.policies.controlloop.operational.Apex",
- "version": "1.0.0"
- }
- ],
+ "action": "POST",
"policies": [{
"name": "onap.policies.controlloop.Operational.apex.sampledomain",
"version": "1.0.0"
- }],
- "currentInstanceCount": 1,
- "desiredInstanceCount": 1,
- "properties": {},
- "pdpInstances": []
- },
- {
- "pdpType": "drools",
- "supportedPolicyTypes": [
- {
- "name": "onap.policies.controlloop.Operational",
- "version": "1.0.0"
- }
- ],
- "policies": [],
- "currentInstanceCount": 0,
- "desiredInstanceCount": 1,
- "properties": {},
- "pdpInstances": []
- },
- {
- "pdpType": "xacml",
- "supportedPolicyTypes": [
- {
- "name": "onap.policies.controlloop.guard.FrequencyLimiter",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.controlloop.guard.MinMax",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.controlloop.guard.Blacklist",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.controlloop.guard.coordination.FirstBlocksSecond",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.monitoring.cdap.tca.hi.lo.app",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.optimization.AffinityPolicy",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.optimization.DistancePolicy",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.optimization.HpaPolicy",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.optimization.OptimizationPolicy",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.optimization.PciPolicy",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.optimization.QueryPolicy",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.optimization.SubscriberPolicy",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.optimization.Vim_fit",
- "version": "1.0.0"
- },
- {
- "name": "onap.policies.optimization.VnfPolicy",
- "version": "1.0.0"
- }
- ],
- "policies": [],
- "currentInstanceCount": 0,
- "desiredInstanceCount": 1,
- "properties": {},
- "pdpInstances": []
+ }]
}
]
}
diff --git a/tests/policy/pap/data/create.group.request.json b/tests/policy/pap/data/create.group.request.json
index b0937f7f..ea04c0e5 100644
--- a/tests/policy/pap/data/create.group.request.json
+++ b/tests/policy/pap/data/create.group.request.json
@@ -17,12 +17,7 @@
"version": "1.0.0"
}
],
- "policies": [
- {
- "name": "onap.restart.tca",
- "version": "1.0.0"
- }
- ]
+ "policies": []
},
{
"pdpType": "pdpTypeB",
diff --git a/tests/policy/pap/data/deploy.group.request.json b/tests/policy/pap/data/deploy.group.request.json
new file mode 100644
index 00000000..7f3694de
--- /dev/null
+++ b/tests/policy/pap/data/deploy.group.request.json
@@ -0,0 +1,19 @@
+{
+ "groups": [
+ {
+ "name": "create.group.request",
+ "deploymentSubgroups": [
+ {
+ "pdpType": "pdpTypeA",
+ "action": "POST",
+ "policies": [
+ {
+ "name": "onap.restart.tca",
+ "version": "1.0.0"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/tests/policy/pap/pap-test.robot b/tests/policy/pap/pap-test.robot
index f2dd61da..36b593c7 100644
--- a/tests/policy/pap/pap-test.robot
+++ b/tests/policy/pap/pap-test.robot
@@ -34,7 +34,7 @@ CreatePdpGroups
${postjson}= Get file ${CURDIR}/data/create.group.request.json
${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 data=${postjson} headers=${headers}
+ ${resp}= Post Request policy /policy/pap/v1/pdps/groups/batch data=${postjson} headers=${headers}
Log Received response from policy ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
@@ -61,6 +61,17 @@ QueryPdpGroups
Should Be Equal As Strings ${resp.json()['groups'][0]['pdpGroupState']} ACTIVE
Should Be Equal As Strings ${resp.json()['groups'][1]['name']} defaultGroup
+DeployPdpGroups
+ [Documentation] Runs Policy PAP Deploy Policies to PDP Groups
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session https://${POLICY_PAP_IP}:6969
+ ${postjson}= Get file ${CURDIR}/data/deploy.group.request.json
+ ${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/deployments/batch data=${postjson} headers=${headers}
+ Log Received response from policy ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+
UndeployPolicy
[Documentation] Runs Policy PAP Undeploy a Policy from PDP Groups
${auth}= Create List healthcheck zb!XztG34