summaryrefslogtreecommitdiffstats
path: root/robot/resources/sdngc_interface.robot
diff options
context:
space:
mode:
Diffstat (limited to 'robot/resources/sdngc_interface.robot')
-rw-r--r--robot/resources/sdngc_interface.robot16
1 files changed, 14 insertions, 2 deletions
diff --git a/robot/resources/sdngc_interface.robot b/robot/resources/sdngc_interface.robot
index b311e9bd..7be6e153 100644
--- a/robot/resources/sdngc_interface.robot
+++ b/robot/resources/sdngc_interface.robot
@@ -88,7 +88,11 @@ Preload Vnf
${templates}= Get From Dictionary ${GLOBAL_SERVICE_TEMPLATE_MAPPING} ${service}
:for ${vf_module} in @{vf_modules}
\ ${vf_module_type}= Get From Dictionary ${vf_module} name
- \ ${dict} Get From Mapping ${templates} ${vf_module}
+ # need to pass in vnf_index if non-zero
+ \ ${dict} Run Keyword If "${generic_vnf_name}".endswith('0') Get From Mapping With Index ${templates} ${vf_module} 0
+ \ ... ELSE IF "${generic_vnf_name}".endswith('1') Get From Mapping With Index ${templates} ${vf_module} 1
+ \ ... ELSE IF "${generic_vnf_name}".endswith('2') Get From Mapping With Index ${templates} ${vf_module} 2
+ \ ... ELSE Get From Mapping ${templates} ${vf_module}
\ ${filename}= Get From Dictionary ${dict} template
\ ${base_vf_module_type}= Set Variable If '${dict['isBase']}' == 'true' ${vf_module_type} ${base_vf_module_type}
\ ${closedloop_vf_module}= Set Variable If '${dict['isBase']}' == 'false' ${vf_module} ${closedloop_vf_module}
@@ -105,6 +109,14 @@ Update Module Name
${name}= Replace String ${vf_module_name} Vfmodule_ ${dict['prefix']}
[Return] ${name}
+Get From Mapping With Index
+ [Documentation] Retrieve the appropriate prelad template entry for the passed vf_module
+ [Arguments] ${templates} ${vf_module} ${vnf_index}=0
+ ${vf_module_name}= Get From DIctionary ${vf_module} name
+ :for ${template} in @{templates}
+ \ Return From Keyword If '${template['name_pattern']}' in '${vf_module_name}' and ('${template['vnf_index']}' == '${vnf_index}') ${template}
+ [Return] None
+
Get From Mapping
[Documentation] Retrieve the appropriate prelad template entry for the passed vf_module
[Arguments] ${templates} ${vf_module}
@@ -237,4 +249,4 @@ Login To SDNGC Admin GUI
Input Password xpath=//input[@id='password'] ${shortened_uuid}
Click Button xpath=//button[@type='submit']
Title Should Be SDN-C AdminPortal
- Log Logged in to ${SDNGC_ADMIN_LOGIN_URL} \ No newline at end of file
+ Log Logged in to ${SDNGC_ADMIN_LOGIN_URL}