diff --git a/.azure-pipelines/pr_test_scripts.yaml b/.azure-pipelines/pr_test_scripts.yaml index 106bee345da..333e9d5ef17 100644 --- a/.azure-pipelines/pr_test_scripts.yaml +++ b/.azure-pipelines/pr_test_scripts.yaml @@ -487,6 +487,9 @@ onboarding_t0: - generic_config_updater/test_mgmt_interface.py - gnmi/test_gnmi_smartswitch.py - gnmi/test_gnoi_killprocess.py + - qos/test_pfc_counters.py + - qos/test_pfc_pause.py + - qos/test_qos_dscp_mapping.py onboarding_t1: @@ -496,6 +499,8 @@ onboarding_t1: - generic_config_updater/test_mgmt_interface.py - gnmi/test_gnmi_smartswitch.py - gnmi/test_gnoi_killprocess.py + - qos/test_pfc_counters.py + - qos/test_qos_dscp_mapping.py onboarding_t1_multi_asic: - acl/test_stress_acl.py diff --git a/.azure-pipelines/pr_test_skip_scripts.yaml b/.azure-pipelines/pr_test_skip_scripts.yaml index cb2969406d3..def5e1cae36 100644 --- a/.azure-pipelines/pr_test_skip_scripts.yaml +++ b/.azure-pipelines/pr_test_skip_scripts.yaml @@ -56,6 +56,10 @@ t0: - platform_tests/mellanox/test_hw_management_service.py - platform_tests/mellanox/test_psu_power_threshold.py - platform_tests/mellanox/test_reboot_cause.py + # Qos buffer traditional test is only supported 201911 branch + - qos/test_buffer_traditional.py + # This test only support on cisco device with cisco sdk-debug mode + - qos/test_ecn_config.py # read_mac test needs specific variables and image urls, currently do not support on KVM and regular nightly test - read_mac/test_read_mac_metadata.py # This script only supported on Mellanox @@ -129,6 +133,8 @@ t1-lag: - system_health/test_system_health.py # Vrf tests are also skipped in nightly test - mvrf/test_mgmtvrf.py + # This test needs swap syncd support, which is not available on KVM + - qos/test_qos_masic.py t2: # KVM do not support bfd test @@ -197,6 +203,8 @@ dualtor: - dualtor_io/test_grpc_server_failure.py # This test is only for Nvidia platforms. - dualtor_mgmt/test_egress_drop_nvidia.py + # This test needs some additional SAI attributes, do not support on KVM. + - qos/test_tunnel_qos_remap.py tgen: # Ixia test only support on physical ixia testbed diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml index e9add868c8d..b1e840d59a7 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml @@ -1611,25 +1611,12 @@ qos/test_buffer_traditional.py: conditions: - "release not in ['201911']" - "topo_type in ['m0', 'mx']" - - "asic_type in ['vs']" qos/test_ecn_config.py: skip: - reason: "Temporarily skip in PR testing" - conditions: - - "asic_type in ['vs']" - -qos/test_pfc_counters.py: - skip: - reason: "Temporarily skip in PR testing" - conditions: - - "asic_type in ['vs']" - -qos/test_pfc_pause.py: - skip: - reason: "Temporarily skip in PR testing" + reason: "This test only support on cisco device" conditions: - - "asic_type in ['vs']" + - "asic_type not in ['cisco-8000']" qos/test_pfc_pause.py::test_pfc_pause_lossless: # For this test, we use the fanout connected to the DUT to send PFC pause frames. @@ -1646,10 +1633,6 @@ qos/test_qos_dscp_mapping.py: strict: True conditions: - "asic_type in ['cisco-8000'] and platform in ['x86_64-8122_64eh_o-r0']" - skip: - reason: "Temporarily skip in PR testing" - conditions: - - "asic_type in ['vs']" qos/test_qos_dscp_mapping.py::TestQoSSaiDSCPQueueMapping_IPIP_Base::test_dscp_to_queue_mapping_pipe_mode: skip: @@ -1659,11 +1642,10 @@ qos/test_qos_dscp_mapping.py::TestQoSSaiDSCPQueueMapping_IPIP_Base::test_dscp_to - "asic_type in ['mellanox', 'broadcom', 'cisco-8000']" - https://github.com/sonic-net/sonic-mgmt/issues/12906 - "topo_type in ['m0', 'mx']" - - "asic_type in ['vs']" qos/test_qos_masic.py: skip: - reason: "QoS tests for multi-ASIC only. Supported topos: t1-lag, t1-64-lag, t1-56-lag, t1-backend. / M0/MX topo does not support qos" + reason: "QoS tests for multi-ASIC only. Supported topos: t1-lag, t1-64-lag, t1-56-lag, t1-backend. / M0/MX topo does not support qos. / KVM do not support swap syncd." conditions_logical_operator: or conditions: - "is_multi_asic==False or topo_name not in ['t1-lag', 't1-64-lag', 't1-56-lag', 't1-backend']" @@ -1886,7 +1868,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiSharedReservationSize: qos/test_tunnel_qos_remap.py: skip: - reason: "Temporarily skip in PR testing" + reason: "Tunnel qos remap test needs some SAI attributes, which are not supported on KVM." conditions: - "asic_type in ['vs']" @@ -2355,12 +2337,6 @@ voq/test_fabric_reach.py: - "not any(i in platform for i in ['arista_7800', 'x86_64-nokia_ixr7250e'])" - "(asic_type in ['cisco-8000'])" -voq/test_voq_fabric_capacity.py: - skip: - reason: "Skip test_voq_fabric_capacity on unsupported testbed." - conditions: - - "('t2' not in topo_name) or (asic_subtype not in ['broadcom-dnx']) or (asic_type in ['cisco-8000'])" - voq/test_voq_counter.py::TestVoqCounter::test_voq_queue_counter[multi_dut_shortlink_to_longlink]: skip: reason: "Testcase ignored due to sonic-mgmt issue: https://github.com/sonic-net/sonic-buildimage/issues/21098" @@ -2368,6 +2344,12 @@ voq/test_voq_counter.py::TestVoqCounter::test_voq_queue_counter[multi_dut_shortl - "(switch_type=='voq')" - "('t2' in topo_name)" +voq/test_voq_fabric_capacity.py: + skip: + reason: "Skip test_voq_fabric_capacity on unsupported testbed." + conditions: + - "('t2' not in topo_name) or (asic_subtype not in ['broadcom-dnx']) or (asic_type in ['cisco-8000'])" + voq/test_voq_fabric_isolation.py: skip: reason: "Skip test_voq_fabric_isolation on unsupported testbed." 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 12cccb05cd6..b5a28d7c6e2 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 @@ -285,6 +285,15 @@ ipfwd/test_nhop_group.py: conditions: - "asic_type in ['vs']" +####################################### +##### qos ##### +####################################### +qos/test_qos_dscp_mapping.py: + skip_traffic_test: + reason: "Skip traffic test for KVM testbed" + conditions: + - "asic_type in ['vs']" + ####################################### ##### route ##### ####################################### diff --git a/tests/qos/test_ecn_config.py b/tests/qos/test_ecn_config.py index 7e6b2f12d49..78d4a4139ae 100644 --- a/tests/qos/test_ecn_config.py +++ b/tests/qos/test_ecn_config.py @@ -6,7 +6,6 @@ import logging import time import pytest -from tests.common.cisco_data import is_cisco_device import json @@ -106,8 +105,6 @@ def test_verify_ecn_marking_config(duthosts, rand_one_dut_hostname, request): @summary: Verify output of `show platform npu voq cgm_profile with wred_profile drop probability` """ duthost = duthosts[rand_one_dut_hostname] - if not is_cisco_device(duthost): - pytest.skip("Skipping as not a Cisco device") cmd = "show platform npu rx cgm_global -d" diff --git a/tests/qos/test_pfc_counters.py b/tests/qos/test_pfc_counters.py index a508494d4f0..4a849bf4e5e 100644 --- a/tests/qos/test_pfc_counters.py +++ b/tests/qos/test_pfc_counters.py @@ -81,7 +81,8 @@ def run_test(fanouthosts, duthost, conn_graph_facts, fanout_graph_facts, leaf_fa """ setup_testbed(fanouthosts, duthost, leaf_fanouts) asic = duthost.asic_instance() - conn_facts = conn_graph_facts['device_conn'][duthost.hostname] + asic_type = duthost.facts["asic_type"] + conn_facts = conn_graph_facts['device_conn'].get(duthost.hostname, {}) onyx_pfc_container_name = 'storm' int_status = asic.show_interface(command="status")[ 'ansible_facts']['int_status'] @@ -92,48 +93,49 @@ def run_test(fanouthosts, duthost, conn_graph_facts, fanout_graph_facts, leaf_fa int_status[intf]['oper_state'] == 'up'] only_lossless_rx_counters = "Cisco-8122" in asic.sonichost.facts["hwsku"] no_xon_counters = "Cisco-8122" in asic.sonichost.facts["hwsku"] - if only_lossless_rx_counters: + if only_lossless_rx_counters and asic_type != 'vs': config_facts = asic.config_facts(host=asic.hostname, source='persistent')['ansible_facts'] if not check_continuous_pfc: - """ Generate PFC or FC packets for active physical interfaces """ - for intf in active_phy_intfs: - peer_device = conn_facts[intf]['peerdevice'] - peer_port = conn_facts[intf]['peerport'] - - if peer_device not in fanouthosts: - continue - - peerdev_ans = fanouthosts[peer_device] - fanout_os = peerdev_ans.get_fanout_os() - fanout_hwsku = fanout_graph_facts[peerdev_ans.hostname]["device_info"]["HwSku"] - if fanout_os == "nxos": - peer_port_name = nxos_to_linux_intf(peer_port) - elif fanout_os == "sonic": - peer_port_name = sonic_to_linux_intf(peer_port) - else: - peer_port_name = eos_to_linux_intf( - peer_port, hwsku=fanout_hwsku) + if asic_type != 'vs': + """ Generate PFC or FC packets for active physical interfaces """ + for intf in active_phy_intfs: + peer_device = conn_facts[intf]['peerdevice'] + peer_port = conn_facts[intf]['peerport'] + + if peer_device not in fanouthosts: + continue + + peerdev_ans = fanouthosts[peer_device] + fanout_os = peerdev_ans.get_fanout_os() + fanout_hwsku = fanout_graph_facts[peerdev_ans.hostname]["device_info"]["HwSku"] + if fanout_os == "nxos": + peer_port_name = nxos_to_linux_intf(peer_port) + elif fanout_os == "sonic": + peer_port_name = sonic_to_linux_intf(peer_port) + else: + peer_port_name = eos_to_linux_intf( + peer_port, hwsku=fanout_hwsku) - if is_pfc: - for priority in range(PRIO_COUNT): + if is_pfc: + for priority in range(PRIO_COUNT): + if fanout_hwsku == "MLNX-OS": + cmd = 'docker exec %s "python %s -i %s -p %d -t %d -n %d"' % ( + onyx_pfc_container_name, PFC_GEN_FILE_ABSOLUTE_PATH, + peer_port_name, 2 ** priority, pause_time, PKT_COUNT) + peerdev_ans.host.config(cmd) + else: + cmd = "sudo python %s -i %s -p %d -t %d -n %d" % ( + PFC_GEN_FILE_DEST, peer_port_name, 2 ** priority, pause_time, PKT_COUNT) + peerdev_ans.host.command(cmd) + else: if fanout_hwsku == "MLNX-OS": - cmd = 'docker exec %s "python %s -i %s -p %d -t %d -n %d"' % ( - onyx_pfc_container_name, PFC_GEN_FILE_ABSOLUTE_PATH, - peer_port_name, 2 ** priority, pause_time, PKT_COUNT) + cmd = 'docker exec %s "python %s -i %s -g -t %d -n %d"' % ( + onyx_pfc_container_name, PFC_GEN_FILE_ABSOLUTE_PATH, peer_port_name, pause_time, PKT_COUNT) peerdev_ans.host.config(cmd) else: - cmd = "sudo python %s -i %s -p %d -t %d -n %d" % ( - PFC_GEN_FILE_DEST, peer_port_name, 2 ** priority, pause_time, PKT_COUNT) + cmd = "sudo python %s -i %s -g -t %d -n %d" % ( + PFC_GEN_FILE_DEST, peer_port_name, pause_time, PKT_COUNT) peerdev_ans.host.command(cmd) - else: - if fanout_hwsku == "MLNX-OS": - cmd = 'docker exec %s "python %s -i %s -g -t %d -n %d"' % ( - onyx_pfc_container_name, PFC_GEN_FILE_ABSOLUTE_PATH, peer_port_name, pause_time, PKT_COUNT) - peerdev_ans.host.config(cmd) - else: - cmd = "sudo python %s -i %s -g -t %d -n %d" % ( - PFC_GEN_FILE_DEST, peer_port_name, pause_time, PKT_COUNT) - peerdev_ans.host.command(cmd) """ SONiC takes some time to update counters in database """ time.sleep(5) @@ -141,7 +143,7 @@ def run_test(fanouthosts, duthost, conn_graph_facts, fanout_graph_facts, leaf_fa """ Check results """ counter_facts = duthost.sonic_pfc_counters(method="get")[ 'ansible_facts'] - if only_lossless_rx_counters: + if only_lossless_rx_counters and asic_type != 'vs': pfc_enabled_prios = [int(prio) for prio in config_facts["PORT_QOS_MAP"][intf]['pfc_enable'].split(',')] failures = [] for intf in active_phy_intfs: @@ -157,9 +159,10 @@ def run_test(fanouthosts, duthost, conn_graph_facts, fanout_graph_facts, leaf_fa logger.info("Verifying PFC RX count matches {}".format(expected_prios)) if counter_facts[intf]['Rx'] != expected_prios: failures.append((counter_facts[intf]['Rx'], expected_prios)) - for failure in failures: - logger.error("Got {}, expected {}".format(*failure)) - assert len(failures) == 0, "PFC RX counter increment not matching expected for above logged cases." + if asic_type != 'vs': + for failure in failures: + logger.error("Got {}, expected {}".format(*failure)) + assert len(failures) == 0, "PFC RX counter increment not matching expected for above logged cases." else: for intf in active_phy_intfs: @@ -168,45 +171,47 @@ def run_test(fanouthosts, duthost, conn_graph_facts, fanout_graph_facts, leaf_fa """ Clear PFC counters """ duthost.sonic_pfc_counters(method="clear") - peer_device = conn_facts[intf]['peerdevice'] - peer_port = conn_facts[intf]['peerport'] + if asic_type != 'vs': + peer_device = conn_facts[intf]['peerdevice'] + peer_port = conn_facts[intf]['peerport'] - if peer_device not in fanouthosts: - continue + if peer_device not in fanouthosts: + continue - peerdev_ans = fanouthosts[peer_device] - fanout_os = peerdev_ans.get_fanout_os() - fanout_hwsku = fanout_graph_facts[peerdev_ans.hostname]["device_info"]["HwSku"] - if fanout_os == "nxos": - peer_port_name = nxos_to_linux_intf(peer_port) - elif fanout_os == "sonic": - peer_port_name = sonic_to_linux_intf(peer_port) - else: - peer_port_name = eos_to_linux_intf( - peer_port, hwsku=fanout_hwsku) + peerdev_ans = fanouthosts[peer_device] + fanout_os = peerdev_ans.get_fanout_os() + fanout_hwsku = fanout_graph_facts[peerdev_ans.hostname]["device_info"]["HwSku"] + if fanout_os == "nxos": + peer_port_name = nxos_to_linux_intf(peer_port) + elif fanout_os == "sonic": + peer_port_name = sonic_to_linux_intf(peer_port) + else: + peer_port_name = eos_to_linux_intf( + peer_port, hwsku=fanout_hwsku) - if fanout_hwsku == "MLNX-OS": - cmd = 'docker exec %s "python %s -i %s -p %d -t %d -n %d"' % ( - onyx_pfc_container_name, PFC_GEN_FILE_ABSOLUTE_PATH, - peer_port_name, 2 ** priority, pause_time, PKT_COUNT) - peerdev_ans.host.config(cmd) - else: - cmd = "sudo python %s -i %s -p %d -t %d -n %d" % ( - PFC_GEN_FILE_DEST, peer_port_name, 2 ** priority, pause_time, PKT_COUNT) - peerdev_ans.host.command(cmd) + if fanout_hwsku == "MLNX-OS": + cmd = 'docker exec %s "python %s -i %s -p %d -t %d -n %d"' % ( + onyx_pfc_container_name, PFC_GEN_FILE_ABSOLUTE_PATH, + peer_port_name, 2 ** priority, pause_time, PKT_COUNT) + peerdev_ans.host.config(cmd) + else: + cmd = "sudo python %s -i %s -p %d -t %d -n %d" % ( + PFC_GEN_FILE_DEST, peer_port_name, 2 ** priority, pause_time, PKT_COUNT) + peerdev_ans.host.command(cmd) time.sleep(5) pfc_rx = duthost.sonic_pfc_counters( method="get")['ansible_facts'] - """check pfc Rx frame count on particular priority are increased""" - assert pfc_rx[intf]['Rx'][priority] == str(PKT_COUNT) - """check LHS priorities are 0 count""" - for i in range(priority): - assert pfc_rx[intf]['Rx'][i] == '0' - """check RHS priorities are 0 count""" - for i in range(priority+1, PRIO_COUNT): - assert pfc_rx[intf]['Rx'][i] == '0' + if asic_type != 'vs': + """check pfc Rx frame count on particular priority are increased""" + assert pfc_rx[intf]['Rx'][priority] == str(PKT_COUNT) + """check LHS priorities are 0 count""" + for i in range(priority): + assert pfc_rx[intf]['Rx'][i] == '0' + """check RHS priorities are 0 count""" + for i in range(priority+1, PRIO_COUNT): + assert pfc_rx[intf]['Rx'][i] == '0' def test_pfc_pause(fanouthosts, duthosts, rand_one_tgen_dut_hostname, diff --git a/tests/qos/test_qos_dscp_mapping.py b/tests/qos/test_qos_dscp_mapping.py index 44638aa6b57..1eece8e3d15 100644 --- a/tests/qos/test_qos_dscp_mapping.py +++ b/tests/qos/test_qos_dscp_mapping.py @@ -123,7 +123,12 @@ def send_and_verify_traffic(ptfadapter, testutils.send(ptfadapter, ptf_src_port_id, pkt, count=DEFAULT_PKT_COUNT) try: - port_index, _ = testutils.verify_packet_any_port(ptfadapter, exp_pkt, ports=ptf_dst_port_ids) + result = testutils.verify_packet_any_port(ptfadapter, exp_pkt, ports=ptf_dst_port_ids) + if isinstance(result, bool): + logger.info("Return a dummy value for VS platform") + port_index = 0 + else: + port_index, _ = result logger.info("Received packet(s) on port {}".format(ptf_dst_port_ids[port_index])) global packet_egressed_success packet_egressed_success = True @@ -207,6 +212,7 @@ def _run_test(self, if "backend" in tbinfo["topo"]["type"]: pytest.skip("Dscp-queue mapping is not supported on {}".format(tbinfo["topo"]["type"])) + asic_type = duthost.facts['asic_type'] router_mac = test_params['router_mac'] ptf_src_port_id = test_params['ptf_downlink_port'] ptf_dst_port_ids = test_params['ptf_uplink_ports'] @@ -274,6 +280,9 @@ def _run_test(self, logger.error("{}: Try reducing DEFAULT_PKT_COUNT value".format(str(e))) failed_once = True + if asic_type == 'vs': + logger.info("Skipping queue verification for VS platform") + continue global packet_egressed_success if packet_egressed_success: dut_egress_port = get_dut_pair_port_from_ptf_port(duthost, tbinfo, dst_ptf_port_id) diff --git a/tests/qos/test_tunnel_qos_remap.py b/tests/qos/test_tunnel_qos_remap.py index 74cc8dc5b4e..70d57558ba3 100644 --- a/tests/qos/test_tunnel_qos_remap.py +++ b/tests/qos/test_tunnel_qos_remap.py @@ -36,7 +36,7 @@ pytestmark = [ pytest.mark.enable_active_active, - pytest.mark.topology('t0') + pytest.mark.topology('dualtor') ] logger = logging.getLogger(__name__)