aboutsummaryrefslogtreecommitdiffstats
path: root/robot/resources/sdngc_interface.robot
diff options
context:
space:
mode:
authorBrian Freeman <bf1936@att.com>2019-02-13 13:54:48 -0500
committerBrian Freeman <bf1936@att.com>2019-02-13 13:54:55 -0500
commit12ff1844383b99b7b7efa8aae5bef8361bd163b1 (patch)
tree080f055b5ce96422cccf265a5fd5f13b7788d7cb /robot/resources/sdngc_interface.robot
parent992832a29265fd57bdb3d2cb67f956e38790a498 (diff)
Fix dynamic service_mappin
Issue-ID: INT-883 Change-Id: Ia29b4468eaf68f0352f8dd6c84c382c5431beab2 Signed-off-by: Brian Freeman <bf1936@att.com>
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}