diff options
author | Jerry Flood <jf9860@att.com> | 2017-12-07 19:44:44 -0500 |
---|---|---|
committer | Jerry Flood <jf9860@att.com> | 2017-12-07 19:47:40 -0500 |
commit | e31a7f33d74ea5080db331280381cfcbce975b37 (patch) | |
tree | 5e682f7ab11f937fc0baa85bf73fb566156159bd | |
parent | 37bc7e5ec42e9330226fba62caf1288ba2e892a0 (diff) |
Fix preload of dcae collector IP and APPC
Issue-ID: TEST-72
Change-Id: I382073fe6d85786ba548d795fc86f57f22888763
Signed-off-by: Jerry Flood <jf9860@att.com>
11 files changed, 127 insertions, 28 deletions
diff --git a/robot/assets/templates/policy/FirewallPolicy_push.template b/robot/assets/templates/policy/FirewallPolicy_push.template new file mode 100644 index 00000000..33c45aaf --- /dev/null +++ b/robot/assets/templates/policy/FirewallPolicy_push.template @@ -0,0 +1,5 @@ +{ + "pdpGroup": "default", + "policyName": "com.BRMSParamvFirewall", + "policyType": "BRMS_Param" +} diff --git a/robot/assets/templates/policy/FirewallPolicy_update.template b/robot/assets/templates/policy/FirewallPolicy_update.template new file mode 100644 index 00000000..f2fadc3b --- /dev/null +++ b/robot/assets/templates/policy/FirewallPolicy_update.template @@ -0,0 +1,16 @@ +{ + "policyConfigType": "BRMS_PARAM", + "policyName": "com.BRMSParamvFirewall", + "policyDescription": "BRMS Param vFirewall policy", + "policyScope": "com", + "attributes": { + "MATCHING": { + "controller": "amsterdam" + }, + "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++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+'${RESOURCE_ID}'%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/robot/assets/templates/policy/closedloop_getconfigpolicy.template b/robot/assets/templates/policy/closedloop_getconfigpolicy.template index 34145e5b..90b6cafd 100644 --- a/robot/assets/templates/policy/closedloop_getconfigpolicy.template +++ b/robot/assets/templates/policy/closedloop_getconfigpolicy.template @@ -1,8 +1,3 @@ { - "configAttributes" : { - }, - "configName" : ".*", - "ecompName" : "DCAE", - "policyName" : "${config_policy_name}", - "unique" : true + "policyName" : "${config_policy_name}" }
\ No newline at end of file diff --git a/robot/resources/demo_preload.robot b/robot/resources/demo_preload.robot index 3cc0c51a..5b3e14c3 100644 --- a/robot/resources/demo_preload.robot +++ b/robot/resources/demo_preload.robot @@ -86,25 +86,25 @@ Preload User Model Login To VID GUI ${vf_modules}= Get Module Names from VID ${invariantUUID} ${vnf_service}= Set Variable If '${vnf_service}'=='default' ${service} ${vnf_service} - ${vf_modules}= Get The Selected Modules ${vf_modules} ${vnf_service} + ${vf_modules}= Get The Selected Modules ${vf_modules} ${vnf_service} Log ${generic_vnf} Log ${service_instance_id},${vnf_name},${vnf_type},${vf_module_name},${vf_modules},${service} Preload Vnf ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_modules} ${vnf_service} demo [Teardown] Close All Browsers -Get The Selected Modules +Get The Selected Modules [Arguments] ${vf_modules} ${vnf_service} ${returnlist} Create List ${list}= Get From DIctionary ${GLOBAL_SERVICE_TEMPLATE_MAPPING} ${vnf_service} :for ${map} in @{list} \ ${name}= Get From Dictionary ${map} name_pattern - \ Add To Module List ${vf_modules} ${name} ${returnlist} + \ Add To Module List ${vf_modules} ${name} ${returnlist} [Return] ${returnlist} Add To Module List [Arguments] ${vf_modules} ${name} ${returnlist} :for ${map} in @{vf_modules} - \ Run Keyword If '${name}' in '${map['name']}' Append To List ${returnlist} ${map} + \ Run Keyword If '${name}' in '${map['name']}' Append To List ${returnlist} ${map} Get Relationship Data [Arguments] ${relationships} @@ -133,18 +133,20 @@ APPC Mount Point Run Keyword if '${status}' == 'FAIL' FAIL ${vf_module_name} Stack is not found ${stack_id}= Get From Dictionary ${stack_info} id ${server_list}= Get Openstack Servers auth - ${vpg_name_0}= Get From Dictionary ${stack_info} vpg_name_0 + ${vnf_id}= Get From Dictionary ${stack_info} vnf_id ${vpg_public_ip}= Get Server Ip ${server_list} ${stack_info} vpg_name_0 network_name=public ${vpg_oam_ip}= Get From Dictionary ${stack_info} vpg_private_ip_1 - ${appc}= Create Mount Point In APPC ${vpg_name_0} ${vpg_oam_ip} + ${appc}= Create Mount Point In APPC ${vnf_id} ${vpg_oam_ip} Instantiate VNF [Arguments] ${service} Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} SharedNode OwnerType v1 CloudZone - ${vf_module_name} ${service}= Orchestrate VNF DemoCust ${service} ${service} ${TENANT_NAME} + ${stacknamemap} ${service}= Orchestrate VNF DemoCust ${service} ${service} ${TENANT_NAME} Save For Delete Log to Console Customer Name=${CUSTOMER_NAME} - Log to Console VNF Module Name=${vf_module_name} + ${stacks}= Get Dictionary Values ${stacknamemap} + :for ${stackname} in @{stacks} + \ Log to Console VNF Module Name=${stackname} Save For Delete [Documentation] Create a variable file to be loaded for save for delete diff --git a/robot/resources/global_properties.robot b/robot/resources/global_properties.robot index ac91d24b..129f8d1a 100644 --- a/robot/resources/global_properties.robot +++ b/robot/resources/global_properties.robot @@ -31,4 +31,6 @@ ${GLOBAL_VM_PRIVATE_KEY} ${EXECDIR}/robot/assets/keys/robot_ssh_private_key.pv ${GLOBAL_AAI_ZONE_ID} nova1 ${GLOBAL_AAI_ZONE_NAME} nova ${GLOBAL_AAI_DESIGN_TYPE} integration -${GLOBAL_AAI_ZONE_CONTEXT} labs
\ No newline at end of file +${GLOBAL_AAI_ZONE_CONTEXT} labs +${GLOBAL_DCAE_COLLECTOR_HOST_NAME} dcaedoks00 + diff --git a/robot/resources/sdngc_interface.robot b/robot/resources/sdngc_interface.robot index 50286444..4282c795 100644 --- a/robot/resources/sdngc_interface.robot +++ b/robot/resources/sdngc_interface.robot @@ -10,6 +10,9 @@ Library StringTemplater Resource global_properties.robot Resource ../resources/json_templater.robot Resource browser_setup.robot +Resource openstack/nova_interface.robot +Resource openstack/keystone_interface.robot +Resource stack_validation/validate_common.robot Variables ../assets/service_mappings.py @@ -85,6 +88,8 @@ Preload Vnf [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_modules} ${service} ${uuid} ${base_vf_module_type}= Catenate ${closedloop_vf_module}= Create Dictionary + Run Openstack Auth Request auth + ${servers}= Get Openstack Servers auth ${templates}= Get From Dictionary ${GLOBAL_SERVICE_TEMPLATE_MAPPING} ${service} :for ${vf_module} in @{vf_modules} \ ${vf_module_type}= Get From Dictionary ${vf_module} name @@ -94,7 +99,7 @@ Preload Vnf \ ${closedloop_vf_module}= Set Variable If '${dict['isBase']}' == 'false' ${vf_module} ${closedloop_vf_module} \ ${vf_name}= Update Module Name ${dict} ${vf_module_name} \ Preload Vnf Profile ${vf_module_type} - \ Preload One Vnf Topology ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_name} ${vf_module_type} ${service} ${filename} ${uuid} + \ Preload One Vnf Topology ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_name} ${vf_module_type} ${service} ${filename} ${uuid} ${servers} [Return] ${base_vf_module_type} ${closedloop_vf_module} @@ -114,10 +119,10 @@ Get From Mapping [Return] None Preload One Vnf Topology - [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_module_type} ${service} ${filename} ${uuid} + [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_module_type} ${service} ${filename} ${uuid} ${servers} Return From Keyword If '${filename}' == '' ${data_template}= OperatingSystem.Get File ${PRELOAD_VNF_TOPOLOGY_OPERATION_BODY}/preload.template - ${parameters}= Get Template Parameters ${filename} ${uuid} + ${parameters}= Get Template Parameters ${filename} ${uuid} ${servers} Set To Dictionary ${parameters} generic_vnf_name=${generic_vnf_name} generic_vnf_type=${generic_vnf_type} service_type=${service_type_uuid} vf_module_name=${vf_module_name} vf_module_type=${vf_module_type} ${data}= Fill JSON Template ${data_template} ${parameters} ${put_resp}= Run SDNGC Post Request ${SDNGC_INDEX_PATH}${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} ${data} @@ -126,11 +131,13 @@ Preload One Vnf Topology Should Be Equal As Strings ${get_resp.status_code} 200 Get Template Parameters - [Arguments] ${template} ${uuid} + [Arguments] ${template} ${uuid} ${servers} ${rest} ${suite}= Split String From Right ${SUITE NAME} . 1 ${uuid}= Catenate ${uuid} ${hostid}= Get Substring ${uuid} -4 ${ecompnet}= Evaluate (${GLOBAL_BUILD_NUMBER}%128)+128 + ${dcae_server}= Get From Dictionary ${servers} ${GLOBAL_DCAE_COLLECTOR_HOST_NAME} + ${dcae_collector_ip}= Search Addresses ${dcae_server} public # Initialize the value map with the properties generated from the Robot VM /opt/config folder @@ -144,6 +151,7 @@ Get Template Parameters Set To Dictionary ${valuemap} install_script_version=${GLOBAL_INJECTED_SCRIPT_VERSION} Set To Dictionary ${valuemap} vm_image_name=${GLOBAL_INJECTED_VM_IMAGE_NAME} Set To Dictionary ${valuemap} vm_flavor_name=${GLOBAL_INJECTED_VM_FLAVOR} + Set To Dictionary ${valuemap} dcae_collector_ip=${dcae_collector_ip} # update the value map with unique values. diff --git a/robot/resources/stack_validation/policy_check_vfw.robot b/robot/resources/stack_validation/policy_check_vfw.robot index 22340729..594b9146 100644 --- a/robot/resources/stack_validation/policy_check_vfw.robot +++ b/robot/resources/stack_validation/policy_check_vfw.robot @@ -38,6 +38,22 @@ Policy Check Firewall Stack ${upper_bound}= Evaluate ${policy_rate}*2 Wait Until Keyword Succeeds 300s 1s Run VFW Policy Check ${vpg_public_ip} ${policy_rate} ${upper_bound} 1 +Policy Check FirewallCL Stack + [Documentation] Executes the vFW policy closed loop test. + [Arguments] ${stack_name} ${policy_rate} + Run Openstack Auth Request auth + ${stack_info}= Wait for Stack to Be Deployed auth ${stack_name} + ${stack_id}= Get From Dictionary ${stack_info} id + ${server_list}= Get Openstack Servers auth + Log ${server_list} + ${vpg_unprotected_ip}= Get From Dictionary ${stack_info} vpg_private_ip_0 + ${vsn_protected_ip}= Get From Dictionary ${stack_info} vsn_private_ip_0 + ${vpg_public_ip}= Get Server Ip ${server_list} ${stack_info} vpg_name_0 network_name=public + ${vsn_public_ip}= Get Server Ip ${server_list} ${stack_info} vsn_name_0 network_name=public + ${upper_bound}= Evaluate ${policy_rate}*2 + Wait Until Keyword Succeeds 300s 1s Run VFW Policy Check ${vpg_public_ip} ${policy_rate} ${upper_bound} 1 + + Run VFW Policy Check [Documentation] Push traffic above upper bound, wait for policy to fix it, push traffic to lower bound, wait for policy to fix it, [Arguments] ${vpg_public_ip} ${policy_rate} ${upper_bound} ${lower_bound} diff --git a/robot/resources/test_templates/closedloop_test_template.robot b/robot/resources/test_templates/closedloop_test_template.robot index 1a136130..db49e317 100644 --- a/robot/resources/test_templates/closedloop_test_template.robot +++ b/robot/resources/test_templates/closedloop_test_template.robot @@ -19,12 +19,14 @@ ${PUSH_POLICY_TEMPLATE} robot/assets/templates/policy/closedloop_pushpolicy.te ${DEL_POLICY_TEMPLATE} robot/assets/templates/policy/closedloop_deletepolicy.template ${GECONFIG_VFW_TEMPLATE} robot/assets/templates/policy/closedloop_getconfigpolicy.template + # 'Normal' number of pg streams that will be set when policy is triggered ${VFWPOLICYRATE} 5 # Max nslookup requests per second before triggering event. ${VLBPOLICYRATE} 20 +${CLCONFIG_POLICY_NAME} BRMSParamvFirewall ${CONFIG_POLICY_NAME} vFirewall ${CONFIG_POLICY_TYPE} Unknown ${OPS_POLICY_NAME} @@ -49,16 +51,25 @@ ${Expected_Direction_3} GREATER_OR_EQUAL ${DNSSCALINGSTACK} *** Keywords *** +VFWCL Policy + Log Suite name ${SUITE NAME} ${TEST NAME} ${PREV TEST NAME} + Initialize VFWCL Policy + ${stacknamemap}= Orchestrate VNF vFWCL closedloop + Policy Check FirewallCL Stack ${stacknamemap} ${VFWPOLICYRATE} + Delete VNF + VFW Policy Log Suite name ${SUITE NAME} ${TEST NAME} ${PREV TEST NAME} Initialize VFW Policy - ${stackname}= Orchestrate VNF vFW closedloop + ${stacknamemap}= Orchestrate VNF vFW closedloop + ${stackname}= Get From Dictionary ${stacknamemap} vFW Policy Check Firewall Stack ${stackname} ${VFWPOLICYRATE} Delete VNF VDNS Policy Initialize VDNS Policy - ${stackname}= Orchestrate VNF vDNS closedloop + ${stacknamemap}= Orchestrate VNF vDNS closedloop + ${stackname}= Get From Dictionary ${stacknamemap} vLB ${dnsscaling}= Policy Check vLB Stack ${stackname} ${VLBPOLICYRATE} Set Test Variable ${DNSSCALINGSTACK} ${dnsscaling} Delete VNF @@ -70,6 +81,14 @@ Initialize VFW Policy # Push Ops Policy ${OPS_POLICY_NAME} ${OPS_POLICY_TYPE} Get Configs VFW Policy +Initialize VFWCL Policy +# Create Config Policy +# Push Config Policy ${CONFIG_POLICY_NAME} ${CONFIG_POLICY_TYPE} +# Create Ops Policy +# Push Ops Policy ${OPS_POLICY_NAME} ${OPS_POLICY_TYPE} + Get Configs VFWCL Policy + + Initialize VDNS Policy Get Configs VDNS Policy @@ -100,6 +119,33 @@ Get Configs VFW Policy ${direction_1}= Get Variable Value ${config["content"]["thresholds"][1]["direction"]} Should Be Equal ${direction_1} ${Expected_Direction_2} +Get Configs VFWCL Policy + [Documentation] Get Config Policy for VFWCL + ${getconfigpolicy}= Catenate ${CLCONFIG_POLICY_NAME} + ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} + ${output} = Fill JSON Template File ${GECONFIG_VFW_TEMPLATE} ${configpolicy_name} + ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} + Should Be Equal As Strings ${get_resp.status_code} 200 + + ${json}= Parse Json ${get_resp.content} + ${config}= Parse Json ${json[0]["config"]} + + # Extract object1 from Array + ${severity}= Get Variable Value ${config["content"]["thresholds"][0]["severity"]} + Should Be Equal ${severity} ${Expected_Severity_1} + ${Thresold_Value}= Get Variable Value ${config["content"]["thresholds"][0]["thresholdValue"]} + Should Be Equal ${Thresold_Value} ${Expected_Threshold_1} + ${direction}= Get Variable Value ${config["content"]["thresholds"][0]["direction"]} + Should Be Equal ${direction} ${Expected_Direction_1} + + # Extract object2 from Array + ${severity_1}= Get Variable Value ${config["content"]["thresholds"][1]["severity"]} + Should Be Equal ${severity_1} ${Expected_Severity_2} + ${Thresold_Value_1}= Get Variable Value ${config["content"]["thresholds"][1]["thresholdValue"]} + Should Be Equal ${Thresold_Value_1} ${Expected_Threshold_2} + ${direction_1}= Get Variable Value ${config["content"]["thresholds"][1]["direction"]} + Should Be Equal ${direction_1} ${Expected_Direction_2} + Get Configs VDNS Policy [Documentation] Get Config Policy for VDNS ${getconfigpolicy}= Catenate .*vLoadBalancer* @@ -188,16 +234,23 @@ Delete Ops Policy ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} Should Be Equal As Strings ${put_resp.status_code} 200 +Orchestrate VNF vFWCL closedloop + [Documentation] VNF Orchestration for vFW + Log VNF Orchestration flow TEST NAME=${TEST NAME} + Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} SharedNode OwnerType v1 CloudZone + ${stack_name_map} ${service}= Orchestrate VNF ETE_CLP vFWCL vFWCL ${TENANT_NAME} + [Return] ${stack_name_map} + Orchestrate VNF vFW closedloop [Documentation] VNF Orchestration for vFW Log VNF Orchestration flow TEST NAME=${TEST NAME} Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} SharedNode OwnerType v1 CloudZone - ${stack_name} ${service}= Orchestrate VNF ETE_CLP vFWCL vFWCL ${TENANT_NAME} - [Return] ${stack_name} + ${stack_name_map} ${service}= Orchestrate VNF ETE_CLP vFW vFW ${TENANT_NAME} + [Return] ${stack_name_map} Orchestrate VNF vDNS closedloop [Documentation] VNF Orchestration for vLB Log VNF Orchestration flow TEST NAME=${TEST NAME} Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} SharedNode OwnerType v1 CloudZone - ${stack_name} ${service}= Orchestrate VNF ETE_CLP vLB vLB ${TENANT_NAME} - [Return] ${stack_name} + ${stack_name_map} ${service}= Orchestrate VNF ETE_CLP vLB vLB ${TENANT_NAME} + [Return] ${stack_name_map} diff --git a/robot/resources/test_templates/vnf_orchestration_test_template.robot b/robot/resources/test_templates/vnf_orchestration_test_template.robot index 807647db..2cef78ba 100644 --- a/robot/resources/test_templates/vnf_orchestration_test_template.robot +++ b/robot/resources/test_templates/vnf_orchestration_test_template.robot @@ -65,6 +65,7 @@ Orchestrate VNF Set Test Variable ${SERVICE_INSTANCE_ID} ${service_instance_id} Validate Service Instance ${service_instance_id} ${service} ${customer_name} ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service} + ${vnfmap}= Create Dictionary :for ${vnf} in @{vnflist} \ ${vnf_name}= Catenate Ete_${vnf}_${uuid} \ ${vf_module_name}= Catenate Vfmodule_Ete_${vnf}_${uuid} @@ -80,7 +81,8 @@ Orchestrate VNF \ Append To List ${STACK_NAMES} ${STACK_NAME} \ Execute Heatbridge ${vf_module_name} ${service_instance_id} ${vnf} \ Validate VF Module ${vf_module_name} ${vnf} - [Return] ${vf_module_name} ${service} + \ Set To Dictionary ${vnfmap} ${vnf}=${vf_module_name} + [Return] ${vnfmap} ${service} Get VNF Type diff --git a/robot/testsuites/closed-loop.robot b/robot/testsuites/closed-loop.robot index e36be894..403506b4 100644 --- a/robot/testsuites/closed-loop.robot +++ b/robot/testsuites/closed-loop.robot @@ -9,7 +9,7 @@ Test Teardown Teardown Closed Loop VFW Closed Loop Test [TAGS] ete closedloop - VFW Policy + VFWCL Policy VDNS Closed Loop Test [TAGS] ete closedloop VDNS Policy
\ No newline at end of file diff --git a/robot/testsuites/update_onap_page.robot b/robot/testsuites/update_onap_page.robot index b7c3b285..6a879710 100644 --- a/robot/testsuites/update_onap_page.robot +++ b/robot/testsuites/update_onap_page.robot @@ -46,7 +46,7 @@ Update ONAP Page Set To Dictionary ${oam_ip_map} 10.0.4.102=dcae_coll Set To Dictionary ${oam_ip_map} 10.0.10.1=robot - ${values}= Create Dictionary + ${values}= Copy Dictionary ${GLOBAL_INJECTED_PROPERTIES} ${keys}= Get Dictionary Keys ${oam_ip_map} :for ${oam_ip} in @{keys} \ ${value_name}= Get From Dictionary ${oam_ip_map} ${oam_ip} |