diff options
Diffstat (limited to 'robot/resources/test_templates')
3 files changed, 33 insertions, 31 deletions
diff --git a/robot/resources/test_templates/closedloop_test_template.robot b/robot/resources/test_templates/closedloop_test_template.robot index e43233e0..15686a11 100644 --- a/robot/resources/test_templates/closedloop_test_template.robot +++ b/robot/resources/test_templates/closedloop_test_template.robot @@ -5,7 +5,7 @@ Resource ../stack_validation/policy_check_vfw.robot Library String Library Process -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating Library ONAPLibrary.Utilities *** Variables *** @@ -73,8 +73,8 @@ Get Configs VFW Policy [Documentation] Get Config Policy for VFW ${getconfigpolicy}= Catenate .*${CONFIG_POLICY_NAME}* ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} - Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} - ${output}= Apply Template cl ${GECONFIG_VFW_TEMPLATE} ${configpolicy_name} + Templating.Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} + ${output}= Templating.Apply Template cl ${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 ${config}= Catenate ${get_resp.json()[0]["config"]} @@ -94,8 +94,8 @@ Get Configs VDNS Policy [Documentation] Get Config Policy for VDNS ${getconfigpolicy}= Catenate .*MicroServicevDNS* ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} - Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} - ${output}= Apply Template cl ${GECONFIG_VFW_TEMPLATE} ${configpolicy_name} + Templating.Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} + ${output}= Templating.Apply Template cl ${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 ${config}= Catenate ${get_resp.json()[0]["config"]} @@ -119,8 +119,8 @@ Create Config Policy ${policyname1}= Catenate com.${randompolicyname} ${CONFIG_POLICY_NAME}= Set Test Variable ${policyname1} ${configpolicy}= Create Dictionary policy_name=${CONFIG_POLICY_NAME} - Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} - ${output}= Apply Template cl ${CREATE_CONFIG_TEMPLATE} ${configpolicy} + Templating.Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} + ${output}= Templating.Apply Template cl ${CREATE_CONFIG_TEMPLATE} ${configpolicy} ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} Should Be Equal As Strings ${put_resp.status_code} 200 @@ -137,8 +137,8 @@ Create Ops Policy ${policyname1}= Catenate com.${randompolicyname} ${OPS_POLICY_NAME}= Set Test Variable ${policyname1} ${dict}= Create Dictionary policy_name=${OPS_POLICY_NAME} - Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} - ${output}= Apply Template cl ${CREATE_OPS_TEMPLATE} ${dict} + Templating.Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} + ${output}= Templating.Apply Template cl ${CREATE_OPS_TEMPLATE} ${dict} ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} Log ${put_resp} Should Be Equal As Strings ${put_resp.status_code} 200 @@ -147,8 +147,8 @@ Push Ops Policy [Documentation] Push Ops Policy [Arguments] ${policyname} ${policytype} ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} - Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} - ${output}= Apply Template cl ${PUSH_POLICY_TEMPLATE} ${dict} + Templating.Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} + ${output}= Templating.Apply Template cl ${PUSH_POLICY_TEMPLATE} ${dict} ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} Should Be Equal As Strings ${put_resp.status_code} 200 @@ -156,8 +156,8 @@ Push Config Policy [Documentation] Push Config Policy [Arguments] ${policyname} ${policytype} ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} - Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} - ${output}= Apply Template cl ${PUSH_POLICY_TEMPLATE} ${dict} + Templating.Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} + ${output}= Templating.Apply Template cl ${PUSH_POLICY_TEMPLATE} ${dict} ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} Should Be Equal As Strings ${put_resp.status_code} 200 @@ -167,8 +167,8 @@ Delete Config Policy [Arguments] ${policy_name} ${policyname3}= Catenate com.Config_BRMS_Param_${policyname}.1.xml ${dict}= Create Dictionary policy_name=${policyname3} - Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} - ${output}= Apply Template cl ${DEL_POLICY_TEMPLATE} ${dict} + Templating.Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} + ${output}= Templating.Apply Template cl ${DEL_POLICY_TEMPLATE} ${dict} ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} Should Be Equal As Strings ${put_resp.status_code} 200 @@ -177,8 +177,8 @@ Delete Ops Policy [Arguments] ${policy_name} ${policyname3}= Catenate com.Config_MS_com.vFirewall.1.xml ${dict}= Create Dictionary policy_name=${policyname3} - Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} - ${output}= Apply Template cl ${DEL_POLICY_TEMPLATE} ${dict} + Templating.Create Environment cl ${GLOBAL_TEMPLATE_FOLDER} + ${output}= Templating.Apply Template cl ${DEL_POLICY_TEMPLATE} ${dict} ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} Should Be Equal As Strings ${put_resp.status_code} 200 diff --git a/robot/resources/test_templates/pnf_registration_without_SO_template.robot b/robot/resources/test_templates/pnf_registration_without_SO_template.robot index 497bbeb2..950634c3 100644 --- a/robot/resources/test_templates/pnf_registration_without_SO_template.robot +++ b/robot/resources/test_templates/pnf_registration_without_SO_template.robot @@ -8,8 +8,8 @@ Library RequestsLibrary Library Collections Library ONAPLibrary.JSON Library ONAPLibrary.Utilities -Library ONAPLibrary.Templating - +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** ${aai_so_registration_entry_template}= aai/add_pnf_registration_info.jinja @@ -30,20 +30,21 @@ Create A&AI antry without SO and succesfully registrate PNF Create PNF initial entry in A&AI [Documentation] Creates PNF initial entry in A&AI registry. Entry contains only correlation id (pnf-name) [Arguments] ${PNF_entry_dict} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${template}= Apply Template aai ${aai_so_registration_entry_template} ${PNF_entry_dict} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${template}= Templating.Apply Template aai ${aai_so_registration_entry_template} ${PNF_entry_dict} Log Filled A&AI entry template ${template} ${correlation_id}= Get From Dictionary ${PNF_entry_dict} correlation_id ${del_resp}= Delete A&AI Entity /network/pnfs/pnf/${PNF_entry_dict.correlation_id} Log Removing existing entry "${PNF_entry_dict.correlation_id}" from A&AI registry - ${put_resp}= Run A&AI Put Request /aai/v11/network/pnfs/pnf/${PNF_entry_dict.correlation_id} ${template} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} /aai/v11/network/pnfs/pnf/${PNF_entry_dict.correlation_id} ${template} auth=${auth} Log Adding new entry with correlation ID "${PNF_entry_dict.correlation_id}" to A&AI registry (empty IPv4 and IPv6 address) Send VES integration request [Documentation] Send VES integration request. Request contains correlation id (sourceName), oamV4IpAddress and oamV6IpAddress [Arguments] ${PNF_entry_dict} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${template}= Apply Template aai ${pnf_ves_integration_request} ${PNF_entry_dict} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${template}= Templating.Apply Template aai ${pnf_ves_integration_request} ${PNF_entry_dict} ${post_resp}= Run VES HTTP Post Request ${template} Should Be Equal As Strings ${post_resp.status_code} 202 Log VES integration request has been send @@ -63,7 +64,8 @@ Verify PNF integration request in MR Query PNF A&AI updated entry [Documentation] Query PNF A&AI updated entry [Arguments] ${PNF_entry_dict} - ${get_resp}= Run A&AI Get Request /aai/v11/network/pnfs/pnf/${PNF_entry_dict.correlation_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} /aai/v11/network/pnfs/pnf/${PNF_entry_dict.correlation_id} auth=${auth} Should Be Equal As Strings ${get_resp.status_code} 200 ${json_resp}= Set Variable ${get_resp.json()} Log JSON recieved from A&AI endpoint ${json_resp} diff --git a/robot/resources/test_templates/vnf_orchestration_with_cds_test_template.robot b/robot/resources/test_templates/vnf_orchestration_with_cds_test_template.robot index ec746ff0..537dc5f1 100644 --- a/robot/resources/test_templates/vnf_orchestration_with_cds_test_template.robot +++ b/robot/resources/test_templates/vnf_orchestration_with_cds_test_template.robot @@ -22,7 +22,7 @@ Resource ../so_interface.robot Library ONAPLibrary.Openstack Library ONAPLibrary.Utilities -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating Library Collections Library String Library ONAPLibrary.JSON @@ -68,7 +68,7 @@ Orchestrate VNF With CDS ${vnfs}= Get From Dictionary ${jsondata['topology_template']} node_templates ${keys}= Get Dictionary Keys ${vnfs} - Create Environment cds ${GLOBAL_TEMPLATE_FOLDER} + Templating.Create Environment cds ${GLOBAL_TEMPLATE_FOLDER} :FOR ${key} IN @{keys} \ ${vnf}= Get From Dictionary ${vnfs} ${key} \ Get VNF Info ${key} ${vnf} ${dict} @@ -77,11 +77,11 @@ Orchestrate VNF With CDS \ ${value}= Convert To Lowercase ${value} \ ${vfmodules}= Get VFModule Info ${jsondata} ${value} ${dict} \ Set To Dictionary ${dict} vf_modules=${vfmodules} - \ ${vnf_payload}= Apply Template cds ${vnf_template_name} ${dict} + \ ${vnf_payload}= Templating.Apply Template cds ${vnf_template_name} ${dict} \ ${data}= Catenate [${vnf_payload}] Set To Dictionary ${dict} vnfs=${data} - ${request}= Apply Template cds ${so_request_template} ${dict} + ${request}= Templating.Apply Template cds ${so_request_template} ${dict} Log --------request-------- Log ${request} Log --------end request-------- @@ -114,12 +114,12 @@ Get VFModule Info ${keys}= Get Dictionary Keys ${vfModules} ${data}= Catenate ${delim}= Catenate - Create Environment cds ${GLOBAL_TEMPLATE_FOLDER} + Templating.Create Environment cds ${GLOBAL_TEMPLATE_FOLDER} :FOR ${key} IN @{keys} \ ${module}= Get From Dictionary ${vfModules} ${key} \ Log ${vnf} ${key} \ Run keyword if "${vnf}" in "${key}" set vfmodule param ${key} ${module} ${dict} - \ ${vfmodule_payload}= Apply Template cds ${vfmodule_template_name} ${dict} + \ ${vfmodule_payload}= Templating.Apply Template cds ${vfmodule_template_name} ${dict} \ ${data}= Catenate ${data} ${delim} ${vfmodule_payload} \ ${delim}= Catenate , Log ${data} |