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
This commit is contained in:
Eduardo Olivares 2024-06-24 10:40:14 +02:00
parent 9c71eed490
commit 2b88dd53da

View File

@ -1028,6 +1028,7 @@ class TrafficFlowTest(BaseTempestWhiteboxTestCase):
node['is_networker']): node['is_networker']):
LOG.debug('Traffic is not captured on node %s because it is ' LOG.debug('Traffic is not captured on node %s because it is '
'not: controller, compute, networker', node['name']) 'not: controller, compute, networker', node['name'])
continue
elif (WB_CONF.openstack_type == 'podified' and elif (WB_CONF.openstack_type == 'podified' and
node['is_controller']): node['is_controller']):
capture_client = self.proxy_host_client capture_client = self.proxy_host_client
@ -1049,7 +1050,8 @@ class TrafficFlowTest(BaseTempestWhiteboxTestCase):
def _stop_captures(self): def _stop_captures(self):
for node in self.nodes: for node in self.nodes:
node['capture'].stop() if node.get('capture'):
node['capture'].stop()
def check_east_west_icmp_flow( def check_east_west_icmp_flow(
self, dst_ip, expected_routing_nodes, expected_macs, ssh_client): self, dst_ip, expected_routing_nodes, expected_macs, ssh_client):
@ -1090,7 +1092,8 @@ class TrafficFlowTest(BaseTempestWhiteboxTestCase):
','.join(expected_routing_nodes))) ','.join(expected_routing_nodes)))
actual_routing_nodes = [node['name'] actual_routing_nodes = [node['name']
for node in self.nodes if 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( LOG.debug('Actual routing nodes: {}'.format(
','.join(actual_routing_nodes))) ','.join(actual_routing_nodes)))
self.assertCountEqual(expected_routing_nodes, 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)) LOG.debug('Expected routing nodes: {}'.format(expected_routing_nodes))
actual_routing_nodes = [node['name'] actual_routing_nodes = [node['name']
for node in self.nodes if 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( LOG.debug('Actual routing nodes: {}'.format(
','.join(actual_routing_nodes))) ','.join(actual_routing_nodes)))
self.assertCountEqual(expected_routing_nodes, actual_routing_nodes) self.assertCountEqual(expected_routing_nodes, actual_routing_nodes)