diff options
-rw-r--r-- | docker/Dockerfile | 3 | ||||
-rw-r--r-- | robot/resources/asdc_interface.robot | 14 | ||||
-rw-r--r-- | robot/resources/demo_preload.robot | 13 | ||||
-rw-r--r-- | robot/resources/mso_interface.robot | 11 | ||||
-rw-r--r-- | robot/resources/policy_interface.robot | 17 | ||||
-rw-r--r-- | robot/resources/test_templates/closedloop_test_template.robot | 31 | ||||
-rw-r--r-- | robot/testsuites/closed-loop.robot | 4 | ||||
-rw-r--r-- | robot/testsuites/demo.robot | 2 |
8 files changed, 79 insertions, 16 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 3ec5b9ca..bdd6d447 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -45,6 +45,9 @@ RUN chmod 777 /var/opt/OpenECOMP_ETE/setup.sh && \ chmod 777 /var/opt/OpenECOMP_ETE/runSoak.sh && \ chmod 777 /var/opt/OpenECOMP_ETE/runEteTag.sh +# Set mode for the SSH keys +RUN chmod 600 /var/opt/OpenECOMP_ETE/robot/assets/keys/* + # Update the ssh library so that it will run properly in the docker env RUN cd /var/opt/OpenECOMP_ETE && ./setup.sh && apt-get clean diff --git a/robot/resources/asdc_interface.robot b/robot/resources/asdc_interface.robot index f31e7c50..11086ace 100644 --- a/robot/resources/asdc_interface.robot +++ b/robot/resources/asdc_interface.robot @@ -68,23 +68,23 @@ Distribute Model From ASDC # on certify it gets a new id ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id} Approve ASDC Catalog Service ${catalog_service_id} - : FOR ${DIST_INDEX} IN RANGE 1 3 + : FOR ${DIST_INDEX} IN RANGE 3 \ Log Distribution Attempt ${DIST_INDEX} \ Distribute ASDC Catalog Service ${catalog_service_id} \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id} \ ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']} \ Exit For Loop If '${status}'=='PASS' + Should Be Equal As Strings ${status} 'PASS' [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} Loop Over Check Catalog Service Distributed - [Arguments] ${catalog_service_id} - : FOR ${CHECK_INDEX} IN RANGE 1 15 - \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} - \ Sleep 20s + [Arguments] ${catalog_service_id} + : FOR ${CHECK_INDEX} IN RANGE 15 + \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} + \ Sleep 20s \ Return From Keyword If '${status}'=='PASS' - Fail - + Should Be Equal As Strings ${status} 'PASS' Setup ASDC Catalog Resource [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id diff --git a/robot/resources/demo_preload.robot b/robot/resources/demo_preload.robot index 102305ab..bab21be1 100644 --- a/robot/resources/demo_preload.robot +++ b/robot/resources/demo_preload.robot @@ -22,6 +22,7 @@ ${AAI_INDEX_PATH} /aai/v8 ${VF_MODULES_NAME} _Demo_VFModules.json ${FILE_CACHE} /share/ ${DEMO_PREFIX} demo +${VPKG_MODULE_LABEL} base_vpkg *** Keywords *** @@ -143,21 +144,23 @@ APPC Mount Point ${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 ${vpg_name_0} ${vpg_oam_ip} + ${appc}= Create Mount Point In APPC ${vnf_id} ${vpg_oam_ip} Instantiate VNF - [Arguments] ${service} + [Arguments] ${service} ${vf_module_label}=NULL Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} SharedNode OwnerType v1 CloudZone ${vf_module_name} ${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} - ${model_invariant_id}= Run MSO Get ModelInvariantId ${SUITE_SERVICE_MODEL_NAME} + ${model_invariant_id}= Run MSO Get ModelInvariantId ${SUITE_SERVICE_MODEL_NAME} ${vf_module_label} Log to Console ModelInvariantID=${model_invariant_id} - Update vVFWCL Policy ${model_invariant_id} - APPC Mount Point ${vf_module_name} + ${status} ${value}= Run Keyword And Ignore Error Update vVFWCL Policy ${model_invariant_id} + ${status} ${value}= Run Keyword And Ignore Error APPC Mount Point ${vf_module_name} diff --git a/robot/resources/mso_interface.robot b/robot/resources/mso_interface.robot index 200b270f..bded5282 100644 --- a/robot/resources/mso_interface.robot +++ b/robot/resources/mso_interface.robot @@ -22,13 +22,20 @@ Run MSO Health Check Run MSO Get ModelInvariantId [Documentation] Runs an MSO Get ModelInvariantID for ClosedLoop Polieis - [Arguments] ${service_model_name} + [Arguments] ${service_model_name} ${vf_module_label}=NULL ${param_dict}= Create Dictionary serviceModelName ${service_model_name} ${param}= Evaluate urllib.urlencode(${param_dict}) urllib ${data_path}= Catenate SEPARATOR= /ecomp/mso/catalog/v2/serviceVnfs? ${param} ${resp}= Run MSO Get Request ${data_path} Log ${resp.json()} - [Return] ${resp.json()['serviceVnfs'][0]['modelInfo']['modelInvariantUuid']} + # ${resp.json()['serviceVnfs'][0]['vfModules'][0]['vfModuleLabel'] should be 'base_vpkg' + ${model_invariant_id}= Set Variable NULL + @{ITEMS}= Copy List ${resp.json()['serviceVnfs']} + :FOR ${ELEMENT} IN @{ITEMS} + \ Log ${ELEMENT['vfModules']} + \ ${model_invariant_id} Set Variable If ('${vf_module_label}' in '${ELEMENT['vfModules'][0]['vfModuleLabel']}') ${ELEMENT['modelInfo']['modelInvariantUuid']} NULL + \ Exit For Loop If '${model_invariant_id}' != 'NULL' + [Return] ${model_invariant_id} Run MSO Get Request [Documentation] Runs an MSO get request diff --git a/robot/resources/policy_interface.robot b/robot/resources/policy_interface.robot index 8bc9c3b6..49590c02 100644 --- a/robot/resources/policy_interface.robot +++ b/robot/resources/policy_interface.robot @@ -12,6 +12,7 @@ ${POLICY_HEALTH_CHECK_PATH} /healthcheck ${POLICY_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_POLICY_SERVER_PORT} ${POLICY_HEALTHCHECK_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_POLICY_HEALTHCHECK_PORT} ${POLICY_TEMPLATES} robot/assets/templates/policy +${DROOLS_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_DROOLS_SERVER_PORT} *** Keywords *** @@ -30,6 +31,18 @@ Run Policy Health Check \ Should Be Equal As Strings ${ELEMENT['code']} 200 \ Should Be True ${ELEMENT['healthy']} +Run Drools Get Request + [Documentation] Runs Drools Get Request + [Arguments] ${data_path} + ${auth}= Create List ${GLOBAL_DROOLS_USERNAME} ${GLOBAL_DROOLS_PASSWORD} + Log Creating session ${POLICY_ENDPOINT} + ${session}= Create Session policy ${DROOLS_ENDPOINT} auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Get Request policy ${data_path} headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + [Return] ${resp} + Run Policy Put Request [Documentation] Runs Policy Put request [Arguments] ${data_path} ${data} @@ -66,12 +79,16 @@ Update vVFWCL Policy [Arguments] ${resource_id} Run Keyword and Ignore Error Delete vFWCL Policy Sleep 20s + Log To Console Create vFWCL Policy Create vFWCL Policy ${resource_id} Sleep 5s + Log To Console Push vFWCL Policy Push vFWCL Policy Sleep 20s + Log To Console Reboot Drools Reboot Drools Sleep 20s + Log To Console Validate vFWCL Policy Validate the vFWCL Policy Delete vFWCL Policy diff --git a/robot/resources/test_templates/closedloop_test_template.robot b/robot/resources/test_templates/closedloop_test_template.robot index 0a0a8950..f83ce5b1 100644 --- a/robot/resources/test_templates/closedloop_test_template.robot +++ b/robot/resources/test_templates/closedloop_test_template.robot @@ -1,9 +1,11 @@ *** Settings *** Documentation Policy Closed Loop Test cases -Resource ../policy_interface.robot +Resource ../policy_interface.robot Resource ../stack_validation/policy_check_vfw.robot +Resource ../stack_validation/packet_generator_interface.robot Resource vnf_orchestration_test_template.robot + Library String Library HttpLibrary.HTTP LIbrary Process @@ -201,3 +203,30 @@ Orchestrate VNF vFW closedloop 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} + +VFWCL High Test + [Documentation] Test Control Loop for High Traffic + [Arguments] ${pkg_host} + Enable Streams ${pkg_host} 10 + :FOR ${i} IN RANGE 8 + \ Sleep 15s + \ ${resp}= Get List Of Enabled Streams ${pkg_host} + \ ${stream_count}= Evaluate len(${resp['sample-plugin']['pg-streams']['pg-stream']}) + \ Log To Console Number of steam: ${stream_count} + \ Exit For Loop If '${stream_count}'=='5' + Should Be Equal As Integers ${stream_count} 5 + +VFWCL Low Test + [Documentation] Test Control Loop for Low Traffic + [Arguments] ${pkg_host} + Enable Streams ${pkg_host} 1 + Get List Of Enabled Streams ${pkg_host} + :FOR ${i} IN RANGE 8 + \ Sleep 15s + \ ${resp}= Get List Of Enabled Streams ${pkg_host} + \ ${stream_count}= Evaluate len(${resp['sample-plugin']['pg-streams']['pg-stream']}) + \ Log To Console Number of steam: ${stream_count} + \ Exit For Loop If '${stream_count}'=='5' + Should Be Equal As Integers ${stream_count} 5 + + diff --git a/robot/testsuites/closed-loop.robot b/robot/testsuites/closed-loop.robot index 8f580da8..7e193010 100644 --- a/robot/testsuites/closed-loop.robot +++ b/robot/testsuites/closed-loop.robot @@ -13,3 +13,7 @@ VFW Closed Loop Test VDNS Closed Loop Test [TAGS] ete closedloop VDNS Policy +VFWCL Closed Loop Test + [TAGS] vfwclosedloop + VFWCL High Test ${pkg_host} + VFWCL Low Test ${pkg_host} diff --git a/robot/testsuites/demo.robot b/robot/testsuites/demo.robot index f3c5847b..216d3091 100644 --- a/robot/testsuites/demo.robot +++ b/robot/testsuites/demo.robot @@ -41,7 +41,7 @@ Instantiate VFW Instantiate VFWCL [Tags] instantiateVFWCL - Instantiate VNF vFWCL + Instantiate VNF vFWCL base_vpkg Delete Instantiated VNF |