Skip to content

Commit

Permalink
[QoS] Add debug information for WRRtest
Browse files Browse the repository at this point in the history
[QoS] Support ARP populate on PTF
  • Loading branch information
Stephen Sun committed May 13, 2020
1 parent 8964b16 commit ae09f11
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
29 changes: 28 additions & 1 deletion ansible/roles/test/files/saitests/sai_qos_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,25 @@ def runTest(self):
send_packet(self, self.dst_port_3_id, arpreq_pkt)
time.sleep(8)


class ARPpopulatePTF(sai_base_test.ThriftInterfaceDataPlane):
def runTest(self):
router_mac = self.test_params['router_mac']
## ARP Populate
index = 0
for port in ptf_ports():
arpreq_pkt = simple_arp_packet(
eth_dst='ff:ff:ff:ff:ff:ff',
eth_src=self.dataplane.get_mac(port[0],port[1]),
arp_op=1,
ip_snd='10.0.0.%d' % (index * 2 + 1),
ip_tgt='10.0.0.%d' % (index * 2),
hw_snd=self.dataplane.get_mac(port[0], port[1]),
hw_tgt='ff:ff:ff:ff:ff:ff')
send_packet(self, port[1], arpreq_pkt)
index += 1


class ReleaseAllPorts(sai_base_test.ThriftInterfaceDataPlane):
def runTest(self):
switch_init(self.client)
Expand Down Expand Up @@ -1268,6 +1287,8 @@ def runTest(self):
queue_num_of_pkts[48] = queue_6_num_of_pkts
total_pkts = 0

diff_list = []

for pkt_to_inspect in pkts:
dscp_of_pkt = pkt_to_inspect.payload.tos >> 2
total_pkts += 1
Expand All @@ -1276,10 +1297,16 @@ def runTest(self):

queue_pkt_counters[dscp_of_pkt] += 1
if queue_pkt_counters[dscp_of_pkt] == queue_num_of_pkts[dscp_of_pkt]:
assert((queue_0_num_of_pkts + queue_1_num_of_pkts + queue_2_num_of_pkts + queue_3_num_of_pkts + queue_4_num_of_pkts + queue_5_num_of_pkts + queue_6_num_of_pkts) - total_pkts < limit)
diff_list.append((dscp_of_pkt, (queue_0_num_of_pkts + queue_1_num_of_pkts + queue_2_num_of_pkts + queue_3_num_of_pkts + queue_4_num_of_pkts + queue_5_num_of_pkts + queue_6_num_of_pkts) - total_pkts))

print >> sys.stderr, queue_pkt_counters

print >> sys.stderr, "Difference for each dscp: "
print >> sys.stderr, diff_list

for dscp, diff in diff_list:
assert diff < limit, "Difference for %d is %d which exceeds limit %d" % (dscp, diff, limit)

# Read counters
print "DST port counters: "
port_counters, queue_counters = sai_thrift_read_port_counters(self.client, port_list[dst_port_id])
Expand Down
15 changes: 15 additions & 0 deletions ansible/roles/test/tasks/qos_sai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@
- src_port_ip='{{src_port_ip}}'
when: testbed_type in ['t0', 't0-64', 't0-116'] or arp_entries.stdout.find('incomplete') == -1

- include_tasks: qos_sai_ptf.yml
vars:
test_name: populate arp on all ports
test_path: sai_qos_tests.ARPpopulatePTF
test_params:
- dst_port_id='{{dst_port_id}}'
- dst_port_ip='{{dst_port_ip}}'
- dst_port_2_id='{{dst_port_2_id}}'
- dst_port_2_ip='{{dst_port_2_ip}}'
- dst_port_3_id='{{dst_port_3_id}}'
- dst_port_3_ip='{{dst_port_3_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
when: testbed_type in ['ptf32', 'ptf64']

# XOFF limit
- include_tasks: qos_sai_ptf.yml
vars:
Expand Down

0 comments on commit ae09f11

Please sign in to comment.