Skip to content

Commit 9e60c56

Browse files
committed
imporve qos log readability (sonic-net#12526)
Log message wrapper: All the messages were outputted to PTF logging by default, and can set flag to output to stderr of PTF console for specific message. so it can avoid lots of message flush on console and "test summary", easy to identify failure when triage. and also can check PTF logging which include all the message when rootcause failure. CounterCollector Class provide general interface for counter collecting, comparing, and displaying. Diagnostic Counter Wrapper so far, we can read 8 kinds of counter: port_counter, queue_counter_counter, queue_share_wm_counter, pg_share_wm_counter, pg_headroom_wm_counter, pg_counter_couner, pg_drop_counter and ptf_tx_rx_counter Although CounterCollector provides a common API to collect, compare and display these counters, if you use countercollect directly, the code of the test case will still become confusing. After all, at least one line of code for each counter. If the types of counter queries are subsequently increased, more code unrelated to the test steps will be exposed in the testcase. Therefore, the diag coutner wrapper is used to include all types of counter activities, so that the code in the test case is more inclined to reflect the test steps and logic rather than these diagnostic codes. assert wrapper By default, we will display the counter difference between the first and last step of this case on both normal and abnormal exits. but using python build-in assert instruction make it difficult to show counter diff. so we implement a assert wrapper to show counter diff when assert exception occur. TextTable Class This is not newly added class, in befor, it help to output counters in table format like well-known python library prettytable. in this PR, add a new class static method "merge_table())" to merge two table which need to show their difference. example case: not applied this feature to all qos testcase. only applied above changes to xoff, xon, lossyqueue cases as a example first. Monitor for long time to collect the feedback, and then enhance. already cover various sku/topo see below test record table skip chassis device since test have not covered chassis yet, skip chassis device support so far. How did you verify/test it? pass verification in lab testbed
1 parent 3e924dd commit 9e60c56

3 files changed

Lines changed: 432 additions & 183 deletions

File tree

tests/qos/test_qos_sai.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ def testQosSaiPfcXoffLimit(
362362

363363
testParams = dict()
364364
testParams.update(dutTestParams["basicParams"])
365+
testParams.update({"test_port_ids": dutConfig["testPortIds"]})
365366
testParams.update({
366367
"dscp": qosConfig[xoffProfile]["dscp"],
367368
"ecn": qosConfig[xoffProfile]["ecn"],
@@ -634,6 +635,7 @@ def testQosSaiPfcXonLimit(
634635

635636
testParams = dict()
636637
testParams.update(dutTestParams["basicParams"])
638+
testParams.update({"test_port_ids": dutConfig["testPortIds"]})
637639
testParams.update({
638640
"dscp": qosConfig[xonProfile]["dscp"],
639641
"ecn": qosConfig[xonProfile]["ecn"],
@@ -1162,6 +1164,7 @@ def testQosSaiLossyQueue(
11621164

11631165
testParams = dict()
11641166
testParams.update(dutTestParams["basicParams"])
1167+
testParams.update({"test_port_ids": dutConfig["testPortIds"]})
11651168
testParams.update({
11661169
"dscp": qosConfig["lossy_queue_1"]["dscp"],
11671170
"ecn": qosConfig["lossy_queue_1"]["ecn"],

0 commit comments

Comments
 (0)