Update to new tcagen2 policy type
Replacing deprecated tca policy type with new tcagen2
policy type.
Issue-ID: POLICY-2772
Change-Id: Id53e61caf9675e0080274784870970c7ea2575f8
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
diff --git a/tests/policy/api/api-test.robot b/tests/policy/api/api-test.robot
index d3df9cc..c229bcf 100644
--- a/tests/policy/api/api-test.robot
+++ b/tests/policy/api/api-test.robot
@@ -41,7 +41,7 @@
CreateTCAPolicyTypeV1
[Documentation] Create TCA Policy Type Version 1. Trying to create an existing policy type with any change and same version should cause error.
${auth}= Create List healthcheck zb!XztG34
- ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json
+ ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.tcagen2.v1.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
@@ -52,7 +52,7 @@
CreateTCAPolicyTypeV2
[Documentation] Create TCA Policy Type Version 2
${auth}= Create List healthcheck zb!XztG34
- ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v2.json
+ ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.tcagen2.v2.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
@@ -82,7 +82,7 @@
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.cdap.tca.hi.lo.app/versions/1.0.0/policies data=${postjson} headers=${headers}
+ ${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 policy ${resp.text}
${postjsonobject} To Json ${postjson}
Should Be Equal As Strings ${resp.status_code} 200
@@ -121,7 +121,7 @@
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 Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies headers=${headers}
+ ${resp}= Get Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies headers=${headers}
Log Received response from policy ${resp.text}
${expjsonobject} To Json ${expjson}
Should Be Equal As Strings ${resp.status_code} 200
@@ -173,10 +173,10 @@
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}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers}
+ ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers}
Log Received response from policy ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers}
+ ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers}
Should Be Equal As Strings ${resp.status_code} 404
DeleteSpecificPolicyTypeV1
@@ -185,10 +185,10 @@
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}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0 headers=${headers}
+ ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0 headers=${headers}
Log Received response from policy ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0 headers=${headers}
+ ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0 headers=${headers}
Should Be Equal As Strings ${resp.status_code} 404
DeleteSpecificPolicyTypeV2
@@ -197,8 +197,8 @@
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}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/2.0.0 headers=${headers}
+ ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/2.0.0 headers=${headers}
Log Received response from policy ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/2.0.0 headers=${headers}
+ ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/2.0.0 headers=${headers}
Should Be Equal As Strings ${resp.status_code} 404
diff --git a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json b/tests/policy/api/data/onap.policy.monitoring.tcagen2.v1.json
similarity index 98%
rename from tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json
rename to tests/policy/api/data/onap.policy.monitoring.tcagen2.v1.json
index 15c2045..a2e2ddc 100644
--- a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json
+++ b/tests/policy/api/data/onap.policy.monitoring.tcagen2.v1.json
@@ -6,11 +6,11 @@
"version": "1.0.0",
"description": "a base policy type for all policies that governs monitoring provisioning"
},
- "onap.policies.monitoring.cdap.tca.hi.lo.app": {
+ "onap.policies.monitoring.tcagen2": {
"derived_from": "onap.policies.Monitoring",
"version": "1.0.0",
"properties": {
- "tca_policy": {
+ "tca.policy": {
"type": "onap.datatypes.monitoring.tca_policy",
"description": "TCA Policy JSON"
}
diff --git a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v2.json b/tests/policy/api/data/onap.policy.monitoring.tcagen2.v2.json
similarity index 98%
rename from tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v2.json
rename to tests/policy/api/data/onap.policy.monitoring.tcagen2.v2.json
index a7a801a..d86749e 100644
--- a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v2.json
+++ b/tests/policy/api/data/onap.policy.monitoring.tcagen2.v2.json
@@ -1,11 +1,11 @@
{
"tosca_definitions_version": "tosca_simple_yaml_1_1_0",
"policy_types": {
- "onap.policies.monitoring.cdap.tca.hi.lo.app": {
+ "onap.policies.monitoring.tcagen2": {
"derived_from": "onap.policies.Monitoring",
"version": "2.0.0",
"properties": {
- "tca_policy": {
+ "tca.policy": {
"type": "onap.datatypes.monitoring.tca_policy",
"description": "TCA Policy JSON"
}
diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json
index 1079c7c..d57a64c 100644
--- a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json
+++ b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json
@@ -4,14 +4,14 @@
"policies": [
{
"onap.restart.tca": {
- "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "type": "onap.policies.monitoring.tcagen2",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
"policy-id": "onap.restart.tca"
},
"properties": {
- "tca_policy" : {
+ "tca.policy" : {
"domain": "measurementsForVfScaling",
"metricsPerEventName": [
{
diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json
index 35ad3c5..12e066e 100644
--- a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json
+++ b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json
@@ -4,7 +4,7 @@
"policies": [
{
"onap.restart.tca": {
- "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "type": "onap.policies.monitoring.tcagen2",
"version": "1.0.0",
"type_version": "1.0.0",
"description": "monitoring policy",
@@ -12,7 +12,7 @@
"policy-id": "onap.restart.tca"
},
"properties": {
- "tca_policy" : {
+ "tca.policy" : {
"domain": "measurementsForVfScaling",
"metricsPerEventName": [
{
diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json
index c6b2ad2..cd4be20 100644
--- a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json
+++ b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json
@@ -4,14 +4,14 @@
"policies": [
{
"onap.restart.tca": {
- "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "type": "onap.policies.monitoring.tcagen2",
"version": "2.0.0",
"type_version": "1.0.0",
"metadata": {
"policy-id": "onap.restart.tca"
},
"properties": {
- "tca_policy" : {
+ "tca.policy" : {
"domain": "measurementsForVfScaling",
"metricsPerEventName": [
{
diff --git a/tests/policy/pap/data/create.group.request.json b/tests/policy/pap/data/create.group.request.json
index ea04c0e..1b63563 100644
--- a/tests/policy/pap/data/create.group.request.json
+++ b/tests/policy/pap/data/create.group.request.json
@@ -13,7 +13,7 @@
"properties": {},
"supportedPolicyTypes": [
{
- "name": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "name": "onap.policies.monitoring.tcagen2",
"version": "1.0.0"
}
],
@@ -25,7 +25,7 @@
"properties": {},
"supportedPolicyTypes": [
{
- "name": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "name": "onap.policies.monitoring.tcagen2",
"version": "1.0.0"
}
],
diff --git a/tests/policy/pap/data/vCPE.policy.monitoring.input.tosca.json b/tests/policy/pap/data/vCPE.policy.monitoring.input.tosca.json
index 3003d9a..8ec03fe 100644
--- a/tests/policy/pap/data/vCPE.policy.monitoring.input.tosca.json
+++ b/tests/policy/pap/data/vCPE.policy.monitoring.input.tosca.json
@@ -4,14 +4,14 @@
"policies": [
{
"onap.restart.tca": {
- "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "type": "onap.policies.monitoring.tcagen2",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
"policy-id": "onap.restart.tca"
},
"properties": {
- "tca_policy": {
+ "tca.policy": {
"domain": "measurementsForVfScaling",
"metricsPerEventName": [
{
diff --git a/tests/policy/pap/pap-test.robot b/tests/policy/pap/pap-test.robot
index 67a5782..5387e85 100644
--- a/tests/policy/pap/pap-test.robot
+++ b/tests/policy/pap/pap-test.robot
@@ -12,7 +12,7 @@
${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.json
- ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies data=${postjson} headers=${headers}
+ ${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 API ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
diff --git a/tests/policy/xacml-pdp/data/vCPE.policy.monitoring.input.tosca.json b/tests/policy/xacml-pdp/data/vCPE.policy.monitoring.input.tosca.json
index 3003d9a..8ec03fe 100644
--- a/tests/policy/xacml-pdp/data/vCPE.policy.monitoring.input.tosca.json
+++ b/tests/policy/xacml-pdp/data/vCPE.policy.monitoring.input.tosca.json
@@ -4,14 +4,14 @@
"policies": [
{
"onap.restart.tca": {
- "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "type": "onap.policies.monitoring.tcagen2",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
"policy-id": "onap.restart.tca"
},
"properties": {
- "tca_policy": {
+ "tca.policy": {
"domain": "measurementsForVfScaling",
"metricsPerEventName": [
{
diff --git a/tests/policy/xacml-pdp/xacml-pdp-test.robot b/tests/policy/xacml-pdp/xacml-pdp-test.robot
index 6e2fa00..150c97e 100644
--- a/tests/policy/xacml-pdp/xacml-pdp-test.robot
+++ b/tests/policy/xacml-pdp/xacml-pdp-test.robot
@@ -52,7 +52,7 @@
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.cdap.tca.hi.lo.app/versions/1.0.0/policies data=${postjson} headers=${headers}
+ ${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