X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Flib%2Fjuju_lib.robot;h=45208a8b82b48805d78f17854ec3b1e38e1f7fa4;hb=43f34481b4c5ccfda407a7f82a124012aab0dccc;hp=2eab9bf0bbf7a076088d886ffdefd204b72cf613;hpb=f47542be165ebd69b91945041697181b4df63954;p=osm%2Ftests.git diff --git a/robot-systest/lib/juju_lib.robot b/robot-systest/lib/juju_lib.robot index 2eab9bf..45208a8 100644 --- a/robot-systest/lib/juju_lib.robot +++ b/robot-systest/lib/juju_lib.robot @@ -16,21 +16,53 @@ ${success_return_code} 0 *** Keywords *** Get Scale Number - [Arguments] ${application_name} ${model_name} + [Arguments] ${endpoint} ${username} ${password} ${privatekey} ${application_name} ${model_name} Should Not Be Empty ${application_name} ${model_name} - ${rc} ${stdout}= Run and Return RC and Output juju show-status ${application_name} --format yaml -m ${model_name} | grep scale | awk -F ': ' '{print $2}' - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + ${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] ${ns_id} ${kdu_name} + [Arguments] ${endpoint} ${username} ${password} ${privatekey} ${ns_id} ${kdu_name} Should Not Be Empty ${ns_id} ${kdu_name} - ${rc} ${stdout}= Run and Return RC and Output juju models | grep -i ${kdu_name} | grep -i ${ns_id} | cut -f1 -d " " - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} + ${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} Should Be Equal As Strings ${model_name} ${stdout} - [Return] ${stdout} \ No newline at end of file + [Return] ${stdout} + +Get Application Name VDU Level Charm + [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} + Should Contain ${stdout} ${ee_name} + [Return] ${stdout} + +Get Application Name NS Level Charm + [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] ${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} + Should Contain ${stdout} ${ee_name} + [Return] ${stdout} \ No newline at end of file