diff --git a/kuryr_tempest_plugin/tests/scenario/base.py b/kuryr_tempest_plugin/tests/scenario/base.py index 7503f6ad..b481af72 100644 --- a/kuryr_tempest_plugin/tests/scenario/base.py +++ b/kuryr_tempest_plugin/tests/scenario/base.py @@ -207,20 +207,22 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest): return kuryr_if['versioned_object.data']['id'] def exec_command_in_pod(self, pod_name, command, namespace="default", - stderr=False): + stderr=False, container=None): api = self.k8s_client.CoreV1Api() + kwargs = dict(command=command, stdin=False, stdout=True, tty=False, + stderr=stderr) + if container is not None: + kwargs['container'] = container if stderr: + kwargs['_preload_content'] = False resp = stream(api.connect_get_namespaced_pod_exec, pod_name, - namespace, command=command, stderr=True, - stdin=False, stdout=True, tty=False, - _preload_content=False) + namespace, **kwargs) # Run until completion resp.run_forever() return resp.read_stdout(), resp.read_stderr() else: return stream(api.connect_get_namespaced_pod_exec, pod_name, - namespace, command=command, stderr=False, - stdin=False, stdout=True, tty=False) + namespace, **kwargs) def assign_fip_to_pod(self, pod_name, namespace="default"): ext_net_id = CONF.network.public_network_id diff --git a/kuryr_tempest_plugin/tests/scenario/test_daemon.py b/kuryr_tempest_plugin/tests/scenario/test_daemon.py index a63afb60..a332388f 100644 --- a/kuryr_tempest_plugin/tests/scenario/test_daemon.py +++ b/kuryr_tempest_plugin/tests/scenario/test_daemon.py @@ -36,9 +36,11 @@ class TestKuryrDaemon(base.BaseKuryrScenarioTest): namespace = CONF.kuryr_kubernetes.kube_system_namespace kube_system_pods = self.get_pod_name_list( namespace=namespace) - cmd = ["ps", "aux"] + cmd = ['cat', '/proc/1/cmdline'] for kuryr_pod_name in kube_system_pods: if kuryr_pod_name.startswith('kuryr-cni'): - self.assertIn('kuryr-daemon', self.exec_command_in_pod( - kuryr_pod_name, cmd, namespace)) + self.assertIn( + 'kuryr-daemon --config-file', + self.exec_command_in_pod(kuryr_pod_name, cmd, namespace, + container='kuryr-cni'))