[VOL-3897] Software Minor Version Upgrades Tests Enhancement
Change-Id: Icc2430a675e5e0c3654d00613ceba07c72125903
diff --git a/libraries/k8s.robot b/libraries/k8s.robot
index a8312e6..1bb8217 100755
--- a/libraries/k8s.robot
+++ b/libraries/k8s.robot
@@ -496,3 +496,16 @@
${output}= Run
... kubectl -n ${namespace} get pods -l ${key}=${value} -o=jsonpath="{.items[].status.containerStatuses[].image}"
Should Be Equal '${output}' 'docker.io/${image}'
+
+Get Pod Image And App Version And Helm Chart By Label
+ [Arguments] ${namespace} ${key} ${value}
+ [Documentation] Retrieves Pod Image and, App and Helm Chart Version details
+ ${image}= Run
+ ... kubectl -n ${namespace} get pods -l ${key}=${value} -o=jsonpath="{.items[*].spec.containers[*].image}"
+ ${cmd}= Catenate SEPARATOR=
+ ... kubectl -n ${namespace} get pods -l ${key}=${value} -o=
+ ... jsonpath="{.items[*].metadata.labels.\\app\\.kubernetes\\.io\\/version}"
+ ${app_version}= Run ${cmd}
+ ${helm_chart}= Run
+ ... kubectl -n ${namespace} get pods -l ${key}=${value} -o=jsonpath="{.items[*].metadata.labels.\\helm\\.sh\\/chart}"
+ [Return] ${image} ${app_version} ${helm_chart}
diff --git a/libraries/onos.robot b/libraries/onos.robot
index b242e19..ffc30da 100755
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -731,3 +731,11 @@
${rc} ${output} Run And Return Rc And Output ${cmd}
Should Be Equal As Integers ${rc} 0
Log ${output}
+
+Get ONOS App Details
+ [Arguments] ${url} ${app_name}
+ [Documentation] Retrieves ONOS App Details
+ ${rc} ${output} Run And Return Rc And Output
+ ... curl --fail -sSL ${url}/onos/v1/applications/${app_name}
+ Should Be Equal As Integers ${rc} 0
+ [Return] ${output}