57
57
Ethernet124 ARISTA04T1 Ethernet1 None 10.250.0.54 LeafRouter
58
58
"""
59
59
60
+ show_interfaces_neighbor_expected_output_t1 = """\
61
+ LocalPort Neighbor NeighborPort NeighborLoopback NeighborMgmt NeighborType
62
+ ----------- ---------- -------------- ------------------ -------------- --------------
63
+ Ethernet0 ARISTA01T2 Ethernet1 None 172.16.137.56 SpineRouter
64
+ Ethernet4 ARISTA01T2 Ethernet2 None 172.16.137.56 SpineRouter
65
+ Ethernet8 ARISTA03T2 Ethernet1 None 172.16.137.57 SpineRouter
66
+ Ethernet12 ARISTA03T2 Ethernet2 None 172.16.137.57 SpineRouter
67
+ Ethernet16 ARISTA05T2 Ethernet1 None 172.16.137.58 SpineRouter
68
+ Ethernet20 ARISTA05T2 Ethernet2 None 172.16.137.58 SpineRouter
69
+ Ethernet24 ARISTA07T2 Ethernet1 None 172.16.137.59 SpineRouter
70
+ Ethernet28 ARISTA07T2 Ethernet2 None 172.16.137.59 SpineRouter
71
+ Ethernet32 ARISTA09T2 Ethernet1 None 172.16.137.60 SpineRouter
72
+ Ethernet36 ARISTA09T2 Ethernet2 None 172.16.137.60 SpineRouter
73
+ Ethernet40 ARISTA11T2 Ethernet1 None 172.16.137.61 SpineRouter
74
+ Ethernet44 ARISTA11T2 Ethernet2 None 172.16.137.61 SpineRouter
75
+ Ethernet48 ARISTA13T2 Ethernet1 None 172.16.137.62 SpineRouter
76
+ Ethernet52 ARISTA13T2 Ethernet2 None 172.16.137.62 SpineRouter
77
+ Ethernet56 ARISTA15T2 Ethernet1 None 172.16.137.63 SpineRouter
78
+ Ethernet60 ARISTA15T2 Ethernet2 None 172.16.137.63 SpineRouter
79
+ Ethernet64 ARISTA01T0 Ethernet1 None 172.16.137.64 ToRRouter
80
+ Ethernet68 ARISTA02T0 Ethernet1 None 172.16.137.65 ToRRouter
81
+ Ethernet72 ARISTA03T0 Ethernet1 None 172.16.137.66 ToRRouter
82
+ Ethernet76 ARISTA04T0 Ethernet1 None 172.16.137.67 ToRRouter
83
+ Ethernet80 ARISTA05T0 Ethernet1 None 172.16.137.68 ToRRouter
84
+ Ethernet84 ARISTA06T0 Ethernet1 None 172.16.137.69 ToRRouter
85
+ Ethernet88 ARISTA07T0 Ethernet1 None 172.16.137.70 ToRRouter
86
+ Ethernet92 ARISTA08T0 Ethernet1 None 172.16.137.71 ToRRouter
87
+ Ethernet96 ARISTA09T0 Ethernet1 None 172.16.137.72 ToRRouter
88
+ Ethernet100 ARISTA10T0 Ethernet1 None 172.16.137.73 ToRRouter
89
+ Ethernet104 ARISTA11T0 Ethernet1 None 172.16.137.74 ToRRouter
90
+ Ethernet108 ARISTA12T0 Ethernet1 None 172.16.137.75 ToRRouter
91
+ Ethernet112 ARISTA13T0 Ethernet1 None 172.16.137.76 ToRRouter
92
+ Ethernet116 ARISTA14T0 Ethernet1 None 172.16.137.77 ToRRouter
93
+ Ethernet120 ARISTA15T0 Ethernet1 None 172.16.137.78 ToRRouter
94
+ Ethernet124 ARISTA16T0 Ethernet1 None 172.16.137.79 ToRRouter
95
+ """
96
+
60
97
show_interfaces_neighbor_expected_output_Ethernet112 = """\
61
98
LocalPort Neighbor NeighborPort NeighborLoopback NeighborMgmt NeighborType
62
99
----------- ---------- -------------- ------------------ -------------- --------------
63
100
Ethernet112 ARISTA01T1 Ethernet1 None 10.250.0.51 LeafRouter
64
101
"""
65
102
103
+ show_interfaces_neighbor_expected_output_t1_Ethernet0 = """\
104
+ LocalPort Neighbor NeighborPort NeighborLoopback NeighborMgmt NeighborType
105
+ ----------- ---------- -------------- ------------------ -------------- --------------
106
+ Ethernet0 ARISTA01T2 Ethernet1 None 172.16.137.56 SpineRouter
107
+ """
108
+
66
109
show_interfaces_neighbor_expected_output_etp29 = """\
67
110
LocalPort Neighbor NeighborPort NeighborLoopback NeighborMgmt NeighborType
68
111
----------- ---------- -------------- ------------------ -------------- --------------
69
112
etp29 ARISTA01T1 Ethernet1 None 10.250.0.51 LeafRouter
70
113
"""
71
114
115
+ show_interfaces_neighbor_expected_output_t1_Ethernet1_1 = """\
116
+ LocalPort Neighbor NeighborPort NeighborLoopback NeighborMgmt NeighborType
117
+ ----------- ---------- -------------- ------------------ -------------- --------------
118
+ Ethernet1/1 ARISTA01T2 Ethernet1 None 172.16.137.56 SpineRouter
119
+ """
120
+
72
121
show_interfaces_portchannel_output = """\
73
122
Flags: A - active, I - inactive, Up - up, Dw - Down, N/A - not available,
74
123
S - selected, D - deselected, * - not synced
@@ -166,6 +215,15 @@ def test_show_interfaces_neighbor_expected(self):
166
215
assert result .exit_code == 0
167
216
assert result .output == show_interfaces_neighbor_expected_output
168
217
218
+ def test_show_interfaces_neighbor_expected_t1 (self , setup_t1_topo ):
219
+ runner = CliRunner ()
220
+ result = runner .invoke (show .cli .commands ["interfaces" ].commands ["neighbor" ].commands ["expected" ], [])
221
+ print (result .exit_code )
222
+ print (result .output )
223
+ # traceback.print_tb(result.exc_info[2])
224
+ assert result .exit_code == 0
225
+ assert result .output == show_interfaces_neighbor_expected_output_t1
226
+
169
227
def test_show_interfaces_neighbor_expected_Ethernet112 (self ):
170
228
runner = CliRunner ()
171
229
result = runner .invoke (show .cli .commands ["interfaces" ].commands ["neighbor" ].commands ["expected" ], ["Ethernet112" ])
@@ -175,6 +233,15 @@ def test_show_interfaces_neighbor_expected_Ethernet112(self):
175
233
assert result .exit_code == 0
176
234
assert result .output == show_interfaces_neighbor_expected_output_Ethernet112
177
235
236
+ def test_show_interfaces_neighbor_expected_t1_Ethernet0 (self , setup_t1_topo ):
237
+ runner = CliRunner ()
238
+ result = runner .invoke (show .cli .commands ["interfaces" ].commands ["neighbor" ].commands ["expected" ], ["Ethernet0" ])
239
+ print (result .exit_code )
240
+ print (result .output )
241
+ # traceback.print_tb(result.exc_info[2])
242
+ assert result .exit_code == 0
243
+ assert result .output == show_interfaces_neighbor_expected_output_t1_Ethernet0
244
+
178
245
def test_show_interfaces_neighbor_expected_etp29 (self ):
179
246
runner = CliRunner ()
180
247
os .environ ['SONIC_CLI_IFACE_MODE' ] = "alias"
@@ -186,6 +253,17 @@ def test_show_interfaces_neighbor_expected_etp29(self):
186
253
assert result .exit_code == 0
187
254
assert result .output == show_interfaces_neighbor_expected_output_etp29
188
255
256
+ def test_show_interfaces_neighbor_expected_t1_Ethernet1_1 (self , setup_t1_topo ):
257
+ runner = CliRunner ()
258
+ os .environ ['SONIC_CLI_IFACE_MODE' ] = "alias"
259
+ result = runner .invoke (show .cli .commands ["interfaces" ].commands ["neighbor" ].commands ["expected" ], ["Ethernet1/1" ])
260
+ os .environ ['SONIC_CLI_IFACE_MODE' ] = "default"
261
+ print (result .exit_code )
262
+ print (result .output )
263
+ # traceback.print_tb(result.exc_info[2])
264
+ assert result .exit_code == 0
265
+ assert result .output == show_interfaces_neighbor_expected_output_t1_Ethernet1_1
266
+
189
267
def test_show_interfaces_neighbor_expected_Ethernet0 (self ):
190
268
runner = CliRunner ()
191
269
result = runner .invoke (show .cli .commands ["interfaces" ].commands ["neighbor" ].commands ["expected" ], ["Ethernet0" ])
0 commit comments