From 08c6b03fdff8128ab3528774e100d1ccd00b3ff2 Mon Sep 17 00:00:00 2001 From: rbpittman Date: Tue, 5 Nov 2024 01:41:18 -0500 Subject: [PATCH] Cisco-8122 Q watermark test update (#15328) * Revise qsharedwatermark test for gr2 to no longer refill the queue as with other asics. Add lower margin on final check on the q shared watermark test case. * Remove extra dut_asic setting. --- .../conditional_mark/tests_mark_conditions.yaml | 2 +- tests/qos/test_qos_sai.py | 3 ++- tests/saitests/py3/sai_qos_tests.py | 17 +++++++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml index b086d6773cf..bb9f8f7a2a8 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml @@ -1438,7 +1438,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiLossyQueueVoqMultiSrc: reason: "Lossy Queue Voq multiple source test is not supported / M0/MX topo does not support qos" conditions_logical_operator: or conditions: - - "asic_type not in ['cisco-8000']" + - "asic_type not in ['cisco-8000'] or platform in ['x86_64-8122_64eh_o-r0']" - "topo_type in ['m0', 'mx']" qos/test_qos_sai.py::TestQosSai::testQosSaiPGDrop: diff --git a/tests/qos/test_qos_sai.py b/tests/qos/test_qos_sai.py index 209b51068b5..658161192ed 100644 --- a/tests/qos/test_qos_sai.py +++ b/tests/qos/test_qos_sai.py @@ -1839,7 +1839,8 @@ def testQosSaiQSharedWatermark( "pkts_num_fill_min": qosConfig[queueProfile]["pkts_num_fill_min"], "pkts_num_trig_drp": triggerDrop, "cell_size": qosConfig[queueProfile]["cell_size"], - "hwsku": dutTestParams['hwsku'] + "hwsku": dutTestParams['hwsku'], + "dut_asic": dutConfig["dutAsic"] }) if "platform_asic" in dutTestParams["basicParams"]: diff --git a/tests/saitests/py3/sai_qos_tests.py b/tests/saitests/py3/sai_qos_tests.py index 86369ffff56..dd5b159f684 100755 --- a/tests/saitests/py3/sai_qos_tests.py +++ b/tests/saitests/py3/sai_qos_tests.py @@ -5003,6 +5003,7 @@ def runTest(self): cell_size = int(self.test_params['cell_size']) hwsku = self.test_params['hwsku'] platform_asic = self.test_params['platform_asic'] + dut_asic = self.test_params['dut_asic'] if 'packet_size' in list(self.test_params.keys()): packet_length = int(self.test_params['packet_size']) @@ -5056,6 +5057,9 @@ def runTest(self): recv_counters_base, _ = sai_thrift_read_port_counters(self.src_client, asic_type, port_list['src'][src_port_id]) xmit_counters_base, _ = sai_thrift_read_port_counters(self.dst_client, asic_type, port_list['dst'][dst_port_id]) self.sai_thrift_port_tx_disable(self.dst_client, asic_type, [dst_port_id]) + if 'cisco-8000' in asic_type: + fill_leakout_plus_one(self, src_port_id, dst_port_id, pkt, queue, asic_type) + pg_cntrs_base = sai_thrift_read_pg_counters(self.src_client, port_list['src'][src_port_id]) dst_pg_cntrs_base = sai_thrift_read_pg_counters(self.dst_client, port_list['dst'][dst_port_id]) q_wm_res_base, pg_shared_wm_res_base, pg_headroom_wm_res_base = sai_thrift_read_port_watermarks( @@ -5133,6 +5137,7 @@ def runTest(self): else: pkts_num = 1 + margin fragment = 0 + refill_queue = 'cisco-8000' in asic_type and dut_asic != 'gr2' while (expected_wm < total_shared - fragment): expected_wm += pkts_num * cell_occupancy if (expected_wm > total_shared): @@ -5142,9 +5147,9 @@ def runTest(self): expected_wm -= diff * cell_occupancy fragment = total_shared - expected_wm - if 'cisco-8000' in asic_type: + if refill_queue: self.sai_thrift_port_tx_disable(self.dst_client, asic_type, [dst_port_id]) - assert (fill_leakout_plus_one(self, src_port_id, dst_port_id, pkt, queue, asic_type)) + fill_leakout_plus_one(self, src_port_id, dst_port_id, pkt, queue, asic_type) pkts_total += pkts_num pkts_num = pkts_total - 1 @@ -5153,7 +5158,7 @@ def runTest(self): send_packet(self, src_port_id, pkt, pkts_num) - if 'cisco-8000' in asic_type: + if refill_queue: self.sai_thrift_port_tx_enable( self.dst_client, asic_type, [dst_port_id]) @@ -5205,7 +5210,7 @@ def runTest(self): pkts_num = pkts_inc - if 'cisco-8000' in asic_type: + if refill_queue: self.sai_thrift_port_tx_disable(self.dst_client, asic_type, [dst_port_id]) fill_leakout_plus_one( self, src_port_id, dst_port_id, pkt, queue, asic_type) @@ -5215,7 +5220,7 @@ def runTest(self): # overflow the shared pool send_packet(self, src_port_id, pkt, pkts_num) - if 'cisco-8000' in asic_type: + if refill_queue: self.sai_thrift_port_tx_enable(self.dst_client, asic_type, [dst_port_id]) time.sleep(8) @@ -5243,7 +5248,7 @@ def runTest(self): logging.info("On J2C+ don't support SAI_INGRESS_PRIORITY_GROUP_STAT_XOFF_ROOM_WATERMARK_BYTES " + "stat - so ignoring this step for now") else: - assert (expected_wm * cell_size <= q_wm_res[queue]) + assert ((expected_wm - margin) * cell_size <= q_wm_res[queue]) assert (q_wm_res[queue] <= (expected_wm + margin) * cell_size) finally: