diff options
author | RAJU <cr770w@att.com> | 2017-10-19 15:59:57 -0500 |
---|---|---|
committer | RAJU <cr770w@att.com> | 2017-10-19 16:35:34 -0500 |
commit | bb7d13cde357be1e72243ad380b111f5ed72ee1e (patch) | |
tree | af77c22b69e99d21fdd3d61d27e68da05bcbe792 | |
parent | a867833d0943b36f431b869c630959aa23abaf0f (diff) |
Policy CSIT Payload changes from push-policies.sh
Issue-Id: POLICY-337
Signed-off-by: RAJU <cr770w@att.com>
Change-Id: I6efd732fea87c23483af32de9f6938e00f41a8ff
9 files changed, 64 insertions, 14 deletions
diff --git a/test/csit/scripts/policy/script1.sh b/test/csit/scripts/policy/script1.sh index 30fb39586..db5b5155a 100755 --- a/test/csit/scripts/policy/script1.sh +++ b/test/csit/scripts/policy/script1.sh @@ -92,6 +92,7 @@ cat config/pe/ip_addr.txt export MTU=9126 +export PRELOAD_POLICIES=false docker-compose -f docker-compose-integration.yml up -d if [ ! $? -eq 0 ]; then diff --git a/test/csit/tests/policy/suite1/Policy-CSIT.robot b/test/csit/tests/policy/suite1/Policy-CSIT.robot index 5ce1f9f73..fd5e23048 100644 --- a/test/csit/tests/policy/suite1/Policy-CSIT.robot +++ b/test/csit/tests/policy/suite1/Policy-CSIT.robot @@ -12,9 +12,9 @@ ${RESOURCE_PATH_CREATE} /pdp/api/createPolicy ${RESOURCE_PATH_CREATE_PUSH} /pdp/api/pushPolicy ${RESOURCE_PATH_CREATE_DELETE} /pdp/api/deletePolicy ${RESOURCE_PATH_GET_CONFIG} /pdp/api/getConfig -${CREATE_CONFIG_VFW_TEMPLATE} ${CURDIR}/configpolicy_vFW.template -${CREATE_CONFIG_VDNS_TEMPLATE} ${CURDIR}/configpolicy_vDNS.template -${CREATE_CONFIG_VCPE_TEMPLATE} ${CURDIR}/configpolicy_vCPE.template +${CREATE_CONFIG_VFW_TEMPLATE} ${CURDIR}/configpolicy_vFW_R1.template +${CREATE_CONFIG_VDNS_TEMPLATE} ${CURDIR}/configpolicy_vDNS_R1.template +${CREATE_CONFIG_VCPE_TEMPLATE} ${CURDIR}/configpolicy_vCPE_R1.template ${CREATE_OPS_VFW_TEMPLATE} ${CURDIR}/opspolicy_VFW_R1.template ${PUSH_POLICY_TEMPLATE} ${CURDIR}/pushpolicy.template ${CREATE_OPS_VDNS_TEMPLATE} ${CURDIR}/opspolicy_VDNS_R1.template @@ -36,8 +36,8 @@ ${OPS_POLICY_VOLTE_NAME} VoLTE ${OPS_POLICY_VOLTE_TYPE} BRMS_PARAM ${file_path} ../testsuite/robot/assets/templates/ControlLoopDemo__closedLoopControlName.drl ${RESOURCE_PATH_UPLOAD} /pdp/api/policyEngineImport?importParametersJson=%7B%22serviceName%22%3A%22Manyu456%22%2C%20%22serviceType%22%3A%22BRMSPARAM%22%7D -${CREATE_OPS_VCPE_TEMPLATE} ${CURDIR}/opspolicy_vCPE.template -${CREATE_OPS_VOLTE_TEMPLATE} ${CURDIR}/opspolicy_vOLTE.template +${CREATE_OPS_VCPE_TEMPLATE} ${CURDIR}/opspolicy_vCPE_R1.template +${CREATE_OPS_VOLTE_TEMPLATE} ${CURDIR}/opspolicy_vOLTE_R1.template *** Test Cases *** @@ -220,7 +220,7 @@ Create Ops VDNS Policy Create Config VCPE Policy [Documentation] Create Config Policy ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname}_vFirewall + ${policyname1}= Catenate com.${randompolicyname}_vCPE ${CONFIG_POLICY_VCPE_NAME}= Set Test Variable ${policyname1} ${configpolicy}= Create Dictionary policy_name=${policyname1} ${output} = Fill JSON Template File ${CREATE_CONFIG_VCPE_TEMPLATE} ${configpolicy} @@ -239,7 +239,7 @@ Get Configs VCPE Policy Create Ops vCPE Policy [Documentation] Create Opertional Policy ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname} + ${policyname1}= Catenate com.${randompolicyname}_vCPE ${OPS_POLICY_VCPE_NAME}= Set Test Variable ${policyname1} ${dict}= Create Dictionary policy_name=${policyname1} ${output} = Fill JSON Template File ${CREATE_OPS_VCPE_TEMPLATE} ${dict} @@ -251,7 +251,7 @@ Create Ops vCPE Policy Create Ops VolTE Policy [Documentation] Create Opertional Policy ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname} + ${policyname1}= Catenate com.${randompolicyname}_VoLTE ${dict}= Create Dictionary policy_name=${policyname1} ${output} = Fill JSON Template File ${CREATE_OPS_VOLTE_TEMPLATE} ${dict} ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} diff --git a/test/csit/tests/policy/suite1/configpolicy_vCPE_R1.template b/test/csit/tests/policy/suite1/configpolicy_vCPE_R1.template new file mode 100644 index 000000000..6dcf3c600 --- /dev/null +++ b/test/csit/tests/policy/suite1/configpolicy_vCPE_R1.template @@ -0,0 +1,6 @@ +{ + "configBody": "{ \"service\": \"policy_tosca_tca\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevCPE\", \"description\": \"MicroService vCPE Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.0.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"policyVersion\": \"v0.0.1\", \"threshholds\": [{ \"severity\": \"MAJOR\", \"fieldPath\": \"$$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": \"0\", \"closedLoopEventStatus\": \"ABATED\", \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"direction\": \"EQUAL\" }, { \"severity\": \"CRITICAL\", \"fieldPath\": \"$$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": \"0\", \"closedLoopEventStatus\": \"ONSET\", \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"direction\": \"GREATER\" }], \"policyName\": \"DCAE.Config_tca-hi-lo\", \"controlLoopSchemaType\": \"VNF\", \"policyScope\": \"DCAE\", \"eventName\": \"Measurement_vGMUX\" } }", + "policyConfigType": "MicroService", + "policyName": "${policy_name}", + "onapName": "DCAE" +}
\ No newline at end of file diff --git a/test/csit/tests/policy/suite1/configpolicy_vDNS_R1.template b/test/csit/tests/policy/suite1/configpolicy_vDNS_R1.template new file mode 100644 index 000000000..0a9ecc6ff --- /dev/null +++ b/test/csit/tests/policy/suite1/configpolicy_vDNS_R1.template @@ -0,0 +1,6 @@ +{ + "configBody": "{ \"service\": \"policy_tosca_tca\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevDNS\", \"description\": \"MicroService vDNS Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.0.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"policyVersion\": \"v0.0.1\", \"threshholds\": [{ \"severity\": \"CRITICAL\", \"fieldPath\": \"$$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \"thresholdValue\": \"300\", \"closedLoopEventStatus\": \"ONSET\", \"closedLoopControlName\": \"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\", \"version\": \"1.0.2\", \"direction\": \"GREATER_OR_EQUAL\" }], \"policyName\": \"DCAE.Config_tca-hi-lo\", \"controlLoopSchemaType\": \"VM\", \"policyScope\": \"DCAE\", \"eventName\": \"vLoadBalancer\" } }", + "policyConfigType": "MicroService", + "policyName": "${policy_name}", + "onapName": "DCAE" +}
\ No newline at end of file diff --git a/test/csit/tests/policy/suite1/configpolicy_vFW_R1.template b/test/csit/tests/policy/suite1/configpolicy_vFW_R1.template new file mode 100644 index 000000000..4c3617d5e --- /dev/null +++ b/test/csit/tests/policy/suite1/configpolicy_vFW_R1.template @@ -0,0 +1,6 @@ +{ + "configBody": "{\"service\": \"policy_tosca_tca\",\"location\": \"SampleServiceLocation\",\"uuid\": \"test\",\"policyName\": \"MicroServicevFirewall\",\"description\": \"MicroService vFirewall Policy\",\"configName\": \"SampleConfigName\",\"templateVersion\": \"OpenSource.version.1\",\"version\": \"1.0.0\",\"priority\": \"1\",\"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"riskType\": \"SampleRiskType\",\"riskLevel\": \"1\",\"guard\": \"False\",\"content\": {\"policyVersion\": \"v0.0.1\",\"threshholds\": [{\"severity\": \"MAJOR\",\"fieldPath\": \"$$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\": \"300\",\"closedLoopEventStatus\": \"ONSET\",\"closedLoopControlName\": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\": \"1.0.2\",\"direction\": \"LESS_OR_EQUAL\"}, {\"severity\": \"CRITICAL\",\"fieldPath\": \"$$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\": \"700\",\"closedLoopEventStatus\": \"ONSET\",\"closedLoopControlName\": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\": \"1.0.2\",\"direction\": \"GREATER_OR_EQUAL\"}],\"policyName\": \"DCAE.Config_tca-hi-lo\",\"controlLoopSchemaType\": \"VNF\",\"policyScope\": \"DCAE\",\"eventName\": \"vFirewallBroadcastPackets\"}}", + "policyConfigType": "MicroService", + "policyName": "${policy_name}", + "onapName": "DCAE" +}
\ No newline at end of file diff --git a/test/csit/tests/policy/suite1/opspolicy_VDNS_R1.template b/test/csit/tests/policy/suite1/opspolicy_VDNS_R1.template index b5312b500..92627cc2d 100644 --- a/test/csit/tests/policy/suite1/opspolicy_VDNS_R1.template +++ b/test/csit/tests/policy/suite1/opspolicy_VDNS_R1.template @@ -10,7 +10,7 @@ "RULE": { "templateName": "ClosedLoopControlName", "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", - "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0D%0A++services%3A%0D%0A++++-+serviceName%3A+d4738992-6497-4dca-9db9%0D%0A++++++serviceInvariantUUID%3A+dc112d6e-7e73-4777-9c6f-1a7fb5fd1b6f%0D%0A++++++serviceUUID%3A+2eea06c6-e1d3-4c3a-b9c4-478c506eeedf%0D%0A++trigger_policy%3A+unique-policy-id-1-scale-up%0D%0A++timeout%3A+1200%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-scale-up%0D%0A++++name%3A+Create+a+new+VF+Module%0D%0A++++description%3A%0D%0A++++actor%3A+MSO%0D%0A++++recipe%3A+VF+Module+Create%0D%0A++++target%3A%0D%0A++++++type%3A+VNF%0D%0A++++retry%3A+0%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" - } + "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0D%0A++trigger_policy%3A+unique-policy-id-1-scale-up%0D%0A++timeout%3A+1200%0D%0A++abatement%3A+false%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-scale-up%0D%0A++++name%3A+Create+a+new+VF+Module%0D%0A++++description%3A%0D%0A++++actor%3A+SO%0D%0A++++recipe%3A+VF+Module+Create%0D%0A++++target%3A%0D%0A++++++type%3A+VNF%0D%0A++++retry%3A+0%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" + } } }
\ No newline at end of file diff --git a/test/csit/tests/policy/suite1/opspolicy_VFW_R1.template b/test/csit/tests/policy/suite1/opspolicy_VFW_R1.template index e9893446e..a93063f70 100644 --- a/test/csit/tests/policy/suite1/opspolicy_VFW_R1.template +++ b/test/csit/tests/policy/suite1/opspolicy_VFW_R1.template @@ -10,8 +10,7 @@ "RULE": { "templateName": "ClosedLoopControlName", "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a", - "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a%0D%0A++services%3A%0D%0A++++-+serviceInvariantUUID%3A+5cfe6f4a-41bc-4247-8674-ebd4b98e35cc%0D%0A++++++serviceUUID%3A+0f40bba5-986e-4b3c-803f-ddd1b7b25f24%0D%0A++++++serviceName%3A+57e66ea7-0ed6-45c7-970f%0D%0A++trigger_policy%3A+unique-policy-id-1-modifyConfig%0D%0A++timeout%3A+1200%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-modifyConfig%0D%0A++++name%3A+modify+packet+gen+config%0D%0A++++description%3A%0D%0A++++actor%3A+APPC%0D%0A++++recipe%3A+ModifyConfig%0D%0A++++target%3A%0D%0A++++++resourceID%3A+Eace933104d443b496b8.nodes.heat.vpg%0D%0A++++++type%3A+VNF%0D%0A++++retry%3A+0%0D%0A++++timeout%3A+300%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" + "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a%0D%0A++trigger_policy%3A+unique-policy-id-1-modifyConfig%0D%0A++timeout%3A+1200%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-modifyConfig%0D%0A++++name%3A+modify+packet+gen+config%0D%0A++++description%3A%0D%0A++++actor%3A+APPC%0D%0A++++recipe%3A+ModifyConfig%0D%0A++++target%3A%0D%0A++++++%23+TBD+-+Cannot+be+known+until+instantiation+is+done%0D%0A++++++resourceID%3A+Eace933104d443b496b8.nodes.heat.vpg%0D%0A++++++type%3A+VNF%0D%0A++++retry%3A+0%0D%0A++++timeout%3A+300%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" } - } -} - + } +} diff --git a/test/csit/tests/policy/suite1/opspolicy_vCPE_R1.template b/test/csit/tests/policy/suite1/opspolicy_vCPE_R1.template new file mode 100644 index 000000000..36695daa4 --- /dev/null +++ b/test/csit/tests/policy/suite1/opspolicy_vCPE_R1.template @@ -0,0 +1,16 @@ +{ + "policyConfigType": "BRMS_PARAM", + "policyName": "${policy_name}", + "policyDescription": "BRMS Param vCPE policy", + "policyScope": "com", + "attributes": { + "MATCHING": { + "controller" : "amsterdam" + }, + "RULE": { + "templateName": "ClosedLoopControlName", + "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", + "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e%0D%0A++trigger_policy%3A+unique-policy-id-1-restart%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+true%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-restart%0D%0A++++name%3A+Restart+the+VM%0D%0A++++description%3A%0D%0A++++actor%3A+APPC%0D%0A++++recipe%3A+Restart%0D%0A++++target%3A%0D%0A++++++type%3A+VM%0D%0A++++retry%3A+3%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" + } + } +}
\ No newline at end of file diff --git a/test/csit/tests/policy/suite1/opspolicy_vOLTE_R1.template b/test/csit/tests/policy/suite1/opspolicy_vOLTE_R1.template new file mode 100644 index 000000000..ff5fc42c4 --- /dev/null +++ b/test/csit/tests/policy/suite1/opspolicy_vOLTE_R1.template @@ -0,0 +1,16 @@ +{ + "policyConfigType": "BRMS_PARAM", + "policyName": "${policy_name}", + "policyDescription": "BRMS Param VOLTE policy", + "policyScope": "com", + "attributes": { + "MATCHING": { + "controller" : "amsterdam" + }, + "RULE": { + "templateName": "ClosedLoopControlName", + "closedLoopControlName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b", + "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b%0D%0A++trigger_policy%3A+unique-policy-id-1-restart%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-restart%0D%0A++++name%3A+Restart+the+VM%0D%0A++++description%3A%0D%0A++++actor%3A+VFC%0D%0A++++recipe%3A+Restart%0D%0A++++target%3A%0D%0A++++++type%3A+VM%0D%0A++++retry%3A+3%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" + } + } +}
\ No newline at end of file |