Bug 2327 fix to verify ipaddress in sol003_02 testsuite
[osm/tests.git] / robot-systest / lib / ns_lib.resource
index 9d7276f..ab763e1 100644 (file)
@@ -35,9 +35,9 @@ Create Network Service
     ${ns_launch_max_wait_time}=   Convert Time   ${ns_launch_max_wait_time}   result_format=number
     ${ns_launch_max_wait_time}=   Evaluate   ${ns_launch_max_wait_time} * ${VIM_TIMEOUT_MULTIPLIER}
     Log   ${ns_launch_max_wait_time}
-    ${config_attr}=   Set Variable If   "${ns_config}" != "${EMPTY}"   --config '${ns_config}'   ${EMPTY}
-    ${sshkeys_attr}=   Set Variable If   "${publickey}" != "${EMPTY}"   --ssh_keys ${publickey}   ${EMPTY}
-    ${config_file_attr}=   Set Variable If   "${config_file}" != "${EMPTY}"   --config_file '${config_file}'   ${EMPTY}
+    ${config_attr}=   Set Variable If   '${ns_config}'!='${EMPTY}'   --config '${ns_config}'   ${EMPTY}
+    ${sshkeys_attr}=   Set Variable If   '${publickey}'!='${EMPTY}'   --ssh_keys ${publickey}   ${EMPTY}
+    ${config_file_attr}=   Set Variable If   '${config_file}'!='${EMPTY}'   --config_file '${config_file}'   ${EMPTY}
     ${ns_id}=   Instantiate Network Service   ${ns_name}   ${nsd}   ${vim_name}   ${config_attr} ${sshkeys_attr} ${config_file_attr}
     Log   ${ns_id}
     Wait Until Keyword Succeeds   ${ns_launch_max_wait_time}   ${NS_LAUNCH_POL_TIME}   Check For NS Instance To Configured   ${ns_name}
@@ -212,10 +212,18 @@ Get VDU Affinity Group Name
     Should Be Equal As Integers   ${rc}   ${SUCCESS_RETURN_CODE}   msg=${affinity_group_name}   values=False
     RETURN   ${affinity_group_name}
 
-GET Dual Ip
+Get Dual Ip
     [Documentation]   Get dual ip from the ns list
     [Arguments]   ${ns_id}
     Should Not Be Empty   ${ns_id}
-    ${rc}   ${stdout}=   Run And Return RC And Output   osm ns-show ${ns_id} --literal | grep -A2 ip-address | awk '{print $2}' | paste -sd ',' | sed 's/^,//; s/,/, /g' | sed 's/^/[/; s/$/]/'
+    ${rc}   ${stdout}=   Run And Return RC And Output   osm ns-show ${ns_id} --literal | grep -A2 ip-address | grep -v "ip-address:" | awk '{print $2}' | tr -d ',-'
     Log   ${rc},${stdout}
     RETURN   ${stdout}
+
+Get NSD Id From The NS
+    [Documentation]   Get the nsd id from the ns
+    [Arguments]   ${ns_id}
+    Should Not Be Empty   ${ns_id}
+    ${stdout}=   Run   osm ns-show ${ns_id} --literal | grep nsd-id | awk '{print $2}'
+    Log   ${stdout}
+    RETURN   ${stdout}