Adding robot tests to validate Feature 10944 change naming of charms
[osm/tests.git] / robot-systest / lib / juju_lib.robot
index 62f557e..8cc450c 100644 (file)
@@ -32,3 +32,32 @@ Get Model Name
     ${model_name}=   Set Variable   ${kdu_name}-${ns_id}
     Should Be Equal As Strings   ${model_name}   ${stdout}
     [Return]   ${stdout}
+
+Get Application Name VDU Level Charm
+    [Arguments]   ${host}   ${username}   ${password}   ${privatekey}   ${model_name}   ${vdu_profile_id}   ${ee_name}
+
+    Should Not Be Empty   ${model_name}
+    ${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]   ${host}   ${username}   ${password}   ${privatekey}   ${model_name}   ${charm_name}
+
+    Should Not Be Empty   ${model_name}
+    ${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}
+
+    Should Not Be Empty   ${model_name}
+    ${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