Skip to content

Commit

Permalink
tests: Skip DR root reuse test if counters are not supported
Browse files Browse the repository at this point in the history
Add a query to check counter support on flow tables for root reuse DR
test. Skip the test if not supported.

Signed-off-by: Daria Velikovsky <[email protected]>
Signed-off-by: Edward Srouji <[email protected]>
  • Loading branch information
dariavel authored and EdwardSro committed Feb 12, 2025
1 parent 5e8dc11 commit fede944
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_mlx5_dr.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ def func_wrapper(instance):
return func_wrapper


def requires_flow_counter_support(func):
def func_wrapper(instance):
nic_tbl_caps = u.query_nic_flow_table_caps(instance)
rx_counter_support = nic_tbl_caps.flow_table_properties_nic_receive.flow_counter
tx_counter_support = nic_tbl_caps.flow_table_properties_nic_transmit.flow_counter
if not (rx_counter_support and tx_counter_support):
raise unittest.SkipTest('NIC flow tables do not support counter action')
return func(instance)
return func_wrapper


class Mlx5DrResources(RawResources):
"""
Test various functionalities of the mlx5 direct rules class.
Expand Down Expand Up @@ -1368,6 +1379,7 @@ def reuse_action_and_matcher(self, root_only=False):
self.assertEqual(matched_packets_rx, self.iters, 'Reuse action or matcher failed on RX')

@skip_unsupported
@requires_flow_counter_support
def test_root_reuse_action_and_matcher(self):
"""
Create root rules on TX and RX that use the same matcher and actions
Expand Down

0 comments on commit fede944

Please sign in to comment.