From 4d0babd5f22f0f6a125c149b00ad37b7e0e4f85a Mon Sep 17 00:00:00 2001 From: xwjiang-ms <96218837+xwjiang-ms@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:46:31 +0800 Subject: [PATCH] Use conditional mark to skip traffic test and remove temporary fixture (#14434) What is the motivation for this PR? Previously, we use temporary workaround #13602 to skip traffic test in VS platform because conditional mark could only match longest prefix, but now, it's fixed in #14395, so it would be better to use a common way -- conditional mark to skip traffic test but not hardcode How did you do it? Remove skip_traffic_test fixture in duthost_utils and use fixture in ptfhost_utils Add condition with tests need to skip traffic test in tests_mark_conditions_skip_traffic_test.yaml --- tests/acl/test_acl.py | 3 +- tests/common/fixtures/duthost_utils.py | 12 ---- ...sts_mark_conditions_skip_traffic_test.yaml | 66 +++++++++++++++++++ tests/copp/test_copp.py | 3 +- tests/decap/test_decap.py | 4 +- tests/drop_packets/drop_packets.py | 3 +- tests/drop_packets/test_drop_counters.py | 3 +- tests/dualtor/test_ipinip.py | 3 +- .../test_orchagent_active_tor_downstream.py | 4 +- tests/dualtor/test_orchagent_mac_move.py | 4 +- tests/dualtor/test_orchagent_slb.py | 3 +- .../test_orchagent_standby_tor_downstream.py | 18 +++-- .../test_standby_tor_upstream_mux_toggle.py | 5 +- tests/dualtor/test_tor_ecn.py | 3 +- tests/dualtor/test_tunnel_memory_leak.py | 3 +- tests/dualtor_io/test_heartbeat_failure.py | 3 +- tests/dualtor_io/test_link_drop.py | 3 +- tests/dualtor_io/test_link_failure.py | 3 +- tests/dualtor_io/test_normal_op.py | 3 +- tests/dualtor_io/test_tor_bgp_failure.py | 3 +- tests/dualtor_mgmt/test_ingress_drop.py | 3 +- tests/everflow/test_everflow_per_interface.py | 4 +- tests/everflow/test_everflow_testbed.py | 4 +- tests/fib/test_fib.py | 4 +- .../test_dynamic_acl.py | 5 +- tests/hash/test_generic_hash.py | 3 +- tests/ip/test_ip_packet.py | 4 +- tests/span/test_port_mirroring.py | 5 +- .../test_sub_port_interfaces.py | 3 +- tests/vlan/test_vlan_ping.py | 3 +- tests/vxlan/test_vnet_vxlan.py | 4 +- tests/vxlan/test_vxlan_bfd_tsa.py | 5 +- tests/vxlan/test_vxlan_decap.py | 3 +- tests/vxlan/test_vxlan_ecmp.py | 5 +- tests/vxlan/test_vxlan_ecmp_switchover.py | 6 +- 35 files changed, 111 insertions(+), 102 deletions(-) diff --git a/tests/acl/test_acl.py b/tests/acl/test_acl.py index 582e564515..98444902fe 100644 --- a/tests/acl/test_acl.py +++ b/tests/acl/test_acl.py @@ -19,8 +19,7 @@ from tests.common.plugins.loganalyzer.loganalyzer import LogAnalyzer, LogAnalyzerError from tests.common.config_reload import config_reload from tests.common.fixtures.ptfhost_utils import copy_arp_responder_py, run_garp_service, change_mac_addresses # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.dualtor.dual_tor_mock import mock_server_base_ip_addr # noqa F401 from tests.common.helpers.constants import DEFAULT_NAMESPACE from tests.common.utilities import wait_until, get_upstream_neigh_type, get_downstream_neigh_type, check_msg_in_syslog diff --git a/tests/common/fixtures/duthost_utils.py b/tests/common/fixtures/duthost_utils.py index b3842b7601..d2913307fd 100644 --- a/tests/common/fixtures/duthost_utils.py +++ b/tests/common/fixtures/duthost_utils.py @@ -849,15 +849,3 @@ def assert_addr_in_output(addr_set: Dict[str, List], hostname: str, pytest_assert(addr not in cmd_output, f"{hostname} {cmd_desc} still with addr {addr}") logger.info(f"{addr} not exists in the output of {cmd_desc} which is expected") - - -# Currently, conditional mark would only match longest prefix, -# so our mark in tests_mark_conditions_skip_traffic_test.yaml couldn't be matched. -# Use a temporary work around to add skip_traffic_test fixture here, -# once conditional mark support add all matches, will remove this code. -@pytest.fixture(scope="module") -def skip_traffic_test(duthosts, rand_one_dut_hostname): - duthost = duthosts[rand_one_dut_hostname] - if duthost.facts["asic_type"] == "vs": - return True - return False diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions_skip_traffic_test.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions_skip_traffic_test.yaml index 807181cab3..9fdc496466 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions_skip_traffic_test.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions_skip_traffic_test.yaml @@ -52,6 +52,15 @@ arp/test_wr_arp.py: conditions: - "asic_type in ['vs']" +####################################### +##### copp ##### +####################################### +copp/test_copp.py: + skip_traffic_test: + reason: "Skip traffic test for KVM testbed" + conditions: + - "asic_type in ['vs']" + ####################################### ##### decap ##### ####################################### @@ -121,6 +130,48 @@ dualtor/test_tunnel_memory_leak.py: conditions: - "asic_type in ['vs']" +####################################### +##### dualtor_io ##### +####################################### +dualtor_io/test_heartbeat_failure.py: + skip_traffic_test: + reason: "Skip traffic test for KVM testbed" + conditions: + - "asic_type in ['vs']" + +dualtor_io/test_link_drop.py: + skip_traffic_test: + reason: "Skip traffic test for KVM testbed" + conditions: + - "asic_type in ['vs']" + +dualtor_io/test_link_failure.py: + skip_traffic_test: + reason: "Skip traffic test for KVM testbed" + conditions: + - "asic_type in ['vs']" + +dualtor_io/test_normal_op.py: + skip_traffic_test: + reason: "Skip traffic test for KVM testbed" + conditions: + - "asic_type in ['vs']" + +dualtor_io/test_tor_bgp_failure.py: + skip_traffic_test: + reason: "Skip traffic test for KVM testbed" + conditions: + - "asic_type in ['vs']" + +####################################### +##### dualtor_mgmt ##### +####################################### +dualtor_mgmt/test_ingress_drop.py: + skip_traffic_test: + reason: "Skip traffic test for KVM testbed" + conditions: + - "asic_type in ['vs']" + ####################################### ##### ecmp ##### ####################################### @@ -240,6 +291,15 @@ sub_port_interfaces/test_sub_port_interfaces.py: conditions: - "asic_type in ['vs']" +####################################### +##### vlan ##### +####################################### +vlan/test_vlan_ping.py: + skip_traffic_test: + reason: "Skip traffic test for KVM testbed" + conditions: + - "asic_type in ['vs']" + ####################################### ##### vxlan ##### ####################################### @@ -266,3 +326,9 @@ vxlan/test_vxlan_ecmp.py: reason: "Skip traffic test for KVM testbed" conditions: - "asic_type in ['vs']" + +vxlan/test_vxlan_ecmp_switchover.py: + skip_traffic_test: + reason: "Skip traffic test for KVM testbed" + conditions: + - "asic_type in ['vs']" diff --git a/tests/copp/test_copp.py b/tests/copp/test_copp.py index 332ba04021..94522221a0 100644 --- a/tests/copp/test_copp.py +++ b/tests/copp/test_copp.py @@ -41,8 +41,7 @@ # Module-level fixtures from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401 from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 pytestmark = [ pytest.mark.topology("t0", "t1", "t2", "m0", "mx") diff --git a/tests/decap/test_decap.py b/tests/decap/test_decap.py index 7d559982f9..9464ce15a5 100644 --- a/tests/decap/test_decap.py +++ b/tests/decap/test_decap.py @@ -21,10 +21,8 @@ from tests.common.fixtures.ptfhost_utils import remove_ip_addresses # noqa F401 from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401 from tests.common.fixtures.ptfhost_utils import set_ptf_port_mapping_mode # noqa F401 -# from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.fixtures.ptfhost_utils import ptf_test_port_map_active_active -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 from tests.common.fixtures.fib_utils import fib_info_files # noqa F401 from tests.common.fixtures.fib_utils import single_fib_for_duts # noqa F401 from tests.ptf_runner import ptf_runner diff --git a/tests/drop_packets/drop_packets.py b/tests/drop_packets/drop_packets.py index f1f87e4d63..c878e839f5 100644 --- a/tests/drop_packets/drop_packets.py +++ b/tests/drop_packets/drop_packets.py @@ -15,8 +15,7 @@ from tests.common.helpers.constants import DEFAULT_NAMESPACE from tests.common.plugins.loganalyzer.loganalyzer import LogAnalyzer, LogAnalyzerError from tests.common import config_reload -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 RX_DRP = "RX_DRP" RX_ERR = "RX_ERR" diff --git a/tests/drop_packets/test_drop_counters.py b/tests/drop_packets/test_drop_counters.py index f30a016342..7d6f50229f 100755 --- a/tests/drop_packets/test_drop_counters.py +++ b/tests/drop_packets/test_drop_counters.py @@ -22,8 +22,7 @@ test_acl_egress_drop # noqa F401 from tests.common.helpers.constants import DEFAULT_NAMESPACE from tests.common.fixtures.conn_graph_facts import enum_fanout_graph_facts # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 pytestmark = [ pytest.mark.topology("any") diff --git a/tests/dualtor/test_ipinip.py b/tests/dualtor/test_ipinip.py index 635c534d2a..d5e0b15476 100644 --- a/tests/dualtor/test_ipinip.py +++ b/tests/dualtor/test_ipinip.py @@ -28,8 +28,7 @@ from tests.common.fixtures.ptfhost_utils import run_icmp_responder # noqa F401 from tests.common.fixtures.ptfhost_utils import run_garp_service # noqa F401 from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.utilities import dump_scapy_packet_show_output from tests.common.dualtor.dual_tor_utils import config_active_active_dualtor_active_standby # noqa F401 from tests.common.dualtor.dual_tor_utils import validate_active_active_dualtor_setup # noqa F401 diff --git a/tests/dualtor/test_orchagent_active_tor_downstream.py b/tests/dualtor/test_orchagent_active_tor_downstream.py index 652e5b135f..45d3506eaf 100644 --- a/tests/dualtor/test_orchagent_active_tor_downstream.py +++ b/tests/dualtor/test_orchagent_active_tor_downstream.py @@ -21,9 +21,7 @@ from tests.common.fixtures.ptfhost_utils import run_icmp_responder # noqa F401 from tests.common.fixtures.ptfhost_utils import run_garp_service # noqa F401 from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 -# from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.helpers.assertions import pytest_assert from tests.common.utilities import wait_until diff --git a/tests/dualtor/test_orchagent_mac_move.py b/tests/dualtor/test_orchagent_mac_move.py index 62226cfee4..7aa0a25e39 100644 --- a/tests/dualtor/test_orchagent_mac_move.py +++ b/tests/dualtor/test_orchagent_mac_move.py @@ -13,9 +13,7 @@ from tests.common.fixtures.ptfhost_utils import run_icmp_responder # noqa F401 from tests.common.fixtures.ptfhost_utils import run_garp_service # noqa F401 from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 -# from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.utilities import dump_scapy_packet_show_output diff --git a/tests/dualtor/test_orchagent_slb.py b/tests/dualtor/test_orchagent_slb.py index d96e9bbf2f..4b0aeb8962 100644 --- a/tests/dualtor/test_orchagent_slb.py +++ b/tests/dualtor/test_orchagent_slb.py @@ -20,8 +20,7 @@ from tests.common.fixtures.ptfhost_utils import run_icmp_responder # noqa F401 from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.helpers import bgp from tests.common.utilities import is_ipv4_address diff --git a/tests/dualtor/test_orchagent_standby_tor_downstream.py b/tests/dualtor/test_orchagent_standby_tor_downstream.py index abf2304d7f..1d26d74187 100644 --- a/tests/dualtor/test_orchagent_standby_tor_downstream.py +++ b/tests/dualtor/test_orchagent_standby_tor_downstream.py @@ -15,18 +15,16 @@ from tests.common.dualtor.dual_tor_utils import build_packet_to_server from tests.common.dualtor.dual_tor_utils import crm_neighbor_checker from tests.common.dualtor.dual_tor_utils import add_nexthop_routes, remove_static_routes -from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa: F401 -from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa: F401 -from tests.common.fixtures.ptfhost_utils import run_garp_service # noqa: F401 -from tests.common.fixtures.ptfhost_utils import run_icmp_responder # noqa: F401 -# from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401 +from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 +from tests.common.fixtures.ptfhost_utils import run_garp_service # noqa F401 +from tests.common.fixtures.ptfhost_utils import run_icmp_responder # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.helpers.assertions import pytest_assert as pt_assert -from tests.common.dualtor.tunnel_traffic_utils import tunnel_traffic_monitor # noqa: F401 +from tests.common.dualtor.tunnel_traffic_utils import tunnel_traffic_monitor # noqa F401 from tests.common.dualtor.server_traffic_utils import ServerTrafficMonitor -from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports # noqa: F401 -from tests.common.dualtor.tor_failure_utils import shutdown_bgp_sessions # noqa: F401 +from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports # noqa F401 +from tests.common.dualtor.tor_failure_utils import shutdown_bgp_sessions # noqa F401 from tests.common.utilities import wait_until diff --git a/tests/dualtor/test_standby_tor_upstream_mux_toggle.py b/tests/dualtor/test_standby_tor_upstream_mux_toggle.py index 4dcefba2f0..e776541229 100644 --- a/tests/dualtor/test_standby_tor_upstream_mux_toggle.py +++ b/tests/dualtor/test_standby_tor_upstream_mux_toggle.py @@ -10,10 +10,7 @@ from tests.common.config_reload import config_reload from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports # noqa F401 from tests.common.fixtures.ptfhost_utils import change_mac_addresses, run_garp_service, \ - run_icmp_responder # noqa F401 -# from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 + run_icmp_responder, skip_traffic_test # noqa F401 logger = logging.getLogger(__file__) diff --git a/tests/dualtor/test_tor_ecn.py b/tests/dualtor/test_tor_ecn.py index eed5bf082e..5e965dde25 100644 --- a/tests/dualtor/test_tor_ecn.py +++ b/tests/dualtor/test_tor_ecn.py @@ -28,8 +28,7 @@ from tests.common.fixtures.ptfhost_utils import run_icmp_responder # noqa F401 from tests.common.fixtures.ptfhost_utils import run_garp_service # noqa F401 from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.utilities import dump_scapy_packet_show_output from tests.common.dualtor.tunnel_traffic_utils import derive_queue_id_from_dscp, derive_out_dscp_from_inner_dscp from tests.common.dualtor.dual_tor_utils import config_active_active_dualtor_active_standby # noqa F401 diff --git a/tests/dualtor/test_tunnel_memory_leak.py b/tests/dualtor/test_tunnel_memory_leak.py index c1d3d8ce5f..748db89747 100644 --- a/tests/dualtor/test_tunnel_memory_leak.py +++ b/tests/dualtor/test_tunnel_memory_leak.py @@ -22,8 +22,7 @@ from tests.common.dualtor.dual_tor_utils import delete_neighbor from tests.common.helpers.dut_utils import get_program_info from tests.common.fixtures.ptfhost_utils import run_garp_service, run_icmp_responder # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.utilities import wait_until diff --git a/tests/dualtor_io/test_heartbeat_failure.py b/tests/dualtor_io/test_heartbeat_failure.py index 06794c0248..49afb7994a 100644 --- a/tests/dualtor_io/test_heartbeat_failure.py +++ b/tests/dualtor_io/test_heartbeat_failure.py @@ -10,8 +10,7 @@ from tests.common.dualtor.tor_failure_utils import shutdown_tor_heartbeat # noqa F401 from tests.common.fixtures.ptfhost_utils import run_icmp_responder, run_garp_service, \ copy_ptftests_directory, change_mac_addresses # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.dualtor.constants import MUX_SIM_ALLOWED_DISRUPTION_SEC from tests.common.dualtor.dual_tor_common import cable_type # noqa F401 from tests.common.dualtor.dual_tor_common import CableType diff --git a/tests/dualtor_io/test_link_drop.py b/tests/dualtor_io/test_link_drop.py index b2ce53b8ae..27909f1302 100644 --- a/tests/dualtor_io/test_link_drop.py +++ b/tests/dualtor_io/test_link_drop.py @@ -18,8 +18,7 @@ from tests.common.fixtures.ptfhost_utils import run_icmp_responder, run_garp_service # noqa F401 from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.dualtor.constants import MUX_SIM_ALLOWED_DISRUPTION_SEC from tests.common.dualtor.dual_tor_common import ActiveActivePortID from tests.common.dualtor.dual_tor_common import active_active_ports # noqa F401 diff --git a/tests/dualtor_io/test_link_failure.py b/tests/dualtor_io/test_link_failure.py index 4b02200e92..580f73d805 100644 --- a/tests/dualtor_io/test_link_failure.py +++ b/tests/dualtor_io/test_link_failure.py @@ -11,8 +11,7 @@ from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_upper_tor # noqa F401 from tests.common.fixtures.ptfhost_utils import run_icmp_responder, run_garp_service, \ copy_ptftests_directory, change_mac_addresses # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.dualtor.constants import MUX_SIM_ALLOWED_DISRUPTION_SEC from tests.common.dualtor.dual_tor_common import active_active_ports # noqa F401 from tests.common.dualtor.dual_tor_common import cable_type # noqa F401 diff --git a/tests/dualtor_io/test_normal_op.py b/tests/dualtor_io/test_normal_op.py index abd8901a5b..20781585e6 100644 --- a/tests/dualtor_io/test_normal_op.py +++ b/tests/dualtor_io/test_normal_op.py @@ -14,8 +14,7 @@ from tests.common.dualtor.dual_tor_utils import check_simulator_flap_counter # noqa F401 from tests.common.fixtures.ptfhost_utils import run_icmp_responder, run_garp_service, \ copy_ptftests_directory, change_mac_addresses # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.dualtor.constants import MUX_SIM_ALLOWED_DISRUPTION_SEC, CONFIG_RELOAD_ALLOWED_DISRUPTION_SEC from tests.common.utilities import wait_until from tests.common.helpers.assertions import pytest_assert diff --git a/tests/dualtor_io/test_tor_bgp_failure.py b/tests/dualtor_io/test_tor_bgp_failure.py index 3f592b0574..91783bd14f 100644 --- a/tests/dualtor_io/test_tor_bgp_failure.py +++ b/tests/dualtor_io/test_tor_bgp_failure.py @@ -11,8 +11,7 @@ from tests.common.dualtor.tor_failure_utils import shutdown_bgp_sessions_on_duthost from tests.common.fixtures.ptfhost_utils import run_icmp_responder, run_garp_service, \ copy_ptftests_directory, change_mac_addresses # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.dualtor.tunnel_traffic_utils import tunnel_traffic_monitor # noqa F401 from tests.common.dualtor.constants import MUX_SIM_ALLOWED_DISRUPTION_SEC from tests.common.dualtor.dual_tor_common import cable_type # noqa F401 diff --git a/tests/dualtor_mgmt/test_ingress_drop.py b/tests/dualtor_mgmt/test_ingress_drop.py index 53dfa0afba..c98be9db04 100644 --- a/tests/dualtor_mgmt/test_ingress_drop.py +++ b/tests/dualtor_mgmt/test_ingress_drop.py @@ -16,8 +16,7 @@ from tests.common.dualtor.nic_simulator_control import mux_status_from_nic_simulator # noqa F401 from tests.common.dualtor.nic_simulator_control import stop_nic_simulator # noqa F401 from tests.common.fixtures.ptfhost_utils import run_icmp_responder # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.helpers.assertions import pytest_assert from tests.common.utilities import wait_until diff --git a/tests/everflow/test_everflow_per_interface.py b/tests/everflow/test_everflow_per_interface.py index 9548bc7b07..820513d667 100644 --- a/tests/everflow/test_everflow_per_interface.py +++ b/tests/everflow/test_everflow_per_interface.py @@ -13,9 +13,7 @@ from .everflow_test_utilities import setup_info, EVERFLOW_DSCP_RULES # noqa: F401 from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_rand_selected_tor # noqa: F401 -# from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa: F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa: F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa: F401 pytestmark = [ pytest.mark.topology("any") diff --git a/tests/everflow/test_everflow_testbed.py b/tests/everflow/test_everflow_testbed.py index 87597a8c9e..5561856152 100644 --- a/tests/everflow/test_everflow_testbed.py +++ b/tests/everflow/test_everflow_testbed.py @@ -11,9 +11,7 @@ # Module-level fixtures from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa: F401 from tests.common.fixtures.ptfhost_utils import copy_acstests_directory # noqa: F401 -# from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa: F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa: F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa: F401 from .everflow_test_utilities import setup_info, setup_arp_responder, EVERFLOW_DSCP_RULES # noqa: F401 from tests.common.fixtures.ptfhost_utils import copy_arp_responder_py # noqa: F401 from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_rand_selected_tor # noqa: F401 diff --git a/tests/fib/test_fib.py b/tests/fib/test_fib.py index a34553b8d5..c1e8f47bfb 100644 --- a/tests/fib/test_fib.py +++ b/tests/fib/test_fib.py @@ -10,9 +10,7 @@ from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401 from tests.common.fixtures.ptfhost_utils import set_ptf_port_mapping_mode # noqa F401 from tests.common.fixtures.ptfhost_utils import ptf_test_port_map_active_active, ptf_test_port_map -# from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa: F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.ptf_runner import ptf_runner from tests.common.dualtor.mux_simulator_control import mux_server_url # noqa F401 diff --git a/tests/generic_config_updater/test_dynamic_acl.py b/tests/generic_config_updater/test_dynamic_acl.py index b58c38fa77..26e1f13e85 100644 --- a/tests/generic_config_updater/test_dynamic_acl.py +++ b/tests/generic_config_updater/test_dynamic_acl.py @@ -25,7 +25,8 @@ from ipaddress import ip_network, IPv6Network, IPv4Network from tests.arp.arp_utils import increment_ipv6_addr, increment_ipv4_addr -from tests.common.fixtures.ptfhost_utils import remove_ip_addresses # noqa F401 +from tests.common.fixtures.ptfhost_utils import remove_ip_addresses # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.generic_config_updater.gu_utils import expect_op_success, expect_op_failure from tests.generic_config_updater.gu_utils import create_checkpoint, delete_checkpoint, rollback_or_reload from tests.generic_config_updater.gu_utils import format_and_apply_template, load_and_apply_json_patch @@ -35,8 +36,6 @@ from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_rand_selected_tor # noqa F401 from tests.common.dualtor.dual_tor_utils import setup_standby_ports_on_rand_unselected_tor # noqa F401 from tests.common.utilities import get_upstream_neigh_type, get_downstream_neigh_type -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 pytestmark = [ pytest.mark.topology('t0', 'm0'), diff --git a/tests/hash/test_generic_hash.py b/tests/hash/test_generic_hash.py index 8be2f668e8..444f424a9a 100644 --- a/tests/hash/test_generic_hash.py +++ b/tests/hash/test_generic_hash.py @@ -15,8 +15,7 @@ from tests.common.utilities import wait_until from tests.ptf_runner import ptf_runner from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.plugins.loganalyzer.loganalyzer import LogAnalyzer from tests.common.reboot import reboot from tests.common.config_reload import config_reload diff --git a/tests/ip/test_ip_packet.py b/tests/ip/test_ip_packet.py index 88c413d37d..7584ad42fb 100644 --- a/tests/ip/test_ip_packet.py +++ b/tests/ip/test_ip_packet.py @@ -11,9 +11,7 @@ from tests.common.helpers.assertions import pytest_assert from tests.common.portstat_utilities import parse_column_positions from tests.common.portstat_utilities import parse_portstat -# from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa: F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.drop_packets.drop_packets import is_mellanox_fanout diff --git a/tests/span/test_port_mirroring.py b/tests/span/test_port_mirroring.py index 1778507ccd..646f699264 100644 --- a/tests/span/test_port_mirroring.py +++ b/tests/span/test_port_mirroring.py @@ -4,10 +4,9 @@ import pytest -from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 +from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from span_helpers import send_and_verify_mirrored_packet -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 pytestmark = [ pytest.mark.topology('t0') diff --git a/tests/sub_port_interfaces/test_sub_port_interfaces.py b/tests/sub_port_interfaces/test_sub_port_interfaces.py index 7efc484135..c3bba0e73d 100644 --- a/tests/sub_port_interfaces/test_sub_port_interfaces.py +++ b/tests/sub_port_interfaces/test_sub_port_interfaces.py @@ -15,8 +15,7 @@ from sub_ports_helpers import check_sub_port from sub_ports_helpers import remove_sub_port from sub_ports_helpers import create_sub_port_on_dut -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 pytestmark = [ pytest.mark.topology('t0', 't1') diff --git a/tests/vlan/test_vlan_ping.py b/tests/vlan/test_vlan_ping.py index 4e25d034f4..9fc4cc2e67 100644 --- a/tests/vlan/test_vlan_ping.py +++ b/tests/vlan/test_vlan_ping.py @@ -10,8 +10,7 @@ from tests.common.helpers.assertions import pytest_assert as py_assert from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_rand_selected_tor_m # noqa F401 from tests.common.dualtor.dual_tor_utils import lower_tor_host # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 logger = logging.getLogger(__name__) diff --git a/tests/vxlan/test_vnet_vxlan.py b/tests/vxlan/test_vnet_vxlan.py index 5f936d14f2..12686ac0d2 100644 --- a/tests/vxlan/test_vnet_vxlan.py +++ b/tests/vxlan/test_vnet_vxlan.py @@ -14,9 +14,7 @@ apply_dut_config_files, cleanup_dut_vnets, cleanup_vxlan_tunnels, cleanup_vnet_routes from tests.common.fixtures.ptfhost_utils import remove_ip_addresses, change_mac_addresses, \ - copy_arp_responder_py, copy_ptftests_directory # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 + copy_arp_responder_py, copy_ptftests_directory, skip_traffic_test # noqa F401 from tests.flow_counter.flow_counter_utils import RouteFlowCounterTestContext,\ is_route_flow_counter_supported # noqa F401 import tests.arp.test_wr_arp as test_wr_arp diff --git a/tests/vxlan/test_vxlan_bfd_tsa.py b/tests/vxlan/test_vxlan_bfd_tsa.py index 8f20096257..70e582e830 100644 --- a/tests/vxlan/test_vxlan_bfd_tsa.py +++ b/tests/vxlan/test_vxlan_bfd_tsa.py @@ -13,9 +13,8 @@ from tests.common.helpers.assertions import pytest_assert from tests.common.utilities import wait_until -from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa: F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.ptf_runner import ptf_runner from tests.vxlan.vxlan_ecmp_utils import Ecmp_Utils from tests.common.config_reload import config_system_checks_passed diff --git a/tests/vxlan/test_vxlan_decap.py b/tests/vxlan/test_vxlan_decap.py index fccc559456..b6761ac25f 100644 --- a/tests/vxlan/test_vxlan_decap.py +++ b/tests/vxlan/test_vxlan_decap.py @@ -14,8 +14,7 @@ from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 from tests.common.fixtures.ptfhost_utils import copy_arp_responder_py # noqa F401 from tests.common.fixtures.ptfhost_utils import remove_ip_addresses # noqa F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.ptf_runner import ptf_runner from tests.common.dualtor.mux_simulator_control import mux_server_url,\ toggle_all_simulator_ports_to_rand_selected_tor_m # noqa F401 diff --git a/tests/vxlan/test_vxlan_ecmp.py b/tests/vxlan/test_vxlan_ecmp.py index c099ea919f..2bedcf2414 100644 --- a/tests/vxlan/test_vxlan_ecmp.py +++ b/tests/vxlan/test_vxlan_ecmp.py @@ -59,9 +59,8 @@ import copy from tests.common.helpers.assertions import pytest_assert -from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa: F401 -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 +from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.common.utilities import wait_until from tests.ptf_runner import ptf_runner from tests.vxlan.vxlan_ecmp_utils import Ecmp_Utils diff --git a/tests/vxlan/test_vxlan_ecmp_switchover.py b/tests/vxlan/test_vxlan_ecmp_switchover.py index e98845b7c8..36384c0a50 100644 --- a/tests/vxlan/test_vxlan_ecmp_switchover.py +++ b/tests/vxlan/test_vxlan_ecmp_switchover.py @@ -10,12 +10,10 @@ import json import pytest -from tests.common.fixtures.ptfhost_utils \ - import copy_ptftests_directory # noqa: F401 +from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401 +from tests.common.fixtures.ptfhost_utils import skip_traffic_test # noqa F401 from tests.ptf_runner import ptf_runner from tests.vxlan.vxlan_ecmp_utils import Ecmp_Utils -# Temporary work around to add skip_traffic_test fixture from duthost_utils -from tests.common.fixtures.duthost_utils import skip_traffic_test # noqa F401 Logger = logging.getLogger(__name__) ecmp_utils = Ecmp_Utils()