X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=Automation%2FTests%2FScripts%2Fk8s_helper.py;h=a1cce5fc9628456e1144752e023ea9a786414513;hb=refs%2Fchanges%2F94%2F4494%2F1;hp=2a849435ee47516892e43825cf434be1fe2c3804;hpb=35766cc8a70ee08c8cded89dee889d9e11036da5;p=ric-plt%2Fe2mgr.git diff --git a/Automation/Tests/Scripts/k8s_helper.py b/Automation/Tests/Scripts/k8s_helper.py index 2a84943..a1cce5f 100644 --- a/Automation/Tests/Scripts/k8s_helper.py +++ b/Automation/Tests/Scripts/k8s_helper.py @@ -29,4 +29,12 @@ def extract_service_ip(service_name): service_ip = subprocess.check_output(["/bin/bash", "-c", k8s_command], universal_newlines=True) - return service_ip.strip() \ No newline at end of file + return service_ip.strip() + +def extract_pod_name(pod_base_name): + k8s_command = "kubectl get pods -n ricplt | /bin/grep {} | /bin/grep Running | awk \'{{print $1}}\'" \ + .format(pod_base_name) + + pod_name = subprocess.check_output(["/bin/bash", "-c", k8s_command], universal_newlines=True) + + return pod_name.strip() \ No newline at end of file