Filter neutron pod more accurately
In case an inveronment has ironic-neutron pod or some neutron pod with statuses different than Running some tests may fail. This patch makes filtering of neutron pod more strict in order to ensure only a relevant pod is returned. Change-Id: I7bd3ab6d0e3a89bf07cd91ff559110151bad4ae2
This commit is contained in:
parent
bae18298a8
commit
578e65a8d4
@ -304,11 +304,12 @@ class BaseTempestWhiteboxTestCase(base.BaseTempestTestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_pod_of_service(cls, service='neutron'):
|
def get_pod_of_service(cls, service='neutron'):
|
||||||
pods_list = "{} get pods".format(cls.OC)
|
pods_list = ("{} get pods -o=name "
|
||||||
|
"--field-selector=status.phase=Running".format(cls.OC))
|
||||||
if service == 'neutron':
|
if service == 'neutron':
|
||||||
filters = "grep neutron | grep -v meta | cut -d' ' -f1"
|
filters = "cut -d'/' -f 2 | grep ^neutron | grep -v meta"
|
||||||
else:
|
else:
|
||||||
filters = "grep {} | cut -d' ' -f1".format(service)
|
filters = "cut -d'/' -f 2 | grep {}".format(service)
|
||||||
return cls.proxy_host_client.exec_command(
|
return cls.proxy_host_client.exec_command(
|
||||||
"{} | {}".format(pods_list, filters)).strip()
|
"{} | {}".format(pods_list, filters)).strip()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user