997
997
}"""
998
998
999
999
show_queue_voq_counters = """\
1000
- Port Voq Counter/pkts Counter/bytes Drop/pkts Drop/bytes
1001
- --------- ----- -------------- --------------- ----------- ------------
1002
- Ethernet0 VOQ0 68 30 56 74
1003
- Ethernet0 VOQ1 60 43 39 1
1004
- Ethernet0 VOQ2 82 7 39 21
1005
- Ethernet0 VOQ3 11 59 12 94
1006
- Ethernet0 VOQ4 36 62 35 40
1007
- Ethernet0 VOQ5 49 91 2 88
1008
- Ethernet0 VOQ6 33 17 94 74
1009
- Ethernet0 VOQ7 40 71 95 33
1000
+ Port Voq Counter/pkts Counter/bytes Drop/pkts Drop/bytes
1001
+ ---------------- ----- -------------- --------------- ----------- ------------
1002
+ testsw| Ethernet0 VOQ0 68 30 56 74
1003
+ testsw| Ethernet0 VOQ1 60 43 39 1
1004
+ testsw| Ethernet0 VOQ2 82 7 39 21
1005
+ testsw| Ethernet0 VOQ3 11 59 12 94
1006
+ testsw| Ethernet0 VOQ4 36 62 35 40
1007
+ testsw| Ethernet0 VOQ5 49 91 2 88
1008
+ testsw| Ethernet0 VOQ6 33 17 94 74
1009
+ testsw| Ethernet0 VOQ7 40 71 95 33
1010
1010
1011
- Port Voq Counter/pkts Counter/bytes Drop/pkts Drop/bytes
1012
- --------- ----- -------------- --------------- ----------- ------------
1013
- Ethernet4 VOQ0 54 8 93 78
1014
- Ethernet4 VOQ1 83 96 74 9
1015
- Ethernet4 VOQ2 15 60 61 31
1016
- Ethernet4 VOQ3 45 52 82 94
1017
- Ethernet4 VOQ4 55 88 89 52
1018
- Ethernet4 VOQ5 14 70 95 79
1019
- Ethernet4 VOQ6 68 60 66 81
1020
- Ethernet4 VOQ7 63 4 48 76
1011
+ Port Voq Counter/pkts Counter/bytes Drop/pkts Drop/bytes
1012
+ ---------------- ----- -------------- --------------- ----------- ------------
1013
+ testsw| Ethernet4 VOQ0 54 8 93 78
1014
+ testsw| Ethernet4 VOQ1 83 96 74 9
1015
+ testsw| Ethernet4 VOQ2 15 60 61 31
1016
+ testsw| Ethernet4 VOQ3 45 52 82 94
1017
+ testsw| Ethernet4 VOQ4 55 88 89 52
1018
+ testsw| Ethernet4 VOQ5 14 70 95 79
1019
+ testsw| Ethernet4 VOQ6 68 60 66 81
1020
+ testsw| Ethernet4 VOQ7 63 4 48 76
1021
1021
1022
- Port Voq Counter/pkts Counter/bytes Drop/pkts Drop/bytes
1023
- --------- ----- -------------- --------------- ----------- ------------
1024
- Ethernet8 VOQ0 41 73 77 74
1025
- Ethernet8 VOQ1 60 21 56 54
1026
- Ethernet8 VOQ2 57 31 12 39
1027
- Ethernet8 VOQ3 41 96 70 98
1028
- Ethernet8 VOQ4 18 49 63 36
1029
- Ethernet8 VOQ5 99 90 3 15
1030
- Ethernet8 VOQ6 8 84 82 94
1031
- Ethernet8 VOQ7 83 15 75 92
1022
+ Port Voq Counter/pkts Counter/bytes Drop/pkts Drop/bytes
1023
+ ---------------- ----- -------------- --------------- ----------- ------------
1024
+ testsw| Ethernet8 VOQ0 41 73 77 74
1025
+ testsw| Ethernet8 VOQ1 60 21 56 54
1026
+ testsw| Ethernet8 VOQ2 57 31 12 39
1027
+ testsw| Ethernet8 VOQ3 41 96 70 98
1028
+ testsw| Ethernet8 VOQ4 18 49 63 36
1029
+ testsw| Ethernet8 VOQ5 99 90 3 15
1030
+ testsw| Ethernet8 VOQ6 8 84 82 94
1031
+ testsw| Ethernet8 VOQ7 83 15 75 92
1032
1032
1033
1033
"""
1034
1034
1035
+ show_queue_voq_counters_with_clear = ["""\
1036
+ Port Voq Counter/pkts Counter/bytes Drop/pkts Drop/bytes
1037
+ ---------------- ----- -------------- --------------- ----------- ------------
1038
+ testsw|Ethernet0 VOQ0 0 0 0 0
1039
+ testsw|Ethernet0 VOQ1 0 0 0 0
1040
+ testsw|Ethernet0 VOQ2 0 0 0 0
1041
+ testsw|Ethernet0 VOQ3 0 0 0 0
1042
+ testsw|Ethernet0 VOQ4 0 0 0 0
1043
+ testsw|Ethernet0 VOQ5 0 0 0 0
1044
+ testsw|Ethernet0 VOQ6 0 0 0 0
1045
+ testsw|Ethernet0 VOQ7 0 0 0 0
1046
+ """ , """\
1047
+ Port Voq Counter/pkts Counter/bytes Drop/pkts Drop/bytes
1048
+ ---------------- ----- -------------- --------------- ----------- ------------
1049
+ testsw|Ethernet4 VOQ0 0 0 0 0
1050
+ testsw|Ethernet4 VOQ1 0 0 0 0
1051
+ testsw|Ethernet4 VOQ2 0 0 0 0
1052
+ testsw|Ethernet4 VOQ3 0 0 0 0
1053
+ testsw|Ethernet4 VOQ4 0 0 0 0
1054
+ testsw|Ethernet4 VOQ5 0 0 0 0
1055
+ testsw|Ethernet4 VOQ6 0 0 0 0
1056
+ testsw|Ethernet4 VOQ7 0 0 0 0
1057
+ """ , """\
1058
+ Port Voq Counter/pkts Counter/bytes Drop/pkts Drop/bytes
1059
+ ---------------- ----- -------------- --------------- ----------- ------------
1060
+ testsw|Ethernet8 VOQ0 0 0 0 0
1061
+ testsw|Ethernet8 VOQ1 0 0 0 0
1062
+ testsw|Ethernet8 VOQ2 0 0 0 0
1063
+ testsw|Ethernet8 VOQ3 0 0 0 0
1064
+ testsw|Ethernet8 VOQ4 0 0 0 0
1065
+ testsw|Ethernet8 VOQ5 0 0 0 0
1066
+ testsw|Ethernet8 VOQ6 0 0 0 0
1067
+ testsw|Ethernet8 VOQ7 0 0 0 0
1068
+ """
1069
+ ]
1070
+
1035
1071
show_queue_port_voq_counters = """\
1036
- Port Voq Counter/pkts Counter/bytes Drop/pkts Drop/bytes
1037
- --------- ----- -------------- --------------- ----------- ------------
1038
- Ethernet0 VOQ0 68 30 56 74
1039
- Ethernet0 VOQ1 60 43 39 1
1040
- Ethernet0 VOQ2 82 7 39 21
1041
- Ethernet0 VOQ3 11 59 12 94
1042
- Ethernet0 VOQ4 36 62 35 40
1043
- Ethernet0 VOQ5 49 91 2 88
1044
- Ethernet0 VOQ6 33 17 94 74
1045
- Ethernet0 VOQ7 40 71 95 33
1072
+ Port Voq Counter/pkts Counter/bytes Drop/pkts Drop/bytes
1073
+ ---------------- ----- -------------- --------------- ----------- ------------
1074
+ testsw| Ethernet0 VOQ0 68 30 56 74
1075
+ testsw| Ethernet0 VOQ1 60 43 39 1
1076
+ testsw| Ethernet0 VOQ2 82 7 39 21
1077
+ testsw| Ethernet0 VOQ3 11 59 12 94
1078
+ testsw| Ethernet0 VOQ4 36 62 35 40
1079
+ testsw| Ethernet0 VOQ5 49 91 2 88
1080
+ testsw| Ethernet0 VOQ6 33 17 94 74
1081
+ testsw| Ethernet0 VOQ7 40 71 95 33
1046
1082
1047
1083
"""
1048
1084
1049
1085
show_queue_voq_counters_json = """\
1050
1086
{
1051
- "Ethernet0": {
1087
+ "testsw| Ethernet0": {
1052
1088
"VOQ0": {
1053
1089
"dropbytes": "74",
1054
1090
"droppacket": "56",
1098
1134
"totalpacket": "40"
1099
1135
}
1100
1136
},
1101
- "Ethernet4": {
1137
+ "testsw| Ethernet4": {
1102
1138
"VOQ0": {
1103
1139
"dropbytes": "78",
1104
1140
"droppacket": "93",
1148
1184
"totalpacket": "63"
1149
1185
}
1150
1186
},
1151
- "Ethernet8": {
1187
+ "testsw| Ethernet8": {
1152
1188
"VOQ0": {
1153
1189
"dropbytes": "74",
1154
1190
"droppacket": "77",
1202
1238
1203
1239
show_queue_port_voq_counters_json = """\
1204
1240
{
1205
- "Ethernet0": {
1241
+ "testsw| Ethernet0": {
1206
1242
"VOQ0": {
1207
1243
"dropbytes": "74",
1208
1244
"droppacket": "56",
@@ -1339,11 +1375,29 @@ def test_queue_voq_counters(self):
1339
1375
assert result .exit_code == 0
1340
1376
assert result .output == show_queue_voq_counters
1341
1377
1378
+ def test_queue_voq_counters_with_clear (self ):
1379
+ runner = CliRunner ()
1380
+ result = runner .invoke (clear .cli .commands ['queuecounters' ], [])
1381
+ assert result .exit_code == 0
1382
+ result = runner .invoke (
1383
+ show .cli .commands ["queue" ].commands ["counters" ],
1384
+ ["--voq" ]
1385
+ )
1386
+ print (result .output )
1387
+ show .run_command (['queuestat' , '-d' , '--voq' ])
1388
+ assert result .exit_code == 0
1389
+ assert "Ethernet0 Last cached time was" in result .output and \
1390
+ "Ethernet4 Last cached time was" in result .output and \
1391
+ "Ethernet8 Last cached time was" in result .output
1392
+ assert show_queue_voq_counters_with_clear [0 ] in result .output and \
1393
+ show_queue_voq_counters_with_clear [1 ] in result .output and \
1394
+ show_queue_voq_counters_with_clear [2 ] in result .output
1395
+
1342
1396
def test_queue_port_voq_counters (self ):
1343
1397
runner = CliRunner ()
1344
1398
result = runner .invoke (
1345
1399
show .cli .commands ["queue" ].commands ["counters" ],
1346
- ["Ethernet0" , "--voq" ]
1400
+ ["testsw| Ethernet0" , "--voq" ]
1347
1401
)
1348
1402
print (result .output )
1349
1403
assert result .exit_code == 0
@@ -1370,7 +1424,7 @@ def test_queue_voq_counters_port_json(self):
1370
1424
runner = CliRunner ()
1371
1425
result = runner .invoke (
1372
1426
show .cli .commands ["queue" ].commands ["counters" ],
1373
- ["Ethernet0" , "--voq" , "--json" ]
1427
+ ["testsw| Ethernet0" , "--voq" , "--json" ]
1374
1428
)
1375
1429
assert result .exit_code == 0
1376
1430
print (result .output )
0 commit comments