From 2b88dd53da32954ca8ec585d4dcae6cc977af40f Mon Sep 17 00:00:00 2001 From: Eduardo Olivares Date: Mon, 24 Jun 2024 10:40:14 +0200 Subject: [PATCH] Skip capturing traffic on auxiliary nodes When a node is not controller, compute or networker, the _start_captures function should not capture traffic on it. A previous patch added a log saying that traffic was not captured on that node, but after that a tcpdump process started capturing traffic on a different node. Change-Id: I677225e661df7464f9121c6201cbf260da540b19 --- whitebox_neutron_tempest_plugin/tests/scenario/base.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/base.py b/whitebox_neutron_tempest_plugin/tests/scenario/base.py index 72ff8ad..faf3968 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/base.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/base.py @@ -1028,6 +1028,7 @@ class TrafficFlowTest(BaseTempestWhiteboxTestCase): node['is_networker']): LOG.debug('Traffic is not captured on node %s because it is ' 'not: controller, compute, networker', node['name']) + continue elif (WB_CONF.openstack_type == 'podified' and node['is_controller']): capture_client = self.proxy_host_client @@ -1049,7 +1050,8 @@ class TrafficFlowTest(BaseTempestWhiteboxTestCase): def _stop_captures(self): for node in self.nodes: - node['capture'].stop() + if node.get('capture'): + node['capture'].stop() def check_east_west_icmp_flow( self, dst_ip, expected_routing_nodes, expected_macs, ssh_client): @@ -1090,7 +1092,8 @@ class TrafficFlowTest(BaseTempestWhiteboxTestCase): ','.join(expected_routing_nodes))) actual_routing_nodes = [node['name'] for node in self.nodes if - not node['capture'].is_empty()] + (node.get('capture') and + not node['capture'].is_empty())] LOG.debug('Actual routing nodes: {}'.format( ','.join(actual_routing_nodes))) self.assertCountEqual(expected_routing_nodes, actual_routing_nodes) @@ -1143,7 +1146,8 @@ class TrafficFlowTest(BaseTempestWhiteboxTestCase): LOG.debug('Expected routing nodes: {}'.format(expected_routing_nodes)) actual_routing_nodes = [node['name'] for node in self.nodes if - not node['capture'].is_empty()] + (node.get('capture') and + not node['capture'].is_empty())] LOG.debug('Actual routing nodes: {}'.format( ','.join(actual_routing_nodes))) self.assertCountEqual(expected_routing_nodes, actual_routing_nodes)