Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions tests/common/plugins/conditional_mark/tests_mark_conditions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolSize[None]:
conditions:
- "hwsku not in ['Arista-7060CX-32S-C32', 'Celestica-DX010-C32', 'Arista-7260CX3-D108C8', 'Force10-S6100', 'Arista-7260CX3-Q64', 'Arista-7050CX3-32S-C32'] and asic_type not in ['mellanox']"

qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolWatermark[None]:
qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolWatermark:
xfail:
reason: "Headroom pool size not supported."
conditions:
Expand Down Expand Up @@ -773,13 +773,9 @@ snmp/test_snmp_phy_entity.py::test_psu_info:

snmp/test_snmp_queue.py:
skip:
reason: "Interfaces not present on supervisor node"
reason: "Interfaces not present on supervisor node or M0 topo does not support test_snmp_queue"
conditions:
- "is_supervisor"
skip:
reason: "M0 topo does not support test_snmp_queue"
conditions:
- "topo_name in ['m0']"
- "is_supervisor or topo_name in ['m0']"

#######################################
##### span #####
Expand Down
34 changes: 18 additions & 16 deletions tests/saitests/py3/sai_qos_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@ def runTest(self):
pkts_num_trig_pfc = self.pkts_num_trig_pfc_shp[i]

send_packet(
self, self.src_port_ids[sidx_dscp_pg_tuples[i][0]], pkt, pkts_num_trig_pfc / self.pkt_size_factor)
self, self.src_port_ids[sidx_dscp_pg_tuples[i][0]], pkt, pkts_num_trig_pfc // self.pkt_size_factor)

print("Service pool almost filled", file=sys.stderr)
sys.stderr.flush()
Expand Down Expand Up @@ -1911,8 +1911,8 @@ def runTest(self):
ip_tos=tos,
ip_ttl=ttl)

send_packet(self, self.src_port_ids[sidx_dscp_pg_tuples[i][0]], pkt, self.pkts_num_hdrm_full /
self.pkt_size_factor if i != self.pgs_num - 1 else self.pkts_num_hdrm_partial / self.pkt_size_factor)
send_packet(self, self.src_port_ids[sidx_dscp_pg_tuples[i][0]], pkt, self.pkts_num_hdrm_full //
self.pkt_size_factor if i != self.pgs_num - 1 else self.pkts_num_hdrm_partial // self.pkt_size_factor)
# allow enough time for the dut to sync up the counter values in counters_db
time.sleep(8)

Expand Down Expand Up @@ -2057,7 +2057,7 @@ def runTest(self):

# Test configuration packet counts and sizing should accurately trigger shared limit
cell_occupancy = (self.packet_size +
self.cell_size - 1) / self.cell_size
self.cell_size - 1) // self.cell_size
assert sum(self.pkt_counts[:-1]) * cell_occupancy * \
self.cell_size < self.shared_limit_bytes
assert sum(self.pkt_counts) * cell_occupancy * \
Expand Down Expand Up @@ -2493,7 +2493,7 @@ def runTest(self):
packet_length = int(self.test_params['packet_size'])
cell_size = int(self.test_params['cell_size'])
if packet_length != 64:
cell_occupancy = (packet_length + cell_size - 1) / cell_size
cell_occupancy = (packet_length + cell_size - 1) // cell_size
pkts_num_trig_egr_drp /= cell_occupancy
# It is possible that pkts_num_trig_egr_drp * cell_occupancy < original pkts_num_trig_egr_drp,
# which probably can fail the assert(xmit_counters[EGRESS_DROP] > xmit_counters_base[EGRESS_DROP])
Expand Down Expand Up @@ -2640,8 +2640,8 @@ def runTest(self):
packet_length = int(self.test_params['packet_size'])
cell_size = int(self.test_params['cell_size'])
if packet_length != 64:
cell_occupancy = (packet_length + cell_size - 1) / cell_size
pkts_num_trig_egr_drp /= cell_occupancy
cell_occupancy = (packet_length + cell_size - 1) // cell_size
pkts_num_trig_egr_drp //= cell_occupancy
else:
packet_length = 64

Expand Down Expand Up @@ -2769,7 +2769,7 @@ def runTest(self):
else:
packet_length = 64

cell_occupancy = (packet_length + cell_size - 1) / cell_size
cell_occupancy = (packet_length + cell_size - 1) // cell_size

# Prepare TCP packet data
ttl = 64
Expand Down Expand Up @@ -2870,7 +2870,7 @@ def runTest(self):
# first round sends only 1 packet
expected_wm = 0
total_shared = pkts_num_fill_shared - pkts_num_fill_min
pkts_inc = (total_shared / cell_occupancy) >> 2
pkts_inc = (total_shared // cell_occupancy) >> 2
if 'cisco-8000' in asic_type:
# No additional packet margin needed while sending,
# but small margin still needed during boundary checks below
Expand All @@ -2882,7 +2882,7 @@ def runTest(self):
expected_wm += pkts_num * cell_occupancy
if (expected_wm > total_shared):
diff = (expected_wm - total_shared +
cell_occupancy - 1) / cell_occupancy
cell_occupancy - 1) // cell_occupancy
pkts_num -= diff
expected_wm -= diff * cell_occupancy
fragment = total_shared - expected_wm
Expand Down Expand Up @@ -3053,7 +3053,9 @@ def runTest(self):
q_wm_res, pg_shared_wm_res, pg_headroom_wm_res = sai_thrift_read_port_watermarks(
self.client, port_list[src_port_id])
print("exceeded pkts num sent: %d" % (pkts_num), file=sys.stderr)
print("lower bound: %d, actual value: %d, upper bound: %d" % (expected_wm - margin) * cell_size * cell_occupancy, pg_headroom_wm_res[pg], ((expected_wm + margin) * cell_size * cell_occupancy), file=sys.stderr)
print("lower bound: %d, actual value: %d, upper bound: %d" %
((expected_wm - margin) * cell_size * cell_occupancy, pg_headroom_wm_res[pg],
((expected_wm + margin) * cell_size * cell_occupancy)), file=sys.stderr)
assert(expected_wm == total_hdrm)
assert(pg_headroom_wm_res[pg] <= (
expected_wm + margin) * cell_size * cell_occupancy)
Expand Down Expand Up @@ -3129,7 +3131,7 @@ def runTest(self):
if 'cisco-8000' in asic_type:
queue_counters=sai_thrift_read_queue_occupancy(
self.client, dst_port_id)
occ_pkts=queue_counters[queue] / (packet_length + 24)
occ_pkts=queue_counters[queue] // (packet_length + 24)
leaked_pkts=pkts_num_trig_pfc - occ_pkts
print("resending leaked packets {}".format(
leaked_pkts), file=sys.stderr)
Expand Down Expand Up @@ -3195,7 +3197,7 @@ def runTest(self):
else:
packet_length=64

cell_occupancy=(packet_length + cell_size - 1) / cell_size
cell_occupancy=(packet_length + cell_size - 1) // cell_size

# Prepare TCP packet data
ttl=64
Expand Down Expand Up @@ -3289,7 +3291,7 @@ def runTest(self):
# first round sends only 1 packet
expected_wm=0
total_shared=pkts_num_trig_drp - pkts_num_fill_min - 1
pkts_inc=(total_shared / cell_occupancy) >> 2
pkts_inc=(total_shared // cell_occupancy) >> 2
if 'cisco-8000' in asic_type:
pkts_total=0 # track total desired queue fill level
pkts_num=1
Expand All @@ -3300,7 +3302,7 @@ def runTest(self):
expected_wm += pkts_num * cell_occupancy
if (expected_wm > total_shared):
diff=(expected_wm - total_shared + \
cell_occupancy - 1) / cell_occupancy
cell_occupancy - 1) // cell_occupancy
pkts_num -= diff
expected_wm -= diff * cell_occupancy
fragment=total_shared - expected_wm
Expand Down Expand Up @@ -3420,7 +3422,7 @@ def runTest(self):
else:
packet_length=64

cell_occupancy=(packet_length + cell_size - 1) / cell_size
cell_occupancy=(packet_length + cell_size - 1) // cell_size

pkt=simple_tcp_packet(pktlen=packet_length,
eth_dst=router_mac if router_mac != '' else dst_port_mac,
Expand Down