Skip to content

Commit e0b3b4a

Browse files
wenyiz2021yxieca
authored andcommitted
[masic] 'show interfaces counters' reminds to use '-d all' option to check for internal links (#2466)
Print reminder to check internal links on multi-asic platforms Signed-off-by: Wenyi Zhang <[email protected]>
1 parent 5613277 commit e0b3b4a

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

scripts/portstat

+4-1
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ class Portstat(object):
324324
print(table_as_json(table, header))
325325
else:
326326
print(tabulate(table, header, tablefmt='simple', stralign='right'))
327+
if multi_asic.is_multi_asic():
328+
print("\nReminder: Please execute 'show interface counters -d all' to include internal links\n")
327329

328330
def cnstat_intf_diff_print(self, cnstat_new_dict, cnstat_old_dict, intf_list):
329331
"""
@@ -524,7 +526,8 @@ class Portstat(object):
524526
print(table_as_json(table, header))
525527
else:
526528
print(tabulate(table, header, tablefmt='simple', stralign='right'))
527-
529+
if multi_asic.is_multi_asic():
530+
print("\nReminder: Please execute 'show interface counters -d all' to include internal links\n")
528531

529532
def main():
530533
parser = argparse.ArgumentParser(description='Display the ports state and counters',

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ def setup_bgp_commands():
331331
@pytest.fixture
332332
def setup_ip_route_commands():
333333
import show.main as show
334-
335334
return show
336335

336+
337337
@pytest.fixture
338338
def setup_fib_commands():
339339
import show.main as show

tests/portstat_test.py

+32-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
--------- ------- ------- -------- --------- -------- -------- -------- ------- -------- --------- -------- -------- --------
5959
Ethernet0 U 8 0.00 B/s 0.00% 10 100 N/A 10 0.00 B/s 0.00% N/A N/A N/A
6060
Ethernet4 U 4 0.00 B/s 0.00% 0 1,000 N/A 40 0.00 B/s 0.00% N/A N/A N/A
61+
62+
Reminder: Please execute 'show interface counters -d all' to include internal links
63+
6164
"""
6265

6366
multi_asic_all_intf_counters = """\
@@ -69,6 +72,9 @@
6972
Ethernet-BP4 U 8 0.00 B/s 0.00% 0 1,000 N/A 80 0.00 B/s 0.00% N/A N/A N/A
7073
Ethernet-BP256 U 8 0.00 B/s 0.00% 10 100 N/A 10 0.00 B/s 0.00% N/A N/A N/A
7174
Ethernet-BP260 U 4 0.00 B/s 0.00% 0 1,000 N/A 40 0.00 B/s 0.00% N/A N/A N/A
75+
76+
Reminder: Please execute 'show interface counters -d all' to include internal links
77+
7278
"""
7379
multi_asic_intf_counters_asic0 = """\
7480
IFACE STATE RX_OK RX_BPS RX_UTIL RX_ERR RX_DRP RX_OVR TX_OK TX_BPS TX_UTIL TX_ERR TX_DRP TX_OVR
@@ -77,13 +83,19 @@
7783
Ethernet4 U 4 0.00 B/s 0.00% 0 1,000 N/A 40 0.00 B/s 0.00% N/A N/A N/A
7884
Ethernet-BP0 U 6 0.00 B/s 0.00% 0 1,000 N/A 60 0.00 B/s 0.00% N/A N/A N/A
7985
Ethernet-BP4 U 8 0.00 B/s 0.00% 0 1,000 N/A 80 0.00 B/s 0.00% N/A N/A N/A
86+
87+
Reminder: Please execute 'show interface counters -d all' to include internal links
88+
8089
"""
8190

8291
multi_asic_external_intf_counters_printall = """\
8392
IFACE STATE RX_OK RX_BPS RX_PPS RX_UTIL RX_ERR RX_DRP RX_OVR TX_OK TX_BPS TX_PPS TX_UTIL TX_ERR TX_DRP TX_OVR
8493
--------- ------- ------- -------- -------- --------- -------- -------- -------- ------- -------- -------- --------- -------- -------- --------
8594
Ethernet0 U 8 0.00 B/s 0.00/s 0.00% 10 100 N/A 10 0.00 B/s 0.00/s 0.00% N/A N/A N/A
8695
Ethernet4 U 4 0.00 B/s 0.00/s 0.00% 0 1,000 N/A 40 0.00 B/s 0.00/s 0.00% N/A N/A N/A
96+
97+
Reminder: Please execute 'show interface counters -d all' to include internal links
98+
8799
"""
88100

89101
multi_asic_intf_counters_printall = """\
@@ -95,6 +107,9 @@
95107
Ethernet-BP4 U 8 0.00 B/s 0.00/s 0.00% 0 1,000 N/A 80 0.00 B/s 0.00/s 0.00% N/A N/A N/A
96108
Ethernet-BP256 U 8 0.00 B/s 0.00/s 0.00% 10 100 N/A 10 0.00 B/s 0.00/s 0.00% N/A N/A N/A
97109
Ethernet-BP260 U 4 0.00 B/s 0.00/s 0.00% 0 1,000 N/A 40 0.00 B/s 0.00/s 0.00% N/A N/A N/A
110+
111+
Reminder: Please execute 'show interface counters -d all' to include internal links
112+
98113
"""
99114

100115
multi_asic_intf_counters_asic0_printall = """\
@@ -104,13 +119,19 @@
104119
Ethernet4 U 4 0.00 B/s 0.00/s 0.00% 0 1,000 N/A 40 0.00 B/s 0.00/s 0.00% N/A N/A N/A
105120
Ethernet-BP0 U 6 0.00 B/s 0.00/s 0.00% 0 1,000 N/A 60 0.00 B/s 0.00/s 0.00% N/A N/A N/A
106121
Ethernet-BP4 U 8 0.00 B/s 0.00/s 0.00% 0 1,000 N/A 80 0.00 B/s 0.00/s 0.00% N/A N/A N/A
122+
123+
Reminder: Please execute 'show interface counters -d all' to include internal links
124+
107125
"""
108126
multi_asic_intf_counters_period = """\
109127
The rates are calculated within 3 seconds period
110128
IFACE STATE RX_OK RX_BPS RX_UTIL RX_ERR RX_DRP RX_OVR TX_OK TX_BPS TX_UTIL TX_ERR TX_DRP TX_OVR
111129
--------- ------- ------- -------- --------- -------- -------- -------- ------- -------- --------- -------- -------- --------
112130
Ethernet0 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
113131
Ethernet4 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
132+
133+
Reminder: Please execute 'show interface counters -d all' to include internal links
134+
114135
"""
115136

116137
multi_asic_intf_counters_period_all = """\
@@ -123,6 +144,9 @@
123144
Ethernet-BP4 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
124145
Ethernet-BP256 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
125146
Ethernet-BP260 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
147+
148+
Reminder: Please execute 'show interface counters -d all' to include internal links
149+
126150
"""
127151

128152
multi_asic_intf_counter_period_asic_all = """\
@@ -133,6 +157,9 @@
133157
Ethernet4 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
134158
Ethernet-BP0 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
135159
Ethernet-BP4 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
160+
161+
Reminder: Please execute 'show interface counters -d all' to include internal links
162+
136163
"""
137164

138165
mutli_asic_intf_counters_after_clear = """\
@@ -143,7 +170,11 @@
143170
Ethernet-BP0 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
144171
Ethernet-BP4 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
145172
Ethernet-BP256 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
146-
Ethernet-BP260 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A"""
173+
Ethernet-BP260 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% N/A N/A N/A
174+
175+
Reminder: Please execute 'show interface counters -d all' to include internal links
176+
"""
177+
147178

148179
intf_invalid_asic_error = """ValueError: Unknown Namespace asic99"""
149180

0 commit comments

Comments
 (0)