Bug 2194: OSM_HOSTNAME variable doesn't get the IP of the host when robot tests are... 18/12718/2 v10.1.3
authorGuillermo Calvino <guillermo.calvino@canonical.com>
Fri, 18 Nov 2022 15:52:50 +0000 (16:52 +0100)
committerGuillermo Calvino <guillermo.calvino@canonical.com>
Fri, 25 Nov 2022 09:11:31 +0000 (10:11 +0100)
Change-Id: I96882f584dcdab60cafa27edcf7dbdae7fb65a4b
Signed-off-by: Guillermo Calvino <guillermo.calvino@canonical.com>
robot-systest/lib/juju_lib.robot

index 94db455..27601cc 100644 (file)
@@ -16,17 +16,19 @@ ${success_return_code}   0
 
 *** Keywords ***
 Get Scale Number
-    [Arguments]   ${host}   ${username}   ${password}   ${privatekey}   ${application_name}   ${model_name}
+    [Arguments]   ${endpoint}   ${username}   ${password}   ${privatekey}   ${application_name}   ${model_name}
 
     Should Not Be Empty   ${application_name}   ${model_name}
+    ${host}=   Remove String Using Regexp   ${endpoint}   :([0-9]+)$
     ${stdout}=   Execute Remote Command Check Rc Return Output   ${host}   ${username}   ${password}   ${privatekey}   juju show-status ${application_name} --format yaml -m ${model_name} | grep scale | awk -F ': ' '{print $2}'
     log   ${stdout}
     [Return]  ${stdout}
 
 Get Model Name
-    [Arguments]   ${host}   ${username}   ${password}   ${privatekey}   ${ns_id}   ${kdu_name}
+    [Arguments]   ${endpoint}   ${username}   ${password}   ${privatekey}   ${ns_id}   ${kdu_name}
 
     Should Not Be Empty   ${ns_id}   ${kdu_name}
+    ${host}=   Remove String Using Regexp   ${endpoint}   :([0-9]+)$
     ${stdout}=   Execute Remote Command Check Rc Return Output   ${host}   ${username}   ${password}   ${privatekey}   juju models | grep -i ${kdu_name} | grep -i ${ns_id} | cut -f1 -d " "
     log   ${stdout}
     ${model_name}=   Set Variable   ${kdu_name}-${ns_id}