diff --git a/clear/main.py b/clear/main.py index 26e9e22f32ef..f7e5d715ed0e 100755 --- a/clear/main.py +++ b/clear/main.py @@ -272,6 +272,12 @@ def clear_wm_q_multi(): command = 'watermarkstat -c -t q_shared_multi' run_command(command) +@watermark.command('all') +def clear_wm_q_all(): + """Clear user WM for all queues""" + command = 'watermarkstat -c -t q_shared_all' + run_command(command) + @queue.group(name='persistent-watermark') def persistent_watermark(): """Clear queue persistent WM. One does not simply clear WM, root is required""" @@ -290,6 +296,11 @@ def clear_pwm_q_multi(): command = 'watermarkstat -c -p -t q_shared_multi' run_command(command) +@persistent_watermark.command('all') +def clear_pwm_q_all(): + """Clear persistent WM for all queues""" + command = 'watermarkstat -c -p -t q_shared_all' + run_command(command) @cli.group(name='headroom-pool') def headroom_pool(): diff --git a/scripts/watermarkstat b/scripts/watermarkstat index bae72821c7f7..7bdc7a015879 100755 --- a/scripts/watermarkstat +++ b/scripts/watermarkstat @@ -63,7 +63,7 @@ class Watermarkstat(object): def __init__(self): self.counters_db = SonicV2Connector(use_unix_socket_path=False) self.counters_db.connect(self.counters_db.COUNTERS_DB) - + # connect APP DB for clear notifications self.app_db = SonicV2Connector(use_unix_socket_path=False) self.app_db.connect(self.counters_db.APPL_DB) @@ -107,12 +107,14 @@ class Watermarkstat(object): self.port_uc_queues_map = {} self.port_mc_queues_map = {} + self.port_all_queues_map = {} self.port_pg_map = {} self.port_name_map = {} for port in self.counter_port_name_map: self.port_uc_queues_map[port] = {} self.port_mc_queues_map[port] = {} + self.port_all_queues_map[port] = {} self.port_pg_map[port] = {} self.port_name_map[self.counter_port_name_map[port]] = port @@ -130,6 +132,9 @@ class Watermarkstat(object): elif get_queue_type(counter_queue_name_map[queue]) == QUEUE_TYPE_MC: self.port_mc_queues_map[port][queue] = counter_queue_name_map[queue] + elif get_queue_type(counter_queue_name_map[queue]) == QUEUE_TYPE_ALL: + self.port_all_queues_map[port][queue] = counter_queue_name_map[queue] + # Get PGs for each port counter_pg_name_map = self.counters_db.get_all(self.counters_db.COUNTERS_DB, COUNTERS_PG_NAME_MAP) if counter_pg_name_map is None: @@ -167,6 +172,11 @@ class Watermarkstat(object): "idx_func": self.get_queue_index, "wm_name" : "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES", "header_prefix": "MC"}, + "q_shared_all": {"message" : "Egress shared pool occupancy per all queues:", + "obj_map" : self.port_all_queues_map, + "idx_func": self.get_queue_index, + "wm_name" : "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES", + "header_prefix": "ALL"}, "buffer_pool" : {"message": "Shared pool maximum occupancy:", "wm_name": "SAI_BUFFER_POOL_STAT_WATERMARK_BYTES", "header" : headerBufferPool}, @@ -271,6 +281,9 @@ def main(): Examples: watermarkstat -t pg_headroom watermarkstat -t pg_shared + watermarkstat -t q_shared_all + watermarkstat -p -t q_shared_all + watermarkstat -t q_shared_all -c watermarkstat -t q_shared_uni -c watermarkstat -t q_shared_multi -c watermarkstat -p -t pg_shared @@ -283,17 +296,17 @@ Examples: parser.add_argument('-c', '--clear', action='store_true', help='Clear watermarks request') parser.add_argument('-p', '--persistent', action='store_true', help='Do the operations on the persistent watermark') parser.add_argument('-t', '--type', required=True, action='store', - choices=['pg_headroom', 'pg_shared', 'q_shared_uni', 'q_shared_multi', 'buffer_pool', 'headroom_pool'], + choices=['pg_headroom', 'pg_shared', 'q_shared_uni', 'q_shared_multi', 'buffer_pool', 'headroom_pool', 'q_shared_all'], help='The type of watermark') parser.add_argument('-v', '--version', action='version', version='%(prog)s 1.0') args = parser.parse_args() watermarkstat = Watermarkstat() - + if args.clear: watermarkstat.send_clear_notification(("PERSISTENT" if args.persistent else "USER", args.type.upper())) sys.exit(0) - - table_prefix = PERSISTENT_TABLE_PREFIX if args.persistent else USER_TABLE_PREFIX + + table_prefix = PERSISTENT_TABLE_PREFIX if args.persistent else USER_TABLE_PREFIX watermarkstat.print_all_stat(table_prefix, args.type) sys.exit(0) diff --git a/show/main.py b/show/main.py index 5fba9d828a22..8e9ee4bcea06 100644 --- a/show/main.py +++ b/show/main.py @@ -556,6 +556,13 @@ def wm_q_multi(): command = 'watermarkstat -t q_shared_multi' run_command(command) +# 'all' subcommand ("show queue watermarks all") +@watermark.command('all') +def wm_q_all(): + """Show user WM for all queues""" + command = 'watermarkstat -t q_shared_all' + run_command(command) + # # 'persistent-watermarks' subgroup ("show queue persistent-watermarks ...") # @@ -579,6 +586,12 @@ def pwm_q_multi(): command = 'watermarkstat -p -t q_shared_multi' run_command(command) +# 'all' subcommand ("show queue persistent-watermarks all") +@persistent_watermark.command('all') +def pwm_q_all(): + """Show persistent WM for all queues""" + command = 'watermarkstat -p -t q_shared_all' + run_command(command) # # 'priority-group' group ("show priority-group ...") diff --git a/tests/mock_tables/counters_db.json b/tests/mock_tables/counters_db.json index 41396c4fa412..3d9164e1d8ac 100644 --- a/tests/mock_tables/counters_db.json +++ b/tests/mock_tables/counters_db.json @@ -394,6 +394,16 @@ "Ethernet0:7": "oid:0x1500000000035e", "Ethernet0:8": "oid:0x1500000000035f", "Ethernet0:9": "oid:0x15000000000360", + "Ethernet0:20": "oid:0x1500000000036d", + "Ethernet0:21": "oid:0x1500000000036e", + "Ethernet0:22": "oid:0x1500000000036f", + "Ethernet0:23": "oid:0x15000000000370", + "Ethernet0:24": "oid:0x15000000000371", + "Ethernet0:25": "oid:0x15000000000372", + "Ethernet0:26": "oid:0x15000000000373", + "Ethernet0:27": "oid:0x15000000000374", + "Ethernet0:28": "oid:0x15000000000375", + "Ethernet0:29": "oid:0x15000000000376", "Ethernet4:0": "oid:0x1500000000037f", "Ethernet4:1": "oid:0x15000000000380", "Ethernet4:10": "oid:0x1500000000038b", @@ -414,6 +424,16 @@ "Ethernet4:7": "oid:0x15000000000386", "Ethernet4:8": "oid:0x15000000000387", "Ethernet4:9": "oid:0x15000000000388", + "Ethernet4:20": "oid:0x15000000000395", + "Ethernet4:21": "oid:0x15000000000396", + "Ethernet4:22": "oid:0x15000000000397", + "Ethernet4:23": "oid:0x15000000000398", + "Ethernet4:24": "oid:0x15000000000399", + "Ethernet4:25": "oid:0x1500000000039a", + "Ethernet4:26": "oid:0x1500000000039b", + "Ethernet4:27": "oid:0x1500000000039c", + "Ethernet4:28": "oid:0x1500000000039d", + "Ethernet4:29": "oid:0x1500000000039e", "Ethernet8:0": "oid:0x150000000003a7", "Ethernet8:1": "oid:0x150000000003a8", "Ethernet8:10": "oid:0x150000000003b3", @@ -433,7 +453,17 @@ "Ethernet8:6": "oid:0x150000000003ad", "Ethernet8:7": "oid:0x150000000003ae", "Ethernet8:8": "oid:0x150000000003af", - "Ethernet8:9": "oid:0x150000000003b0" + "Ethernet8:9": "oid:0x150000000003b0", + "Ethernet8:20": "oid:0x150000000003bd", + "Ethernet8:21": "oid:0x150000000003be", + "Ethernet8:22": "oid:0x150000000003bf", + "Ethernet8:23": "oid:0x150000000003c0", + "Ethernet8:24": "oid:0x150000000003c1", + "Ethernet8:25": "oid:0x150000000003c2", + "Ethernet8:26": "oid:0x150000000003c3", + "Ethernet8:27": "oid:0x150000000003c4", + "Ethernet8:28": "oid:0x150000000003c5", + "Ethernet8:29": "oid:0x150000000003c6" }, "COUNTERS_LAG_NAME_MAP": { "PortChannel0001": "oid:0x60000000005a1", @@ -519,6 +549,16 @@ "oid:0x1500000000036a": "oid:0x1000000000012", "oid:0x1500000000036b": "oid:0x1000000000012", "oid:0x1500000000036c": "oid:0x1000000000012", + "oid:0x1500000000036d": "oid:0x1000000000012", + "oid:0x1500000000036e": "oid:0x1000000000012", + "oid:0x1500000000036f": "oid:0x1000000000012", + "oid:0x15000000000370": "oid:0x1000000000012", + "oid:0x15000000000371": "oid:0x1000000000012", + "oid:0x15000000000372": "oid:0x1000000000012", + "oid:0x15000000000373": "oid:0x1000000000012", + "oid:0x15000000000374": "oid:0x1000000000012", + "oid:0x15000000000375": "oid:0x1000000000012", + "oid:0x15000000000376": "oid:0x1000000000012", "oid:0x1500000000037f": "oid:0x1000000000013", "oid:0x15000000000380": "oid:0x1000000000013", "oid:0x15000000000381": "oid:0x1000000000013", @@ -539,6 +579,16 @@ "oid:0x15000000000392": "oid:0x1000000000013", "oid:0x15000000000393": "oid:0x1000000000013", "oid:0x15000000000394": "oid:0x1000000000013", + "oid:0x15000000000395": "oid:0x1000000000013", + "oid:0x15000000000396": "oid:0x1000000000013", + "oid:0x15000000000397": "oid:0x1000000000013", + "oid:0x15000000000398": "oid:0x1000000000013", + "oid:0x15000000000399": "oid:0x1000000000013", + "oid:0x1500000000039a": "oid:0x1000000000013", + "oid:0x1500000000039b": "oid:0x1000000000013", + "oid:0x1500000000039c": "oid:0x1000000000013", + "oid:0x1500000000039d": "oid:0x1000000000013", + "oid:0x1500000000039e": "oid:0x1000000000013", "oid:0x150000000003a7": "oid:0x1000000000014", "oid:0x150000000003a8": "oid:0x1000000000014", "oid:0x150000000003a9": "oid:0x1000000000014", @@ -558,7 +608,17 @@ "oid:0x150000000003b9": "oid:0x1000000000014", "oid:0x150000000003ba": "oid:0x1000000000014", "oid:0x150000000003bb": "oid:0x1000000000014", - "oid:0x150000000003bc": "oid:0x1000000000014" + "oid:0x150000000003bc": "oid:0x1000000000014", + "oid:0x150000000003bd": "oid:0x1000000000014", + "oid:0x150000000003be": "oid:0x1000000000014", + "oid:0x150000000003bf": "oid:0x1000000000014", + "oid:0x150000000003c0": "oid:0x1000000000014", + "oid:0x150000000003c1": "oid:0x1000000000014", + "oid:0x150000000003c2": "oid:0x1000000000014", + "oid:0x150000000003c3": "oid:0x1000000000014", + "oid:0x150000000003c4": "oid:0x1000000000014", + "oid:0x150000000003c5": "oid:0x1000000000014", + "oid:0x150000000003c6": "oid:0x1000000000014" }, "COUNTERS_PG_INDEX_MAP": { "oid:0x1a00000000034f": "0", @@ -607,6 +667,16 @@ "oid:0x1500000000036a": "17", "oid:0x1500000000036b": "18", "oid:0x1500000000036c": "19", + "oid:0x1500000000036d": "20", + "oid:0x1500000000036e": "21", + "oid:0x1500000000036f": "22", + "oid:0x15000000000370": "23", + "oid:0x15000000000371": "24", + "oid:0x15000000000372": "25", + "oid:0x15000000000373": "26", + "oid:0x15000000000374": "27", + "oid:0x15000000000375": "28", + "oid:0x15000000000376": "29", "oid:0x1500000000037f": "0", "oid:0x15000000000380": "1", "oid:0x15000000000381": "2", @@ -627,6 +697,16 @@ "oid:0x15000000000392": "17", "oid:0x15000000000393": "18", "oid:0x15000000000394": "19", + "oid:0x15000000000395": "20", + "oid:0x15000000000396": "21", + "oid:0x15000000000397": "22", + "oid:0x15000000000398": "23", + "oid:0x15000000000399": "24", + "oid:0x1500000000039a": "25", + "oid:0x1500000000039b": "26", + "oid:0x1500000000039c": "27", + "oid:0x1500000000039d": "28", + "oid:0x1500000000039e": "29", "oid:0x150000000003a7": "0", "oid:0x150000000003a8": "1", "oid:0x150000000003a9": "2", @@ -646,7 +726,17 @@ "oid:0x150000000003b9": "16", "oid:0x150000000003ba": "17", "oid:0x150000000003bb": "18", - "oid:0x150000000003bc": "19" + "oid:0x150000000003bc": "19", + "oid:0x150000000003bd": "20", + "oid:0x150000000003be": "21", + "oid:0x150000000003bf": "22", + "oid:0x150000000003c0": "23", + "oid:0x150000000003c1": "24", + "oid:0x150000000003c2": "25", + "oid:0x150000000003c3": "26", + "oid:0x150000000003c4": "27", + "oid:0x150000000003c5": "28", + "oid:0x150000000003c6": "29" }, "COUNTERS_QUEUE_TYPE_MAP": { "oid:0x15000000000357": "SAI_QUEUE_TYPE_UNICAST", @@ -669,6 +759,16 @@ "oid:0x1500000000036a": "SAI_QUEUE_TYPE_MULTICAST", "oid:0x1500000000036b": "SAI_QUEUE_TYPE_MULTICAST", "oid:0x1500000000036c": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x1500000000036d": "SAI_QUEUE_TYPE_ALL", + "oid:0x1500000000036e": "SAI_QUEUE_TYPE_ALL", + "oid:0x1500000000036f": "SAI_QUEUE_TYPE_ALL", + "oid:0x15000000000370": "SAI_QUEUE_TYPE_ALL", + "oid:0x15000000000371": "SAI_QUEUE_TYPE_ALL", + "oid:0x15000000000372": "SAI_QUEUE_TYPE_ALL", + "oid:0x15000000000373": "SAI_QUEUE_TYPE_ALL", + "oid:0x15000000000374": "SAI_QUEUE_TYPE_ALL", + "oid:0x15000000000375": "SAI_QUEUE_TYPE_ALL", + "oid:0x15000000000376": "SAI_QUEUE_TYPE_ALL", "oid:0x1500000000037f": "SAI_QUEUE_TYPE_UNICAST", "oid:0x15000000000380": "SAI_QUEUE_TYPE_UNICAST", "oid:0x15000000000381": "SAI_QUEUE_TYPE_UNICAST", @@ -689,6 +789,16 @@ "oid:0x15000000000392": "SAI_QUEUE_TYPE_MULTICAST", "oid:0x15000000000393": "SAI_QUEUE_TYPE_MULTICAST", "oid:0x15000000000394": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x15000000000395": "SAI_QUEUE_TYPE_ALL", + "oid:0x15000000000396": "SAI_QUEUE_TYPE_ALL", + "oid:0x15000000000397": "SAI_QUEUE_TYPE_ALL", + "oid:0x15000000000398": "SAI_QUEUE_TYPE_ALL", + "oid:0x15000000000399": "SAI_QUEUE_TYPE_ALL", + "oid:0x1500000000039a": "SAI_QUEUE_TYPE_ALL", + "oid:0x1500000000039b": "SAI_QUEUE_TYPE_ALL", + "oid:0x1500000000039c": "SAI_QUEUE_TYPE_ALL", + "oid:0x1500000000039d": "SAI_QUEUE_TYPE_ALL", + "oid:0x1500000000039e": "SAI_QUEUE_TYPE_ALL", "oid:0x150000000003a7": "SAI_QUEUE_TYPE_UNICAST", "oid:0x150000000003a8": "SAI_QUEUE_TYPE_UNICAST", "oid:0x150000000003a9": "SAI_QUEUE_TYPE_UNICAST", @@ -708,7 +818,17 @@ "oid:0x150000000003b9": "SAI_QUEUE_TYPE_MULTICAST", "oid:0x150000000003ba": "SAI_QUEUE_TYPE_MULTICAST", "oid:0x150000000003bb": "SAI_QUEUE_TYPE_MULTICAST", - "oid:0x150000000003bc": "SAI_QUEUE_TYPE_MULTICAST" + "oid:0x150000000003bc": "SAI_QUEUE_TYPE_MULTICAST", + "oid:0x150000000003bd": "SAI_QUEUE_TYPE_ALL", + "oid:0x150000000003be": "SAI_QUEUE_TYPE_ALL", + "oid:0x150000000003bf": "SAI_QUEUE_TYPE_ALL", + "oid:0x150000000003c0": "SAI_QUEUE_TYPE_ALL", + "oid:0x150000000003c1": "SAI_QUEUE_TYPE_ALL", + "oid:0x150000000003c2": "SAI_QUEUE_TYPE_ALL", + "oid:0x150000000003c3": "SAI_QUEUE_TYPE_ALL", + "oid:0x150000000003c4": "SAI_QUEUE_TYPE_ALL", + "oid:0x150000000003c5": "SAI_QUEUE_TYPE_ALL", + "oid:0x150000000003c6": "SAI_QUEUE_TYPE_ALL" }, "COUNTERS_DEBUG_NAME_PORT_STAT_MAP": { "DEBUG_0": "SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE", @@ -994,6 +1114,36 @@ "USER_WATERMARKS:oid:0x15000000000360": { "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "20" }, + "USER_WATERMARKS:oid:0x1500000000036d": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "1234567" + }, + "USER_WATERMARKS:oid:0x1500000000036e": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "7654321" + }, + "USER_WATERMARKS:oid:0x1500000000036f": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x15000000000370": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x15000000000371": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x15000000000372": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "20" + }, + "USER_WATERMARKS:oid:0x15000000000373": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "500" + }, + "USER_WATERMARKS:oid:0x15000000000374": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "200" + }, + "USER_WATERMARKS:oid:0x15000000000375": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x15000000000376": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "10" + }, "USER_WATERMARKS:oid:0x1500000000037f": { "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" }, @@ -1024,6 +1174,36 @@ "USER_WATERMARKS:oid:0x15000000000388": { "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" }, + "USER_WATERMARKS:oid:0x15000000000395": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x15000000000396": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x15000000000397": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x15000000000398": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "1986" + }, + "USER_WATERMARKS:oid:0x15000000000399": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "2567" + }, + "USER_WATERMARKS:oid:0x1500000000039a": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x1500000000039b": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x1500000000039c": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x1500000000039d": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x1500000000039e": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, "USER_WATERMARKS:oid:0x150000000003a7": { "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" }, @@ -1054,6 +1234,36 @@ "USER_WATERMARKS:oid:0x150000000003b0": { "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "7696" }, + "USER_WATERMARKS:oid:0x150000000003bd": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "20" + }, + "USER_WATERMARKS:oid:0x150000000003be": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "5" + }, + "USER_WATERMARKS:oid:0x150000000003bf": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "1998" + }, + "USER_WATERMARKS:oid:0x150000000003c0": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x150000000003c1": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x150000000003c2": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x150000000003c3": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x150000000003c4": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" + }, + "USER_WATERMARKS:oid:0x150000000003c5": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "8528" + }, + "USER_WATERMARKS:oid:0x150000000003c6": { + "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "7696" + }, "PERSISTENT_WATERMARKS:oid:0x15000000000357": { "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "3057328" }, diff --git a/tests/watermarkstat_test.py b/tests/watermarkstat_test.py index b7c9eadb6b12..3b710896c300 100644 --- a/tests/watermarkstat_test.py +++ b/tests/watermarkstat_test.py @@ -33,6 +33,9 @@ def test_show_queue_unicast_wm(self): def test_show_queue_multicast_wm(self): self.executor(testData['show_q_wm_multicast']) + def test_show_queue_all_wm(self): + self.executor(testData['show_q_wm_all']) + def test_show_buffer_pool_wm(self): self.executor(testData['show_buffer_pool_wm']) @@ -51,6 +54,9 @@ def test_show_queue_unicast_persistent_wm(self): def test_show_queue_multicast_persistent_wm(self): self.executor(testData['show_q_pwm_multicast']) + def test_show_queue_all_persistent_wm(self): + self.executor(testData['show_q_pwm_all']) + def test_show_buffer_pool_persistent_wm(self): self.executor(testData['show_buffer_pool_pwm']) diff --git a/tests/wm_input/wm_test_vectors.py b/tests/wm_input/wm_test_vectors.py index a5314b1fe6ed..336afdc42af6 100644 --- a/tests/wm_input/wm_test_vectors.py +++ b/tests/wm_input/wm_test_vectors.py @@ -61,6 +61,24 @@ Ethernet8 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A """ +show_queue_wm_all_output="""\ +Egress shared pool occupancy per all queues: + Port ALL20 ALL21 ALL22 ALL23 ALL24 ALL25 ALL26 ALL27 ALL28 ALL29 +--------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- +Ethernet0 1234567 7654321 0 0 0 20 500 200 0 10 +Ethernet4 0 0 0 1986 2567 0 0 0 0 0 +Ethernet8 20 5 1998 0 0 0 0 0 8528 7696 +""" + +show_queue_pwm_all_output="""\ +Egress shared pool occupancy per all queues: + Port ALL20 ALL21 ALL22 ALL23 ALL24 ALL25 ALL26 ALL27 ALL28 ALL29 +--------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- +Ethernet0 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A +Ethernet4 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A +Ethernet8 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A +""" + show_buffer_pool_wm_output="""\ Shared pool maximum occupancy: Pool Bytes @@ -126,6 +144,14 @@ 'rc_output': show_queue_wm_multicast_output } ], + 'show_q_wm_all' : [ {'cmd' : ['queue', 'watermark', 'all'], + 'rc_output': show_queue_wm_all_output + } + ], + 'show_q_pwm_all' : [ {'cmd' : ['queue', 'persistent-watermark', 'all'], + 'rc_output': show_queue_pwm_all_output + } + ], 'show_buffer_pool_wm' : [ {'cmd' : ['buffer_pool', 'watermark'], 'rc_output': show_buffer_pool_wm_output }