From 01b2947724030b15445e2e78ce6e3ff51bc4645c Mon Sep 17 00:00:00 2001 From: Guillermo Calvino Date: Fri, 18 Nov 2022 16:52:50 +0100 Subject: [PATCH] Bug 2194: OSM_HOSTNAME variable doesn't get the IP of the host when robot tests are used with Charmed OSM Change-Id: I96882f584dcdab60cafa27edcf7dbdae7fb65a4b Signed-off-by: Guillermo Calvino --- robot-systest/lib/juju_lib.robot | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/robot-systest/lib/juju_lib.robot b/robot-systest/lib/juju_lib.robot index 8cc450c..b125679 100644 --- a/robot-systest/lib/juju_lib.robot +++ b/robot-systest/lib/juju_lib.robot @@ -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} @@ -34,9 +36,10 @@ Get Model Name [Return] ${stdout} Get Application Name VDU Level Charm - [Arguments] ${host} ${username} ${password} ${privatekey} ${model_name} ${vdu_profile_id} ${ee_name} + [Arguments] ${endpoint} ${username} ${password} ${privatekey} ${model_name} ${vdu_profile_id} ${ee_name} Should Not Be Empty ${model_name} + ${host}= Remove String Using Regexp ${endpoint} :([0-9]+)$ ${stdout}= Execute Remote Command Check Rc Return Output ${host} ${username} ${password} ${privatekey} juju status -m ${model_name} | grep "\\-vdu" | grep -v "*" | grep -i ${vdu_profile_id} | cut -f1 -d " " log ${stdout} Should Not Be Empty ${stdout} @@ -44,18 +47,20 @@ Get Application Name VDU Level Charm [Return] ${stdout} Get Application Name NS Level Charm - [Arguments] ${host} ${username} ${password} ${privatekey} ${model_name} ${charm_name} + [Arguments] ${endpoint} ${username} ${password} ${privatekey} ${model_name} ${charm_name} Should Not Be Empty ${model_name} + ${host}= Remove String Using Regexp ${endpoint} :([0-9]+)$ ${stdout}= Execute Remote Command Check Rc Return Output ${host} ${username} ${password} ${privatekey} juju status -m ${model_name} | grep "\\-ns" | grep -v "*" | grep -i ${charm_name} | cut -f1 -d " " log ${stdout} Should Not Be Empty ${stdout} [Return] ${stdout} Get Application Name VNF Level Charm - [Arguments] ${host} ${username} ${password} ${privatekey} ${model_name} ${vnf_profile_id} ${ee_name} + [Arguments] ${endpoint} ${username} ${password} ${privatekey} ${model_name} ${vnf_profile_id} ${ee_name} Should Not Be Empty ${model_name} + ${host}= Remove String Using Regexp ${endpoint} :([0-9]+)$ ${stdout}= Execute Remote Command Check Rc Return Output ${host} ${username} ${password} ${privatekey} juju status -m ${model_name} | grep "\\-vnf" | grep -v "*" | grep -i ${vnf_profile_id} | cut -f1 -d " " log ${stdout} Should Not Be Empty ${stdout} -- 2.17.1