Debian Codegraph @

tests/units/anta_tests/test_interfaces.py

raw symbols SCIP
1 # Copyright (c) 2023-2026 Arista Networks, Inc.
2 # Use of this source code is governed by the Apache License 2.0
3 # that can be found in the LICENSE file.
4 """Test inputs for anta.tests.interfaces."""
5
6 # pylint: disable=C0302
7 from __future__ import annotations
8
9 import sys
10 from datetime import datetime, timedelta, timezone
11 from typing import TYPE_CHECKING, Any
12
13 from anta.models import AntaTest
14 from anta.result_manager.models import AntaTestStatus
15 from anta.tests.interfaces import (
16 VerifyIllegalLACP,
17 VerifyInterfaceDiscards,
18 VerifyInterfaceErrDisabled,
19 VerifyInterfaceErrors,
20 VerifyInterfaceIPv4,
21 VerifyInterfacesBER,
22 VerifyInterfacesCounterDetails,
23 VerifyInterfacesECNCounters,
24 VerifyInterfacesEgressQueueDrops,
25 VerifyInterfacesOpticsReceivePower,
26 VerifyInterfacesOpticsTemperature,
27 VerifyInterfacesPFCCounters,
28 VerifyInterfacesSpeed,
29 VerifyInterfacesStatus,
30 VerifyInterfacesTridentCounters,
31 VerifyInterfacesVoqAndEgressQueueDrops,
32 VerifyInterfaceUtilization,
33 VerifyIPProxyARP,
34 VerifyIpVirtualRouterMac,
35 VerifyL2MTU,
36 VerifyL3MTU,
37 VerifyLACPInterfacesStatus,
38 VerifyLoopbackCount,
39 VerifyPortChannels,
40 VerifyStormControlDrops,
41 VerifySVI,
42 )
43 from tests.units.anta_tests import test
44
45 if TYPE_CHECKING:
46 from tests.units.anta_tests import AntaUnitTestData
47
48
49 # Helper to create minimal rate data in unit tests
50 def create_rate_data(*interfaces_with_rates: tuple[str, float, float]) -> dict[str, Any]:
51 """Create the 'show interfaces counters rates' data.
52
53 Each arg is a tuple: (name, in_bps_rate, out_bps_rate).
54 """
55 data: dict[str, Any] = {"interfaces": {}}
56 for name, in_rate, out_rate in interfaces_with_rates:
57 data["interfaces"][name] = {"inBpsRate": float(in_rate), "outBpsRate": float(out_rate)}
58 return data
59
60
61 # Helper to create minimal status data in unit tests
62 def create_status_data(*interfaces_with_status: tuple[str, str, float]) -> dict[str, Any]:
63 """Create the 'show interfaces status' data.
64
65 Each arg is a tuple: (name, duplex, bandwidth_bps)
66 """
67 data: dict[str, Any] = {"interfaceStatuses": {}}
68 for name, duplex, bw in interfaces_with_status:
69 data["interfaceStatuses"][name] = {"duplex": duplex, "bandwidth": int(bw)}
70 return data
71
72
73 # Mock current time to maintain test VerifyInterfacesCounterDetails stability
74 now = datetime.now(timezone.utc)
75 one_day_ago = now - timedelta(days=1)
76 timestamp_one_day_ago = one_day_ago.timestamp()
77
78
79 DATA: AntaUnitTestData = {
80 (VerifyInterfaceUtilization, "success"): {
81 "eos_data": [
82 create_rate_data(
83 ("Ethernet1", 100e6, 50e6), # 10%, 5% utilization
84 ("Ethernet2/1", 20e6, 10e6), # 2%, 1% utilization
85 ("Ethernet3/1/1", 5e6, 5e6), # 0.5%, 0.5% utilization
86 ("Port-Channel1", 150e6, 150e6), # 7.5%, 7.5% utilization (on 2G BW)
87 ("Management0", 1e6, 1e6), # 0.1%, 0.1% utilization
88 ("Ethernet1.100", 0.5e6, 1e6), # 0.05%, 0.1% utilization (inherits Eth1 BW)
89 ("Port-Channel1.200", 1e6, 2e6), # 0.05%, 0.1% utilization (inherits Po1 BW)
90 ),
91 create_status_data(
92 ("Ethernet1", "duplexFull", 1e9),
93 ("Ethernet2/1", "duplexFull", 1e9),
94 ("Ethernet3/1/1", "duplexFull", 1e9),
95 ("Port-Channel1", "duplexFull", 2e9), # Example 2x1G LACP
96 ("Management0", "duplexFull", 1e9),
97 ("Ethernet1.100", "duplexFull", 1e9), # Sub-interface status
98 ("Port-Channel1.200", "duplexFull", 2e9), # Sub-interface status
99 ),
100 ],
101 "inputs": {"threshold": 15.0}, # All utilizations are <= 15%
102 "expected": {
103 "result": AntaTestStatus.SUCCESS,
104 "atomic_results": [
105 {
106 "description": "Interface: Ethernet1",
107 "result": AntaTestStatus.SUCCESS,
108 },
109 {
110 "description": "Interface: Ethernet2/1",
111 "result": AntaTestStatus.SUCCESS,
112 },
113 {
114 "description": "Interface: Ethernet3/1/1",
115 "result": AntaTestStatus.SUCCESS,
116 },
117 {
118 "description": "Interface: Port-Channel1",
119 "result": AntaTestStatus.SUCCESS,
120 },
121 {
122 "description": "Interface: Management0",
123 "result": AntaTestStatus.SUCCESS,
124 },
125 {
126 "description": "Interface: Ethernet1.100",
127 "result": AntaTestStatus.SUCCESS,
128 },
129 {
130 "description": "Interface: Port-Channel1.200",
131 "result": AntaTestStatus.SUCCESS,
132 },
133 ],
134 },
135 },
136 (VerifyInterfaceUtilization, "success-ignored-interfaces"): {
137 "eos_data": [
138 create_rate_data(
139 ("Ethernet1", 800e6, 10e6), # 80% utilization, but will be ignored
140 ("Port-Channel1", 1800e6, 50e6), # 90% utilization, but will be ignored
141 ("Management0", 50e6, 750e6), # 5%, 75% utilization, Management0 ignored by type
142 ("Ethernet2", 10e6, 20e6), # 1%, 2% utilization (this one is checked)
143 ),
144 create_status_data(
145 ("Ethernet1", "duplexFull", 1e9), ("Port-Channel1", "duplexFull", 2e9), ("Management0", "duplexFull", 1e9), ("Ethernet2", "duplexFull", 1e9)
146 ),
147 ],
148 "inputs": {"threshold": 10.0, "ignored_interfaces": ["Ethernet1", "Port-Channel1", "Management"]},
149 "expected": {
150 "result": AntaTestStatus.SUCCESS,
151 "atomic_results": [
152 {
153 "description": "Interface: Ethernet2",
154 "result": AntaTestStatus.SUCCESS,
155 },
156 ],
157 },
158 },
159 (VerifyInterfaceUtilization, "success-user-provided-interfaces"): {
160 "eos_data": [
161 create_rate_data(
162 ("Ethernet1/1", 800e6, 10e6), # 80% (Not in user list)
163 ("Port-Channel10", 50e6, 70e6), # 2.5%, 3.5%
164 ("Ethernet2.100", 1e6, 0.5e6), # 0.1%, 0.05%
165 ),
166 create_status_data(("Ethernet1/1", "duplexFull", 1e9), ("Port-Channel10", "duplexFull", 2e9), ("Ethernet2.100", "duplexFull", 1e9)),
167 ],
168 "inputs": {"threshold": 5.0, "interfaces": ["Port-Channel10", "Ethernet2.100"]},
169 "expected": {
170 "result": AntaTestStatus.SUCCESS,
171 "atomic_results": [
172 {
173 "description": "Interface: Port-Channel10",
174 "result": AntaTestStatus.SUCCESS,
175 },
176 {
177 "description": "Interface: Ethernet2.100",
178 "result": AntaTestStatus.SUCCESS,
179 },
180 ],
181 },
182 },
183 (VerifyInterfaceUtilization, "success-not-connected-interfaces"): {
184 "eos_data": [
185 create_rate_data(
186 ("Ethernet1/1", 0.0, 0.0), # Not connected
187 ("Port-Channel10", 50e6, 70e6), # 2.5%, 3.5%
188 ("Ethernet2.100", 1e6, 0.5e6), # 0.1%, 0.05%
189 ),
190 create_status_data(("Ethernet1/1", "duplexUnknown", 0.0), ("Port-Channel10", "duplexFull", 2e9), ("Ethernet2.100", "duplexFull", 1e9)),
191 ],
192 "inputs": {"threshold": 5.0},
193 "expected": {
194 "result": AntaTestStatus.SUCCESS,
195 "atomic_results": [
196 {
197 "description": "Interface: Ethernet1/1",
198 "result": AntaTestStatus.SUCCESS,
199 },
200 {
201 "description": "Interface: Port-Channel10",
202 "result": AntaTestStatus.SUCCESS,
203 },
204 {
205 "description": "Interface: Ethernet2.100",
206 "result": AntaTestStatus.SUCCESS,
207 },
208 ],
209 },
210 },
211 (VerifyInterfaceUtilization, "failure-utilization-exceeded"): {
212 "eos_data": [
213 create_rate_data(
214 ("Ethernet1", 100e6, 50e6), # OK
215 ("Port-Channel5", 800e6, 800e6), # Ingress 800Mbps/2Gbps = 40%. Egress 800Mbps/2Gbps = 40%
216 ), # Fails on Ingress and Egress
217 create_status_data(
218 ("Ethernet1", "duplexFull", 1e9),
219 ("Port-Channel5", "duplexFull", 2e9), # Example: 2x1G LACP
220 ),
221 ],
222 "inputs": {"threshold": 30.0},
223 "expected": {
224 "result": AntaTestStatus.FAILURE,
225 "messages": [
226 "Interface: Port-Channel5 - Ingress traffic rate (BPS) exceeds threshold - Expected: <= 30.0% Actual: 40.0%",
227 "Interface: Port-Channel5 - Egress traffic rate (BPS) exceeds threshold - Expected: <= 30.0% Actual: 40.0%",
228 ],
229 "atomic_results": [
230 {
231 "description": "Interface: Ethernet1",
232 "result": AntaTestStatus.SUCCESS,
233 },
234 {
235 "description": "Interface: Port-Channel5",
236 "result": AntaTestStatus.FAILURE,
237 "messages": [
238 "Ingress traffic rate (BPS) exceeds threshold - Expected: <= 30.0% Actual: 40.0%",
239 "Egress traffic rate (BPS) exceeds threshold - Expected: <= 30.0% Actual: 40.0%",
240 ],
241 },
242 ],
243 },
244 },
245 (VerifyInterfaceUtilization, "failure-ethernet-duplex-half"): {
246 "eos_data": [
247 create_rate_data(("Ethernet1/1", 10e6, 10e6)),
248 create_status_data(("Ethernet1/1", "duplexHalf", 1e9)), # Problematic interface
249 ],
250 "inputs": {"threshold": 70.0},
251 "expected": {
252 "result": AntaTestStatus.FAILURE,
253 "messages": ["Interface: Ethernet1/1 - Test not implemented for non-full-duplex interfaces - Expected: duplexFull Actual: duplexHalf"],
254 "atomic_results": [
255 {
256 "description": "Interface: Ethernet1/1",
257 "result": AntaTestStatus.FAILURE,
258 "messages": ["Test not implemented for non-full-duplex interfaces - Expected: duplexFull Actual: duplexHalf"],
259 },
260 ],
261 },
262 },
263 (VerifyInterfaceUtilization, "failure-port-channel-subinterface-duplex-half"): {
264 "eos_data": [
265 create_rate_data(
266 ("Port-Channel10", 10e6, 10e6),
267 ("Port-Channel10.50", 1e6, 1e6), # Rates for sub-interface
268 ),
269 create_status_data(
270 ("Port-Channel10", "duplexFull", 2e9),
271 ("Port-Channel10.50", "duplexHalf", 2e9), # Problematic sub-interface
272 ),
273 ],
274 "inputs": {"threshold": 70.0},
275 "expected": {
276 "result": AntaTestStatus.FAILURE,
277 "messages": ["Interface: Port-Channel10.50 - Test not implemented for non-full-duplex interfaces - Expected: duplexFull Actual: duplexHalf"],
278 "atomic_results": [
279 {
280 "description": "Interface: Port-Channel10",
281 "result": AntaTestStatus.SUCCESS,
282 },
283 {
284 "description": "Interface: Port-Channel10.50",
285 "result": AntaTestStatus.FAILURE,
286 "messages": ["Test not implemented for non-full-duplex interfaces - Expected: duplexFull Actual: duplexHalf"],
287 },
288 ],
289 },
290 },
291 (VerifyInterfaceUtilization, "failure-management0-duplex-half"): {
292 "eos_data": [
293 create_rate_data(("Management0", 10e6, 10e6)),
294 create_status_data(("Management0", "duplexHalf", 1e9)),
295 ],
296 "inputs": {"threshold": 70.0},
297 "expected": {
298 "result": AntaTestStatus.FAILURE,
299 "messages": ["Interface: Management0 - Test not implemented for non-full-duplex interfaces - Expected: duplexFull Actual: duplexHalf"],
300 "atomic_results": [
301 {
302 "description": "Interface: Management0",
303 "result": AntaTestStatus.FAILURE,
304 "messages": ["Test not implemented for non-full-duplex interfaces - Expected: duplexFull Actual: duplexHalf"],
305 },
306 ],
307 },
308 },
309 (VerifyInterfaceUtilization, "failure-specific-interface-not-found"): {
310 "eos_data": [
311 create_rate_data(("Ethernet1", 10e6, 10e6)), # Ethernet99 is missing
312 create_status_data(("Ethernet1", "duplexFull", 1e9)),
313 ],
314 "inputs": {"threshold": 70.0, "interfaces": ["Ethernet1", "Ethernet99"]},
315 "expected": {
316 "result": AntaTestStatus.FAILURE,
317 "messages": ["Interface: Ethernet99 - Not found"],
318 "atomic_results": [
319 {
320 "description": "Interface: Ethernet1",
321 "result": AntaTestStatus.SUCCESS,
322 },
323 {
324 "description": "Interface: Ethernet99",
325 "result": AntaTestStatus.FAILURE,
326 "messages": ["Not found"],
327 },
328 ],
329 },
330 },
331 (VerifyInterfaceUtilization, "failure-specific-interface-null-bandwidth"): {
332 "eos_data": [
333 create_rate_data(("Ethernet1/1/1", 10e6, 10e6), ("Port-Channel1", 1e6, 1e6)),
334 create_status_data(
335 ("Ethernet1/1/1", "duplexFull", 1e9),
336 ("Port-Channel1", "duplexFull", 0), # Explicitly tested, BW is 0
337 ),
338 ],
339 "inputs": {"threshold": 70.0, "interfaces": ["Ethernet1/1/1", "Port-Channel1"]},
340 "expected": {
341 "result": AntaTestStatus.FAILURE,
342 "messages": ["Interface: Port-Channel1 - Cannot get interface utilization due to null bandwidth value"],
343 "atomic_results": [
344 {
345 "description": "Interface: Ethernet1/1/1",
346 "result": AntaTestStatus.SUCCESS,
347 },
348 {
349 "description": "Interface: Port-Channel1",
350 "result": AntaTestStatus.FAILURE,
351 "messages": ["Cannot get interface utilization due to null bandwidth value"],
352 },
353 ],
354 },
355 },
356 (VerifyInterfaceUtilization, "success-null-bandwidth-general-scan-skipped"): {
357 # This test ensures that when scanning ALL interfaces, a null bandwidth is skipped, not failed.
358 # And other interfaces are still checked.
359 "eos_data": [
360 create_rate_data(
361 ("Ethernet1", 10e6, 10e6), # OK
362 ("Ethernet2/1", 1e6, 1e6), # Null BW, will be skipped
363 ("Port-Channel1", 800e6, 10e6), # High util, should fail the test
364 ),
365 create_status_data(
366 ("Ethernet1", "duplexFull", 1e9),
367 ("Ethernet2/1", "duplexFull", 0), # Null bandwidth
368 ("Port-Channel1", "duplexFull", 1e9),
369 ),
370 ],
371 "inputs": {"threshold": 70.0}, # Po1 inBpsRate (800Mbps/1Gbps = 80%) will cause failure
372 "expected": {
373 "result": AntaTestStatus.FAILURE, # Failure due to Port-Channel1, not Ethernet2/1
374 "messages": ["Interface: Port-Channel1 - Ingress traffic rate (BPS) exceeds threshold - Expected: <= 70.0% Actual: 80.0%"],
375 "atomic_results": [
376 {
377 "description": "Interface: Ethernet1",
378 "result": AntaTestStatus.SUCCESS,
379 },
380 {
381 "description": "Interface: Ethernet2/1",
382 "result": AntaTestStatus.SUCCESS,
383 },
384 {
385 "description": "Interface: Port-Channel1",
386 "result": AntaTestStatus.FAILURE,
387 "messages": ["Ingress traffic rate (BPS) exceeds threshold - Expected: <= 70.0% Actual: 80.0%"],
388 },
389 ],
390 },
391 },
392 (VerifyInterfaceUtilization, "success-all-interfaces-one-null-bw-others-ok"): {
393 # Similar to above, but this time the other interfaces are OK, so the overall result is success
394 "eos_data": [
395 create_rate_data(
396 ("Ethernet1", 10e6, 10e6), # OK
397 ("Ethernet2/1", 1e6, 1e6), # Null BW, will be skipped
398 ("Port-Channel1", 50e6, 10e6), # OK (5%)
399 ),
400 create_status_data(
401 ("Ethernet1", "duplexFull", 1e9),
402 ("Ethernet2/1", "duplexFull", 0), # Null bandwidth
403 ("Port-Channel1", "duplexFull", 1e9),
404 ),
405 ],
406 "inputs": {"threshold": 70.0},
407 "expected": {
408 "result": AntaTestStatus.SUCCESS,
409 "atomic_results": [
410 {
411 "description": "Interface: Ethernet1",
412 "result": AntaTestStatus.SUCCESS,
413 },
414 {
415 "description": "Interface: Ethernet2/1",
416 "result": AntaTestStatus.SUCCESS,
417 },
418 {
419 "description": "Interface: Port-Channel1",
420 "result": AntaTestStatus.SUCCESS,
421 },
422 ],
423 },
424 },
425 (VerifyInterfaceErrors, "success"): {
426 "eos_data": [
427 {
428 "interfaceErrorCounters": {
429 "Ethernet1": {"inErrors": 0, "frameTooLongs": 0, "outErrors": 0, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0},
430 "Ethernet6": {"inErrors": 0, "frameTooLongs": 0, "outErrors": 0, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0},
431 }
432 }
433 ],
434 "expected": {
435 "result": AntaTestStatus.SUCCESS,
436 "atomic_results": [
437 {
438 "description": "Interface: Ethernet1",
439 "result": AntaTestStatus.SUCCESS,
440 },
441 {
442 "description": "Interface: Ethernet6",
443 "result": AntaTestStatus.SUCCESS,
444 },
445 ],
446 },
447 },
448 (VerifyInterfaceErrors, "success-ignore-interface"): {
449 "eos_data": [
450 {
451 "interfaceErrorCounters": {
452 "Ethernet1": {"inErrors": 42, "frameTooLongs": 0, "outErrors": 0, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0},
453 "Management0": {
454 "inErrors": 0,
455 "frameTooLongs": 0,
456 "outErrors": 0,
457 "frameTooShorts": 0,
458 "fcsErrors": 0,
459 "alignmentErrors": 0,
460 "symbolErrors": 0,
461 },
462 }
463 }
464 ],
465 "inputs": {"ignored_interfaces": ["Ethernet"]},
466 "expected": {
467 "result": AntaTestStatus.SUCCESS,
468 "atomic_results": [
469 {
470 "description": "Interface: Management0",
471 "result": AntaTestStatus.SUCCESS,
472 },
473 ],
474 },
475 },
476 (VerifyInterfaceErrors, "failure-ignore-interface"): {
477 "eos_data": [
478 {
479 "interfaceErrorCounters": {
480 "Ethernet1": {"inErrors": 42, "frameTooLongs": 0, "outErrors": 0, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0},
481 "Management0": {
482 "inErrors": 0,
483 "frameTooLongs": 0,
484 "outErrors": 0,
485 "frameTooShorts": 0,
486 "fcsErrors": 0,
487 "alignmentErrors": 666,
488 "symbolErrors": 0,
489 },
490 "Ethernet10": {"inErrors": 42, "frameTooLongs": 0, "outErrors": 0, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0},
491 }
492 }
493 ],
494 "inputs": {"ignored_interfaces": ["Ethernet1", "Management0"]},
495 "expected": {
496 "result": AntaTestStatus.FAILURE,
497 "messages": ["Interface: Ethernet10 - Non-zero error counter(s) - inErrors: 42"],
498 "atomic_results": [
499 {
500 "description": "Interface: Ethernet10",
501 "result": AntaTestStatus.FAILURE,
502 "messages": ["Non-zero error counter(s) - inErrors: 42"],
503 }
504 ],
505 },
506 },
507 (VerifyInterfaceErrors, "failure-multiple-intfs"): {
508 "eos_data": [
509 {
510 "interfaceErrorCounters": {
511 "Ethernet1": {"inErrors": 42, "frameTooLongs": 0, "outErrors": 0, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0},
512 "Ethernet6": {"inErrors": 0, "frameTooLongs": 0, "outErrors": 0, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 666, "symbolErrors": 0},
513 }
514 }
515 ],
516 "expected": {
517 "result": AntaTestStatus.FAILURE,
518 "messages": [
519 "Interface: Ethernet1 - Non-zero error counter(s) - inErrors: 42",
520 "Interface: Ethernet6 - Non-zero error counter(s) - alignmentErrors: 666",
521 ],
522 "atomic_results": [
523 {
524 "description": "Interface: Ethernet1",
525 "result": AntaTestStatus.FAILURE,
526 "messages": ["Non-zero error counter(s) - inErrors: 42"],
527 },
528 {
529 "description": "Interface: Ethernet6",
530 "result": AntaTestStatus.FAILURE,
531 "messages": ["Non-zero error counter(s) - alignmentErrors: 666"],
532 },
533 ],
534 },
535 },
536 (VerifyInterfaceErrors, "failure-multiple-intfs-multiple-errors"): {
537 "eos_data": [
538 {
539 "interfaceErrorCounters": {
540 "Ethernet1": {"inErrors": 42, "frameTooLongs": 0, "outErrors": 10, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0},
541 "Ethernet6": {"inErrors": 0, "frameTooLongs": 0, "outErrors": 0, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 6, "symbolErrors": 10},
542 }
543 }
544 ],
545 "expected": {
546 "result": AntaTestStatus.FAILURE,
547 "messages": [
548 "Interface: Ethernet1 - Non-zero error counter(s) - inErrors: 42, outErrors: 10",
549 "Interface: Ethernet6 - Non-zero error counter(s) - alignmentErrors: 6, symbolErrors: 10",
550 ],
551 "atomic_results": [
552 {
553 "description": "Interface: Ethernet1",
554 "result": AntaTestStatus.FAILURE,
555 "messages": ["Non-zero error counter(s) - inErrors: 42, outErrors: 10"],
556 },
557 {
558 "description": "Interface: Ethernet6",
559 "result": AntaTestStatus.FAILURE,
560 "messages": ["Non-zero error counter(s) - alignmentErrors: 6, symbolErrors: 10"],
561 },
562 ],
563 },
564 },
565 (VerifyInterfaceErrors, "failure-single-intf-multiple-errors"): {
566 "eos_data": [
567 {
568 "interfaceErrorCounters": {
569 "Ethernet1": {"inErrors": 42, "frameTooLongs": 0, "outErrors": 2, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0}
570 }
571 }
572 ],
573 "expected": {
574 "result": AntaTestStatus.FAILURE,
575 "messages": ["Interface: Ethernet1 - Non-zero error counter(s) - inErrors: 42, outErrors: 2"],
576 "atomic_results": [
577 {
578 "description": "Interface: Ethernet1",
579 "result": AntaTestStatus.FAILURE,
580 "messages": ["Non-zero error counter(s) - inErrors: 42, outErrors: 2"],
581 },
582 ],
583 },
584 },
585 (VerifyInterfaceErrors, "success-specific-interface"): {
586 "eos_data": [
587 {
588 "interfaceErrorCounters": {
589 "Ethernet1": {"inErrors": 0, "frameTooLongs": 0, "outErrors": 0, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0},
590 "Management0": {
591 "inErrors": 0,
592 "frameTooLongs": 0,
593 "outErrors": 0,
594 "frameTooShorts": 0,
595 "fcsErrors": 0,
596 "alignmentErrors": 666,
597 "symbolErrors": 0,
598 },
599 }
600 }
601 ],
602 "inputs": {"interfaces": ["Etherne1"]},
603 "expected": {
604 "result": AntaTestStatus.SUCCESS,
605 "atomic_results": [
606 {
607 "description": "Interface: Ethernet1",
608 "result": AntaTestStatus.SUCCESS,
609 },
610 ],
611 },
612 },
613 (VerifyInterfaceErrors, "failure-specific-interface-not-found"): {
614 "eos_data": [
615 {
616 "interfaceErrorCounters": {
617 "Ethernet1": {"inErrors": 0, "frameTooLongs": 0, "outErrors": 0, "frameTooShorts": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0},
618 "Management0": {
619 "inErrors": 0,
620 "frameTooLongs": 0,
621 "outErrors": 0,
622 "frameTooShorts": 0,
623 "fcsErrors": 0,
624 "alignmentErrors": 666,
625 "symbolErrors": 0,
626 },
627 }
628 }
629 ],
630 "inputs": {"interfaces": ["Etherne10"]},
631 "expected": {
632 "result": AntaTestStatus.FAILURE,
633 "messages": ["Interface: Ethernet10 - Not found"],
634 "atomic_results": [
635 {
636 "description": "Interface: Ethernet10",
637 "result": AntaTestStatus.FAILURE,
638 "messages": ["Not found"],
639 },
640 ],
641 },
642 },
643 (VerifyInterfaceDiscards, "success"): {
644 "eos_data": [
645 {
646 "inDiscardsTotal": 0,
647 "interfaces": {"Ethernet2": {"outDiscards": 0, "inDiscards": 0}, "Ethernet1": {"outDiscards": 0, "inDiscards": 0}},
648 "outDiscardsTotal": 0,
649 }
650 ],
651 "expected": {
652 "result": AntaTestStatus.SUCCESS,
653 "atomic_results": [
654 {
655 "description": "Interface: Ethernet2",
656 "result": AntaTestStatus.SUCCESS,
657 },
658 {
659 "description": "Interface: Ethernet1",
660 "result": AntaTestStatus.SUCCESS,
661 },
662 ],
663 },
664 },
665 (VerifyInterfaceDiscards, "success-ignored-interface"): {
666 "eos_data": [
667 {
668 "inDiscardsTotal": 0,
669 "interfaces": {
670 "Ethernet2": {"outDiscards": 42, "inDiscards": 0},
671 "Ethernet1": {"outDiscards": 0, "inDiscards": 42},
672 "Ethernet3": {"outDiscards": 0, "inDiscards": 42},
673 "Port-Channel1": {"outDiscards": 0, "inDiscards": 42},
674 "Port-Channel2": {"outDiscards": 0, "inDiscards": 0},
675 },
676 "outDiscardsTotal": 0,
677 }
678 ],
679 "inputs": {"ignored_interfaces": ["Port-Channel1", "Ethernet"]},
680 "expected": {
681 "result": AntaTestStatus.SUCCESS,
682 "atomic_results": [
683 {
684 "description": "Interface: Port-Channel2",
685 "result": AntaTestStatus.SUCCESS,
686 },
687 ],
688 },
689 },
690 (VerifyInterfaceDiscards, "failure"): {
691 "eos_data": [
692 {
693 "inDiscardsTotal": 0,
694 "interfaces": {"Ethernet2": {"outDiscards": 42, "inDiscards": 0}, "Ethernet1": {"outDiscards": 0, "inDiscards": 42}},
695 "outDiscardsTotal": 0,
696 }
697 ],
698 "expected": {
699 "result": AntaTestStatus.FAILURE,
700 "messages": [
701 "Interface: Ethernet2 - Non-zero discard counter(s): outDiscards: 42",
702 "Interface: Ethernet1 - Non-zero discard counter(s): inDiscards: 42",
703 ],
704 "atomic_results": [
705 {"description": "Interface: Ethernet2", "result": AntaTestStatus.FAILURE, "messages": ["Non-zero discard counter(s): outDiscards: 42"]},
706 {"description": "Interface: Ethernet1", "result": AntaTestStatus.FAILURE, "messages": ["Non-zero discard counter(s): inDiscards: 42"]},
707 ],
708 },
709 },
710 (VerifyInterfaceDiscards, "success-specific-interface"): {
711 "eos_data": [
712 {
713 "inDiscardsTotal": 0,
714 "interfaces": {
715 "Ethernet2": {"outDiscards": 0, "inDiscards": 0},
716 "Ethernet1": {"outDiscards": 0, "inDiscards": 42},
717 "Ethernet3": {"outDiscards": 0, "inDiscards": 0},
718 "Port-Channel1": {"outDiscards": 0, "inDiscards": 0},
719 "Port-Channel2": {"outDiscards": 30, "inDiscards": 0},
720 },
721 "outDiscardsTotal": 0,
722 }
723 ],
724 "inputs": {"interfaces": ["Port-Channel1", "Ethernet3", "Ethernet2"]},
725 "expected": {
726 "result": AntaTestStatus.SUCCESS,
727 "atomic_results": [
728 {
729 "description": "Interface: Port-Channel1",
730 "result": AntaTestStatus.SUCCESS,
731 },
732 {
733 "description": "Interface: Ethernet3",
734 "result": AntaTestStatus.SUCCESS,
735 },
736 {
737 "description": "Interface: Ethernet2",
738 "result": AntaTestStatus.SUCCESS,
739 },
740 ],
741 },
742 },
743 (VerifyInterfaceDiscards, "failure-specific-interface-not-found"): {
744 "eos_data": [
745 {
746 "inDiscardsTotal": 0,
747 "interfaces": {
748 "Ethernet2": {"outDiscards": 0, "inDiscards": 0},
749 "Ethernet1": {"outDiscards": 0, "inDiscards": 42},
750 "Ethernet3": {"outDiscards": 40, "inDiscards": 0},
751 "Port-Channel1": {"outDiscards": 30, "inDiscards": 0},
752 "Port-Channel2": {"outDiscards": 30, "inDiscards": 0},
753 },
754 "outDiscardsTotal": 0,
755 }
756 ],
757 "inputs": {"interfaces": ["Port-Channel10", "Ethernet3", "Ethernet2"]},
758 "expected": {
759 "result": AntaTestStatus.FAILURE,
760 "messages": ["Interface: Port-Channel10 - Not found", "Interface: Ethernet3 - Non-zero discard counter(s): outDiscards: 40"],
761 "atomic_results": [
762 {"description": "Interface: Port-Channel10", "result": AntaTestStatus.FAILURE, "messages": ["Not found"]},
763 {"description": "Interface: Ethernet3", "result": AntaTestStatus.FAILURE, "messages": ["Non-zero discard counter(s): outDiscards: 40"]},
764 {
765 "description": "Interface: Ethernet2",
766 "result": AntaTestStatus.SUCCESS,
767 },
768 ],
769 },
770 },
771 (VerifyInterfaceErrDisabled, "success"): {
772 "eos_data": [{"interfaceStatuses": {}}],
773 "expected": {
774 "result": AntaTestStatus.SUCCESS,
775 "atomic_results": [],
776 },
777 },
778 (VerifyInterfaceErrDisabled, "success-ignored-interfaces"): {
779 "eos_data": [
780 {
781 "interfaceStatuses": {
782 "Ethernet1/2": {"description": "", "status": "errdisabled", "causes": ["speed-misconfigured"]},
783 "Ethernet1/3": {"description": "", "status": "errdisabled", "causes": ["speed-misconfigured"]},
784 }
785 }
786 ],
787 "inputs": {"interfaces": ["Ethernet1/1"], "ignored_interfaces": ["Ethernet1/2", "Ethernet1/3"]},
788 "expected": {
789 "result": AntaTestStatus.SUCCESS,
790 "atomic_results": [
791 {
792 "result": AntaTestStatus.SUCCESS,
793 "description": "Interface: Ethernet1/1",
794 }
795 ],
796 },
797 },
798 (VerifyInterfaceErrDisabled, "success-only-ignored-interfaces"): {
799 "eos_data": [
800 {
801 "interfaceStatuses": {
802 "Ethernet1/2": {"description": "", "status": "errdisabled", "causes": ["speed-misconfigured"]},
803 "Ethernet1/3": {"description": "", "status": "errdisabled", "causes": ["speed-misconfigured"]},
804 }
805 }
806 ],
807 "inputs": {"ignored_interfaces": ["Ethernet1/2", "Ethernet1/3"]},
808 "expected": {
809 "result": AntaTestStatus.SUCCESS,
810 "atomic_results": [],
811 },
812 },
813 (VerifyInterfaceErrDisabled, "failure"): {
814 "eos_data": [{"interfaceStatuses": {"Ethernet2": {"description": "", "status": "errdisabled", "causes": ["bpduguard"]}}}],
815 "expected": {
816 "result": AntaTestStatus.FAILURE,
817 "messages": ["Interface: Ethernet2 - Error disabled - Causes: bpduguard"],
818 "atomic_results": [{"result": AntaTestStatus.FAILURE, "description": "Interface: Ethernet2", "messages": ["Error disabled - Causes: bpduguard"]}],
819 },
820 },
821 (VerifyInterfaceErrDisabled, "failure-no-cause"): {
822 "eos_data": [{"interfaceStatuses": {"Ethernet2": {"description": "", "status": "errdisabled"}}}],
823 "expected": {
824 "result": AntaTestStatus.FAILURE,
825 "messages": ["Interface: Ethernet2 - Error disabled"],
826 "atomic_results": [{"result": AntaTestStatus.FAILURE, "description": "Interface: Ethernet2", "messages": ["Error disabled"]}],
827 },
828 },
829 (VerifyInterfacesStatus, "success"): {
830 "eos_data": [
831 {
832 "interfaceDescriptions": {
833 "Ethernet8": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
834 "Ethernet2": {"interfaceStatus": "adminDown", "description": "", "lineProtocolStatus": "down"},
835 "Ethernet3": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
836 }
837 }
838 ],
839 "inputs": {"interfaces": [{"name": "Ethernet2", "status": "adminDown"}, {"name": "Ethernet8", "status": "up"}, {"name": "Ethernet3", "status": "up"}]},
840 "expected": {
841 "result": AntaTestStatus.SUCCESS,
842 "atomic_results": [
843 {
844 "result": AntaTestStatus.SUCCESS,
845 "description": "Interface: Ethernet2",
846 },
847 {
848 "result": AntaTestStatus.SUCCESS,
849 "description": "Interface: Ethernet8",
850 },
851 {
852 "result": AntaTestStatus.SUCCESS,
853 "description": "Interface: Ethernet3",
854 },
855 ],
856 },
857 },
858 (VerifyInterfacesStatus, "success-up-with-line-protocol-status"): {
859 "eos_data": [{"interfaceDescriptions": {"Ethernet8": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "down"}}}],
860 "inputs": {"interfaces": [{"name": "Ethernet8", "status": "up", "line_protocol_status": "down"}]},
861 "expected": {
862 "result": AntaTestStatus.SUCCESS,
863 "atomic_results": [
864 {
865 "result": AntaTestStatus.SUCCESS,
866 "description": "Interface: Ethernet8",
867 },
868 ],
869 },
870 },
871 (VerifyInterfacesStatus, "success-with-line-protocol-status"): {
872 "eos_data": [
873 {
874 "interfaceDescriptions": {
875 "Ethernet8": {"interfaceStatus": "adminDown", "description": "", "lineProtocolStatus": "testing"},
876 "Ethernet2": {"interfaceStatus": "adminDown", "description": "", "lineProtocolStatus": "down"},
877 "Ethernet3.10": {"interfaceStatus": "down", "description": "", "lineProtocolStatus": "dormant"},
878 }
879 }
880 ],
881 "inputs": {
882 "interfaces": [
883 {"name": "Ethernet2", "status": "adminDown", "line_protocol_status": "down"},
884 {"name": "Ethernet8", "status": "adminDown", "line_protocol_status": "testing"},
885 {"name": "Ethernet3.10", "status": "down", "line_protocol_status": "dormant"},
886 ]
887 },
888 "expected": {
889 "result": AntaTestStatus.SUCCESS,
890 "atomic_results": [
891 {
892 "result": AntaTestStatus.SUCCESS,
893 "description": "Interface: Ethernet2",
894 },
895 {
896 "result": AntaTestStatus.SUCCESS,
897 "description": "Interface: Ethernet8",
898 },
899 {
900 "result": AntaTestStatus.SUCCESS,
901 "description": "Interface: Ethernet3.10",
902 },
903 ],
904 },
905 },
906 (VerifyInterfacesStatus, "success-lower"): {
907 "eos_data": [
908 {
909 "interfaceDescriptions": {
910 "Ethernet8": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
911 "Ethernet2": {"interfaceStatus": "adminDown", "description": "", "lineProtocolStatus": "down"},
912 "Ethernet3": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
913 }
914 }
915 ],
916 "inputs": {"interfaces": [{"name": "ethernet2", "status": "adminDown"}, {"name": "ethernet8", "status": "up"}, {"name": "ethernet3", "status": "up"}]},
917 "expected": {
918 "result": AntaTestStatus.SUCCESS,
919 "atomic_results": [
920 {
921 "result": AntaTestStatus.SUCCESS,
922 "description": "Interface: Ethernet2",
923 },
924 {
925 "result": AntaTestStatus.SUCCESS,
926 "description": "Interface: Ethernet8",
927 },
928 {
929 "result": AntaTestStatus.SUCCESS,
930 "description": "Interface: Ethernet3",
931 },
932 ],
933 },
934 },
935 (VerifyInterfacesStatus, "success-eth-name"): {
936 "eos_data": [
937 {
938 "interfaceDescriptions": {
939 "Ethernet8": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
940 "Ethernet2": {"interfaceStatus": "adminDown", "description": "", "lineProtocolStatus": "down"},
941 "Ethernet3": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
942 }
943 }
944 ],
945 "inputs": {"interfaces": [{"name": "eth2", "status": "adminDown"}, {"name": "et8", "status": "up"}, {"name": "et3", "status": "up"}]},
946 "expected": {
947 "result": AntaTestStatus.SUCCESS,
948 "atomic_results": [
949 {
950 "result": AntaTestStatus.SUCCESS,
951 "description": "Interface: Ethernet2",
952 },
953 {
954 "result": AntaTestStatus.SUCCESS,
955 "description": "Interface: Ethernet8",
956 },
957 {
958 "result": AntaTestStatus.SUCCESS,
959 "description": "Interface: Ethernet3",
960 },
961 ],
962 },
963 },
964 (VerifyInterfacesStatus, "success-po-name"): {
965 "eos_data": [{"interfaceDescriptions": {"Port-Channel100": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"}}}],
966 "inputs": {"interfaces": [{"name": "po100", "status": "up"}]},
967 "expected": {
968 "result": AntaTestStatus.SUCCESS,
969 "atomic_results": [
970 {
971 "result": AntaTestStatus.SUCCESS,
972 "description": "Interface: Port-Channel100",
973 },
974 ],
975 },
976 },
977 (VerifyInterfacesStatus, "success-sub-interfaces"): {
978 "eos_data": [{"interfaceDescriptions": {"Ethernet52/1.1963": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"}}}],
979 "inputs": {"interfaces": [{"name": "Ethernet52/1.1963", "status": "up"}]},
980 "expected": {
981 "result": AntaTestStatus.SUCCESS,
982 "atomic_results": [
983 {
984 "result": AntaTestStatus.SUCCESS,
985 "description": "Interface: Ethernet52/1.1963",
986 },
987 ],
988 },
989 },
990 (VerifyInterfacesStatus, "success-transceiver-down"): {
991 "eos_data": [{"interfaceDescriptions": {"Ethernet49/1": {"interfaceStatus": "adminDown", "description": "", "lineProtocolStatus": "notPresent"}}}],
992 "inputs": {"interfaces": [{"name": "Ethernet49/1", "status": "adminDown"}]},
993 "expected": {
994 "result": AntaTestStatus.SUCCESS,
995 "atomic_results": [
996 {
997 "result": AntaTestStatus.SUCCESS,
998 "description": "Interface: Ethernet49/1",
999 },
1000 ],
1001 },
1002 },
1003 (VerifyInterfacesStatus, "success-po-down"): {
1004 "eos_data": [{"interfaceDescriptions": {"Port-Channel100": {"interfaceStatus": "adminDown", "description": "", "lineProtocolStatus": "lowerLayerDown"}}}],
1005 "inputs": {"interfaces": [{"name": "PortChannel100", "status": "adminDown"}]},
1006 "expected": {
1007 "result": AntaTestStatus.SUCCESS,
1008 "atomic_results": [
1009 {
1010 "result": AntaTestStatus.SUCCESS,
1011 "description": "Interface: Port-Channel100",
1012 },
1013 ],
1014 },
1015 },
1016 (VerifyInterfacesStatus, "success-po-lowerlayerdown"): {
1017 "eos_data": [{"interfaceDescriptions": {"Port-Channel100": {"interfaceStatus": "adminDown", "description": "", "lineProtocolStatus": "lowerLayerDown"}}}],
1018 "inputs": {"interfaces": [{"name": "Port-Channel100", "status": "adminDown", "line_protocol_status": "lowerLayerDown"}]},
1019 "expected": {
1020 "result": AntaTestStatus.SUCCESS,
1021 "atomic_results": [
1022 {
1023 "result": AntaTestStatus.SUCCESS,
1024 "description": "Interface: Port-Channel100",
1025 },
1026 ],
1027 },
1028 },
1029 (VerifyInterfacesStatus, "failure-not-configured"): {
1030 "eos_data": [
1031 {
1032 "interfaceDescriptions": {
1033 "Ethernet2": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
1034 "Ethernet3": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
1035 }
1036 }
1037 ],
1038 "inputs": {"interfaces": [{"name": "Ethernet2", "status": "up"}, {"name": "Ethernet8", "status": "up"}, {"name": "Ethernet3", "status": "up"}]},
1039 "expected": {
1040 "result": AntaTestStatus.FAILURE,
1041 "messages": ["Interface: Ethernet8 - Not configured"],
1042 "atomic_results": [
1043 {
1044 "result": AntaTestStatus.SUCCESS,
1045 "description": "Interface: Ethernet2",
1046 },
1047 {
1048 "result": AntaTestStatus.FAILURE,
1049 "description": "Interface: Ethernet8",
1050 "messages": ["Not configured"],
1051 },
1052 {
1053 "result": AntaTestStatus.SUCCESS,
1054 "description": "Interface: Ethernet3",
1055 },
1056 ],
1057 },
1058 },
1059 (VerifyInterfacesStatus, "failure-status-down"): {
1060 "eos_data": [
1061 {
1062 "interfaceDescriptions": {
1063 "Ethernet8": {"interfaceStatus": "down", "description": "", "lineProtocolStatus": "down"},
1064 "Ethernet2": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
1065 "Ethernet3": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
1066 }
1067 }
1068 ],
1069 "inputs": {"interfaces": [{"name": "Ethernet2", "status": "up"}, {"name": "Ethernet8", "status": "up"}, {"name": "Ethernet3", "status": "up"}]},
1070 "expected": {
1071 "result": AntaTestStatus.FAILURE,
1072 "messages": ["Interface: Ethernet8 - Status mismatch - Expected: up/up, Actual: down/down"],
1073 "atomic_results": [
1074 {
1075 "result": AntaTestStatus.SUCCESS,
1076 "description": "Interface: Ethernet2",
1077 },
1078 {
1079 "result": AntaTestStatus.FAILURE,
1080 "description": "Interface: Ethernet8",
1081 "messages": ["Status mismatch - Expected: up/up, Actual: down/down"],
1082 },
1083 {
1084 "result": AntaTestStatus.SUCCESS,
1085 "description": "Interface: Ethernet3",
1086 },
1087 ],
1088 },
1089 },
1090 (VerifyInterfacesStatus, "failure-with-description"): {
1091 "eos_data": [
1092 {
1093 "interfaceDescriptions": {
1094 "Ethernet8": {"interfaceStatus": "down", "description": "", "lineProtocolStatus": "down"},
1095 "Ethernet2": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
1096 "Ethernet3": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
1097 }
1098 }
1099 ],
1100 "inputs": {"interfaces": [{"name": "Ethernet2", "status": "up"}, {"name": "Ethernet8", "status": "up", "description": "P2P_LINK_TO_DC1-SPINE4_Ethernet22"}]},
1101 "expected": {
1102 "result": AntaTestStatus.FAILURE,
1103 "messages": ["Interface: Ethernet8 (P2P_LINK_TO_DC1-SPINE4_Ethernet22) - Status mismatch - Expected: up/up, Actual: down/down"],
1104 "atomic_results": [
1105 {
1106 "result": AntaTestStatus.SUCCESS,
1107 "description": "Interface: Ethernet2",
1108 },
1109 {
1110 "result": AntaTestStatus.FAILURE,
1111 "description": "Interface: Ethernet8 (P2P_LINK_TO_DC1-SPINE4_Ethernet22)",
1112 "messages": ["Status mismatch - Expected: up/up, Actual: down/down"],
1113 },
1114 ],
1115 },
1116 },
1117 (VerifyInterfacesStatus, "failure-proto-down"): {
1118 "eos_data": [
1119 {
1120 "interfaceDescriptions": {
1121 "Ethernet8": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "down"},
1122 "Ethernet2": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
1123 "Ethernet3": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
1124 }
1125 }
1126 ],
1127 "inputs": {"interfaces": [{"name": "Ethernet2", "status": "up"}, {"name": "Ethernet8", "status": "up"}, {"name": "Ethernet3", "status": "up"}]},
1128 "expected": {
1129 "result": AntaTestStatus.FAILURE,
1130 "messages": ["Interface: Ethernet8 - Status mismatch - Expected: up/up, Actual: up/down"],
1131 "atomic_results": [
1132 {
1133 "result": AntaTestStatus.SUCCESS,
1134 "description": "Interface: Ethernet2",
1135 },
1136 {
1137 "result": AntaTestStatus.FAILURE,
1138 "description": "Interface: Ethernet8",
1139 "messages": ["Status mismatch - Expected: up/up, Actual: up/down"],
1140 },
1141 {
1142 "result": AntaTestStatus.SUCCESS,
1143 "description": "Interface: Ethernet3",
1144 },
1145 ],
1146 },
1147 },
1148 (VerifyInterfacesStatus, "failure-po-status-down"): {
1149 "eos_data": [{"interfaceDescriptions": {"Port-Channel100": {"interfaceStatus": "down", "description": "", "lineProtocolStatus": "lowerLayerDown"}}}],
1150 "inputs": {"interfaces": [{"name": "PortChannel100", "status": "up"}]},
1151 "expected": {
1152 "result": AntaTestStatus.FAILURE,
1153 "messages": ["Interface: Port-Channel100 - Status mismatch - Expected: up/up, Actual: down/lowerLayerDown"],
1154 "atomic_results": [
1155 {
1156 "result": AntaTestStatus.FAILURE,
1157 "description": "Interface: Port-Channel100",
1158 "messages": ["Status mismatch - Expected: up/up, Actual: down/lowerLayerDown"],
1159 },
1160 ],
1161 },
1162 },
1163 (VerifyInterfacesStatus, "failure-proto-unknown"): {
1164 "eos_data": [
1165 {
1166 "interfaceDescriptions": {
1167 "Ethernet8": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "down"},
1168 "Ethernet2": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "unknown"},
1169 "Ethernet3": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
1170 }
1171 }
1172 ],
1173 "inputs": {
1174 "interfaces": [
1175 {"name": "Ethernet2", "status": "up", "line_protocol_status": "down"},
1176 {"name": "Ethernet8", "status": "up"},
1177 {"name": "Ethernet3", "status": "up"},
1178 ]
1179 },
1180 "expected": {
1181 "result": AntaTestStatus.FAILURE,
1182 "messages": [
1183 "Interface: Ethernet2 - Status mismatch - Expected: up/down, Actual: up/unknown",
1184 "Interface: Ethernet8 - Status mismatch - Expected: up/up, Actual: up/down",
1185 ],
1186 "atomic_results": [
1187 {
1188 "result": AntaTestStatus.FAILURE,
1189 "description": "Interface: Ethernet2",
1190 "messages": ["Status mismatch - Expected: up/down, Actual: up/unknown"],
1191 },
1192 {
1193 "result": AntaTestStatus.FAILURE,
1194 "description": "Interface: Ethernet8",
1195 "messages": ["Status mismatch - Expected: up/up, Actual: up/down"],
1196 },
1197 {
1198 "result": AntaTestStatus.SUCCESS,
1199 "description": "Interface: Ethernet3",
1200 },
1201 ],
1202 },
1203 },
1204 (VerifyInterfacesStatus, "failure-interface-status-down"): {
1205 "eos_data": [
1206 {
1207 "interfaceDescriptions": {
1208 "Ethernet8": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "down"},
1209 "Ethernet2": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "unknown"},
1210 "Ethernet3": {"interfaceStatus": "up", "description": "", "lineProtocolStatus": "up"},
1211 }
1212 }
1213 ],
1214 "inputs": {"interfaces": [{"name": "Ethernet2", "status": "down"}, {"name": "Ethernet8", "status": "down"}, {"name": "Ethernet3", "status": "down"}]},
1215 "expected": {
1216 "result": AntaTestStatus.FAILURE,
1217 "messages": [
1218 "Interface: Ethernet2 - Status mismatch - Expected: down, Actual: up",
1219 "Interface: Ethernet8 - Status mismatch - Expected: down, Actual: up",
1220 "Interface: Ethernet3 - Status mismatch - Expected: down, Actual: up",
1221 ],
1222 "atomic_results": [
1223 {
1224 "result": AntaTestStatus.FAILURE,
1225 "description": "Interface: Ethernet2",
1226 "messages": ["Status mismatch - Expected: down, Actual: up"],
1227 },
1228 {
1229 "result": AntaTestStatus.FAILURE,
1230 "description": "Interface: Ethernet8",
1231 "messages": ["Status mismatch - Expected: down, Actual: up"],
1232 },
1233 {
1234 "result": AntaTestStatus.FAILURE,
1235 "description": "Interface: Ethernet3",
1236 "messages": ["Status mismatch - Expected: down, Actual: up"],
1237 },
1238 ],
1239 },
1240 },
1241 (VerifyStormControlDrops, "success"): {
1242 "eos_data": [
1243 {
1244 "aggregateTrafficClasses": {},
1245 "interfaces": {
1246 "Ethernet1": {
1247 "trafficTypes": {"broadcast": {"level": 100, "thresholdType": "packetsPerSecond", "rate": 0, "drop": 0, "dormant": False}},
1248 "active": True,
1249 "reason": "",
1250 "errdisabled": False,
1251 }
1252 },
1253 }
1254 ],
1255 "expected": {
1256 "result": AntaTestStatus.SUCCESS,
1257 "atomic_results": [
1258 {
1259 "description": "Interface: Ethernet1",
1260 "result": AntaTestStatus.SUCCESS,
1261 }
1262 ],
1263 },
1264 },
1265 (VerifyStormControlDrops, "failure"): {
1266 "eos_data": [
1267 {
1268 "aggregateTrafficClasses": {},
1269 "interfaces": {
1270 "Ethernet1": {
1271 "trafficTypes": {"broadcast": {"level": 100, "thresholdType": "packetsPerSecond", "rate": 0, "drop": 666, "dormant": False}},
1272 "active": True,
1273 "reason": "",
1274 "errdisabled": False,
1275 }
1276 },
1277 }
1278 ],
1279 "expected": {
1280 "result": AntaTestStatus.FAILURE,
1281 "messages": ["Interface: Ethernet1 - Non-zero storm-control drop counter(s) - broadcast: 666"],
1282 "atomic_results": [
1283 {"description": "Interface: Ethernet1", "result": AntaTestStatus.FAILURE, "messages": ["Non-zero storm-control drop counter(s) - broadcast: 666"]}
1284 ],
1285 },
1286 },
1287 (VerifyStormControlDrops, "success-ignore-interfface"): {
1288 "eos_data": [
1289 {
1290 "aggregateTrafficClasses": {},
1291 "interfaces": {
1292 "Ethernet1": {
1293 "trafficTypes": {"broadcast": {"level": 100, "thresholdType": "packetsPerSecond", "rate": 0, "drop": 0, "dormant": False}},
1294 "active": True,
1295 "reason": "",
1296 "errdisabled": False,
1297 },
1298 "Ethernet10": {
1299 "trafficTypes": {"broadcast": {"level": 100, "thresholdType": "packetsPerSecond", "rate": 440, "drop": 40, "dormant": False}},
1300 "active": True,
1301 "reason": "",
1302 "errdisabled": False,
1303 },
1304 },
1305 }
1306 ],
1307 "inputs": {"ignored_interfaces": ["Ethernet10"]},
1308 "expected": {
1309 "result": AntaTestStatus.SUCCESS,
1310 "atomic_results": [
1311 {
1312 "description": "Interface: Ethernet1",
1313 "result": AntaTestStatus.SUCCESS,
1314 }
1315 ],
1316 },
1317 },
1318 (VerifyStormControlDrops, "success-specific-interfface"): {
1319 "eos_data": [
1320 {
1321 "aggregateTrafficClasses": {},
1322 "interfaces": {
1323 "Ethernet1": {
1324 "trafficTypes": {"broadcast": {"level": 100, "thresholdType": "packetsPerSecond", "rate": 0, "drop": 0, "dormant": False}},
1325 "active": True,
1326 "reason": "",
1327 "errdisabled": False,
1328 },
1329 "Ethernet10": {
1330 "trafficTypes": {"broadcast": {"level": 100, "thresholdType": "packetsPerSecond", "rate": 440, "drop": 40, "dormant": False}},
1331 "active": True,
1332 "reason": "",
1333 "errdisabled": False,
1334 },
1335 },
1336 }
1337 ],
1338 "inputs": {"interfaces": ["Ethernet1"]},
1339 "expected": {
1340 "result": AntaTestStatus.SUCCESS,
1341 "atomic_results": [
1342 {
1343 "description": "Interface: Ethernet1",
1344 "result": AntaTestStatus.SUCCESS,
1345 }
1346 ],
1347 },
1348 },
1349 (VerifyStormControlDrops, "failure-specific-interfface-not-found"): {
1350 "eos_data": [
1351 {
1352 "aggregateTrafficClasses": {},
1353 "interfaces": {
1354 "Ethernet1": {
1355 "trafficTypes": {"broadcast": {"level": 100, "thresholdType": "packetsPerSecond", "rate": 0, "drop": 0, "dormant": False}},
1356 "active": True,
1357 "reason": "",
1358 "errdisabled": False,
1359 },
1360 "Ethernet10": {
1361 "trafficTypes": {"broadcast": {"level": 100, "thresholdType": "packetsPerSecond", "rate": 440, "drop": 40, "dormant": False}},
1362 "active": True,
1363 "reason": "",
1364 "errdisabled": False,
1365 },
1366 "Ethernet20": {
1367 "trafficTypes": {"broadcast": {"level": 100, "thresholdType": "packetsPerSecond", "rate": 440, "drop": 40, "dormant": False}},
1368 "active": True,
1369 "reason": "",
1370 "errdisabled": False,
1371 },
1372 },
1373 }
1374 ],
1375 "inputs": {"interfaces": ["Ethernet13", "Ethernet10", "Ethernet20"]},
1376 "expected": {
1377 "result": AntaTestStatus.FAILURE,
1378 "messages": [
1379 "Interface: Ethernet13 - Not found",
1380 "Interface: Ethernet10 - Non-zero storm-control drop counter(s) - broadcast: 40",
1381 "Interface: Ethernet20 - Non-zero storm-control drop counter(s) - broadcast: 40",
1382 ],
1383 "atomic_results": [
1384 {"description": "Interface: Ethernet13", "result": AntaTestStatus.FAILURE, "messages": ["Not found"]},
1385 {"description": "Interface: Ethernet10", "result": AntaTestStatus.FAILURE, "messages": ["Non-zero storm-control drop counter(s) - broadcast: 40"]},
1386 {"description": "Interface: Ethernet20", "result": AntaTestStatus.FAILURE, "messages": ["Non-zero storm-control drop counter(s) - broadcast: 40"]},
1387 ],
1388 },
1389 },
1390 (VerifyPortChannels, "success"): {
1391 "eos_data": [
1392 {
1393 "portChannels": {
1394 "Port-Channel42": {
1395 "recircFeature": [],
1396 "maxWeight": 16,
1397 "minSpeed": "0 gbps",
1398 "rxPorts": {},
1399 "currWeight": 0,
1400 "minLinks": 0,
1401 "inactivePorts": {},
1402 "activePorts": {},
1403 "inactiveLag": False,
1404 }
1405 }
1406 }
1407 ],
1408 "expected": {
1409 "result": AntaTestStatus.SUCCESS,
1410 "atomic_results": [
1411 {
1412 "result": AntaTestStatus.SUCCESS,
1413 "description": "Interface: Port-Channel42",
1414 },
1415 ],
1416 },
1417 },
1418 (VerifyPortChannels, "success-ignored-interface"): {
1419 "eos_data": [
1420 {
1421 "portChannels": {
1422 "Port-Channel1": {
1423 "activePorts": {"Ethernet1": {}, "Ethernet6": {}},
1424 "rxPorts": {},
1425 "inactivePorts": {},
1426 "recircFeature": [],
1427 "inactiveLag": False,
1428 "minLinks": 0,
1429 "minSpeed": "0 gbps",
1430 "currWeight": 0,
1431 "maxWeight": 16,
1432 },
1433 "Port-Channel5": {
1434 "activePorts": {"Ethernet4": {}, "PeerEthernet4": {}},
1435 "rxPorts": {},
1436 "inactivePorts": {"Ethernet8": {"reasonUnconfigured": "waiting for LACP response"}},
1437 "recircFeature": [],
1438 "inactiveLag": False,
1439 "minLinks": 0,
1440 "minSpeed": "0 gbps",
1441 "currWeight": 0,
1442 "maxWeight": 16,
1443 },
1444 }
1445 }
1446 ],
1447 "inputs": {"ignored_interfaces": ["Port-Channel5"]},
1448 "expected": {
1449 "result": AntaTestStatus.SUCCESS,
1450 "atomic_results": [
1451 {
1452 "result": AntaTestStatus.SUCCESS,
1453 "description": "Interface: Port-Channel1",
1454 },
1455 ],
1456 },
1457 },
1458 (VerifyPortChannels, "success-ignored-all-interface"): {
1459 "eos_data": [
1460 {
1461 "portChannels": {
1462 "Port-Channel1": {
1463 "activePorts": {"Ethernet1": {}, "Ethernet6": {}},
1464 "rxPorts": {},
1465 "inactivePorts": {},
1466 "recircFeature": [],
1467 "inactiveLag": False,
1468 "minLinks": 0,
1469 "minSpeed": "0 gbps",
1470 "currWeight": 0,
1471 "maxWeight": 16,
1472 },
1473 "Port-Channel5": {
1474 "activePorts": {"Ethernet4": {}, "PeerEthernet4": {}},
1475 "rxPorts": {},
1476 "inactivePorts": {"Ethernet8": {"reasonUnconfigured": "waiting for LACP response"}},
1477 "recircFeature": [],
1478 "inactiveLag": False,
1479 "minLinks": 0,
1480 "minSpeed": "0 gbps",
1481 "currWeight": 0,
1482 "maxWeight": 16,
1483 },
1484 }
1485 }
1486 ],
1487 "inputs": {"ignored_interfaces": ["Port-Channel5"]},
1488 "expected": {
1489 "result": AntaTestStatus.SUCCESS,
1490 "atomic_results": [
1491 {
1492 "result": AntaTestStatus.SUCCESS,
1493 "description": "Interface: Port-Channel1",
1494 },
1495 ],
1496 },
1497 },
1498 (VerifyPortChannels, "failure"): {
1499 "eos_data": [
1500 {
1501 "portChannels": {
1502 "Port-Channel42": {
1503 "recircFeature": [],
1504 "maxWeight": 16,
1505 "minSpeed": "0 gbps",
1506 "rxPorts": {},
1507 "currWeight": 0,
1508 "minLinks": 0,
1509 "inactivePorts": {"Ethernet8": {"reasonUnconfigured": "waiting for LACP response"}},
1510 "activePorts": {},
1511 "inactiveLag": False,
1512 }
1513 }
1514 }
1515 ],
1516 "expected": {
1517 "result": AntaTestStatus.FAILURE,
1518 "messages": ["Port-Channel42 - Inactive port(s) - Ethernet8"],
1519 "atomic_results": [
1520 {
1521 "result": AntaTestStatus.FAILURE,
1522 "description": "Interface: Port-Channel42",
1523 "messages": ["Inactive port(s) - Ethernet8"],
1524 },
1525 ],
1526 },
1527 },
1528 (VerifyPortChannels, "success-specified-interface"): {
1529 "eos_data": [
1530 {
1531 "portChannels": {
1532 "Port-Channel1": {
1533 "activePorts": {"Ethernet1": {}, "Ethernet6": {}},
1534 "rxPorts": {},
1535 "inactivePorts": {},
1536 "recircFeature": [],
1537 "inactiveLag": False,
1538 "minLinks": 0,
1539 "minSpeed": "0 gbps",
1540 "currWeight": 0,
1541 "maxWeight": 16,
1542 },
1543 "Port-Channel5": {
1544 "activePorts": {"Ethernet4": {}, "PeerEthernet4": {}},
1545 "rxPorts": {},
1546 "inactivePorts": {"Ethernet8": {"reasonUnconfigured": "waiting for LACP response"}},
1547 "recircFeature": [],
1548 "inactiveLag": False,
1549 "minLinks": 0,
1550 "minSpeed": "0 gbps",
1551 "currWeight": 0,
1552 "maxWeight": 16,
1553 },
1554 }
1555 }
1556 ],
1557 "inputs": {"interfaces": ["Port-Channel1"]},
1558 "expected": {
1559 "result": AntaTestStatus.SUCCESS,
1560 "atomic_results": [
1561 {
1562 "result": AntaTestStatus.SUCCESS,
1563 "description": "Interface: Port-Channel1",
1564 },
1565 ],
1566 },
1567 },
1568 (VerifyPortChannels, "failure-specified-interface-not-found"): {
1569 "eos_data": [
1570 {
1571 "portChannels": {
1572 "Port-Channel1": {
1573 "activePorts": {"Ethernet1": {}, "Ethernet6": {}},
1574 "rxPorts": {},
1575 "inactivePorts": {},
1576 "recircFeature": [],
1577 "inactiveLag": False,
1578 "minLinks": 0,
1579 "minSpeed": "0 gbps",
1580 "currWeight": 0,
1581 "maxWeight": 16,
1582 },
1583 "Port-Channel5": {
1584 "activePorts": {"Ethernet4": {}, "PeerEthernet4": {}},
1585 "rxPorts": {},
1586 "inactivePorts": {"Ethernet8": {"reasonUnconfigured": "waiting for LACP response"}},
1587 "recircFeature": [],
1588 "inactiveLag": False,
1589 "minLinks": 0,
1590 "minSpeed": "0 gbps",
1591 "currWeight": 0,
1592 "maxWeight": 16,
1593 },
1594 }
1595 }
1596 ],
1597 "inputs": {"interfaces": ["Port-Channel10", "Port-Channel5"]},
1598 "expected": {
1599 "result": AntaTestStatus.FAILURE,
1600 "messages": ["Interface: Port-Channel10 - Not found", "Interface: Port-Channel5 - Inactive port(s) - Ethernet8"],
1601 "atomic_results": [
1602 {
1603 "result": AntaTestStatus.FAILURE,
1604 "description": "Interface: Port-Channel10",
1605 "messages": ["Not found"],
1606 },
1607 {
1608 "result": AntaTestStatus.FAILURE,
1609 "description": "Interface: Port-Channel5",
1610 "messages": ["Inactive port(s) - Ethernet8"],
1611 },
1612 ],
1613 },
1614 },
1615 (VerifyIllegalLACP, "success"): {
1616 "eos_data": [
1617 {
1618 "portChannels": {
1619 "Port-Channel42": {
1620 "interfaces": {
1621 "Ethernet8": {
1622 "actorPortStatus": "noAgg",
1623 "illegalRxCount": 0,
1624 "markerResponseTxCount": 0,
1625 "markerResponseRxCount": 0,
1626 "lacpdusRxCount": 0,
1627 "lacpdusTxCount": 454,
1628 "markersTxCount": 0,
1629 "markersRxCount": 0,
1630 }
1631 }
1632 }
1633 },
1634 "orphanPorts": {},
1635 }
1636 ],
1637 "expected": {
1638 "result": AntaTestStatus.SUCCESS,
1639 "atomic_results": [
1640 {
1641 "description": "Interface: Port-Channel42",
1642 "result": AntaTestStatus.SUCCESS,
1643 }
1644 ],
1645 },
1646 },
1647 (VerifyIllegalLACP, "success-ignored-interface"): {
1648 "eos_data": [
1649 {
1650 "portChannels": {
1651 "Port-Channel1": {
1652 "interfaces": {
1653 "Ethernet1": {
1654 "actorPortStatus": "bundled",
1655 "lacpdusRxCount": 512,
1656 "lacpdusTxCount": 514,
1657 "markersRxCount": 0,
1658 "markersTxCount": 0,
1659 "markerResponseRxCount": 0,
1660 "markerResponseTxCount": 0,
1661 "illegalRxCount": 0,
1662 },
1663 "Ethernet6": {
1664 "actorPortStatus": "bundled",
1665 "lacpdusRxCount": 513,
1666 "lacpdusTxCount": 516,
1667 "markersRxCount": 0,
1668 "markersTxCount": 0,
1669 "markerResponseRxCount": 0,
1670 "markerResponseTxCount": 0,
1671 "illegalRxCount": 0,
1672 },
1673 }
1674 },
1675 "Port-Channel5": {
1676 "markers": {"markers": ["*"]},
1677 "interfaces": {
1678 "Ethernet4": {
1679 "actorPortStatus": "bundled",
1680 "lacpdusRxCount": 521,
1681 "lacpdusTxCount": 15119,
1682 "markersRxCount": 0,
1683 "markersTxCount": 0,
1684 "markerResponseRxCount": 0,
1685 "markerResponseTxCount": 0,
1686 "illegalRxCount": 66,
1687 }
1688 },
1689 },
1690 },
1691 "markerMessages": {"markerMessages": [{"marker": "*"}]},
1692 "orphanPorts": {},
1693 }
1694 ],
1695 "inputs": {"ignored_interfaces": ["Port-Channel5"]},
1696 "expected": {
1697 "result": AntaTestStatus.SUCCESS,
1698 "atomic_results": [
1699 {
1700 "description": "Interface: Port-Channel1",
1701 "result": AntaTestStatus.SUCCESS,
1702 }
1703 ],
1704 },
1705 },
1706 (VerifyIllegalLACP, "success-specific-interface"): {
1707 "eos_data": [
1708 {
1709 "portChannels": {
1710 "Port-Channel1": {
1711 "interfaces": {
1712 "Ethernet1": {
1713 "actorPortStatus": "bundled",
1714 "lacpdusRxCount": 512,
1715 "lacpdusTxCount": 514,
1716 "markersRxCount": 0,
1717 "markersTxCount": 0,
1718 "markerResponseRxCount": 0,
1719 "markerResponseTxCount": 0,
1720 "illegalRxCount": 66,
1721 },
1722 "Ethernet6": {
1723 "actorPortStatus": "bundled",
1724 "lacpdusRxCount": 513,
1725 "lacpdusTxCount": 516,
1726 "markersRxCount": 0,
1727 "markersTxCount": 0,
1728 "markerResponseRxCount": 0,
1729 "markerResponseTxCount": 0,
1730 "illegalRxCount": 0,
1731 },
1732 }
1733 },
1734 "Port-Channel5": {
1735 "markers": {"markers": ["*"]},
1736 "interfaces": {
1737 "Ethernet4": {
1738 "actorPortStatus": "bundled",
1739 "lacpdusRxCount": 521,
1740 "lacpdusTxCount": 15119,
1741 "markersRxCount": 0,
1742 "markersTxCount": 0,
1743 "markerResponseRxCount": 0,
1744 "markerResponseTxCount": 0,
1745 "illegalRxCount": 66,
1746 }
1747 },
1748 },
1749 "Port-Channel42": {
1750 "interfaces": {
1751 "Ethernet8": {
1752 "actorPortStatus": "noAgg",
1753 "illegalRxCount": 0,
1754 "markerResponseTxCount": 0,
1755 "markerResponseRxCount": 0,
1756 "lacpdusRxCount": 0,
1757 "lacpdusTxCount": 454,
1758 "markersTxCount": 0,
1759 "markersRxCount": 0,
1760 }
1761 }
1762 },
1763 },
1764 "markerMessages": {"markerMessages": [{"marker": "*"}]},
1765 "orphanPorts": {},
1766 }
1767 ],
1768 "inputs": {"interfaces": ["Port-Channel42"]},
1769 "expected": {
1770 "result": AntaTestStatus.SUCCESS,
1771 "atomic_results": [
1772 {
1773 "description": "Interface: Port-Channel42",
1774 "result": AntaTestStatus.SUCCESS,
1775 }
1776 ],
1777 },
1778 },
1779 (VerifyIllegalLACP, "success-specific-interface-not-found"): {
1780 "eos_data": [
1781 {
1782 "portChannels": {
1783 "Port-Channel1": {
1784 "interfaces": {
1785 "Ethernet1": {
1786 "actorPortStatus": "bundled",
1787 "lacpdusRxCount": 512,
1788 "lacpdusTxCount": 514,
1789 "markersRxCount": 0,
1790 "markersTxCount": 0,
1791 "markerResponseRxCount": 0,
1792 "markerResponseTxCount": 0,
1793 "illegalRxCount": 66,
1794 },
1795 "Ethernet6": {
1796 "actorPortStatus": "bundled",
1797 "lacpdusRxCount": 513,
1798 "lacpdusTxCount": 516,
1799 "markersRxCount": 0,
1800 "markersTxCount": 0,
1801 "markerResponseRxCount": 0,
1802 "markerResponseTxCount": 0,
1803 "illegalRxCount": 0,
1804 },
1805 }
1806 },
1807 "Port-Channel5": {
1808 "markers": {"markers": ["*"]},
1809 "interfaces": {
1810 "Ethernet4": {
1811 "actorPortStatus": "bundled",
1812 "lacpdusRxCount": 521,
1813 "lacpdusTxCount": 15119,
1814 "markersRxCount": 0,
1815 "markersTxCount": 0,
1816 "markerResponseRxCount": 0,
1817 "markerResponseTxCount": 0,
1818 "illegalRxCount": 66,
1819 }
1820 },
1821 },
1822 "Port-Channel42": {
1823 "interfaces": {
1824 "Ethernet8": {
1825 "actorPortStatus": "noAgg",
1826 "illegalRxCount": 0,
1827 "markerResponseTxCount": 0,
1828 "markerResponseRxCount": 0,
1829 "lacpdusRxCount": 0,
1830 "lacpdusTxCount": 454,
1831 "markersTxCount": 0,
1832 "markersRxCount": 0,
1833 }
1834 }
1835 },
1836 },
1837 "markerMessages": {"markerMessages": [{"marker": "*"}]},
1838 "orphanPorts": {},
1839 }
1840 ],
1841 "inputs": {"interfaces": ["Port-Channel4", "Port-Channel5"]},
1842 "expected": {
1843 "result": AntaTestStatus.FAILURE,
1844 "messages": ["Interface: Port-Channel4 - Not found", "Interface: Port-Channel5 - Illegal LACP packets detected on member interface Ethernet4"],
1845 "atomic_results": [
1846 {
1847 "description": "Interface: Port-Channel4",
1848 "result": AntaTestStatus.FAILURE,
1849 "messages": ["Not found"],
1850 },
1851 {
1852 "description": "Interface: Port-Channel5",
1853 "result": AntaTestStatus.FAILURE,
1854 "messages": ["Illegal LACP packets detected on member interface Ethernet4"],
1855 },
1856 ],
1857 },
1858 },
1859 (VerifyIllegalLACP, "failure"): {
1860 "eos_data": [
1861 {
1862 "portChannels": {
1863 "Port-Channel42": {
1864 "interfaces": {
1865 "Ethernet8": {
1866 "actorPortStatus": "bundled",
1867 "illegalRxCount": 666,
1868 },
1869 "Ethernet6": {"actorPortStatus": "bundled", "illegalRxCount": 666},
1870 }
1871 }
1872 },
1873 "orphanPorts": {},
1874 }
1875 ],
1876 "expected": {
1877 "result": AntaTestStatus.FAILURE,
1878 "messages": [
1879 "Interface: Port-Channel42 - Illegal LACP packets detected on member interface Ethernet8",
1880 "Interface: Port-Channel42 - Illegal LACP packets detected on member interface Ethernet6",
1881 ],
1882 "atomic_results": [
1883 {
1884 "description": "Interface: Port-Channel42",
1885 "result": AntaTestStatus.FAILURE,
1886 "messages": ["Illegal LACP packets detected on member interface Ethernet8", "Illegal LACP packets detected on member interface Ethernet6"],
1887 }
1888 ],
1889 },
1890 },
1891 (VerifyLoopbackCount, "success"): {
1892 "eos_data": [
1893 {
1894 "interfaces": {
1895 "Loopback42": {
1896 "name": "Loopback42",
1897 "interfaceStatus": "connected",
1898 "interfaceAddress": {"ipAddr": {"maskLen": 0, "address": "0.0.0.0"}, "unnumberedIntf": "Vlan42"},
1899 "ipv4Routable240": False,
1900 "lineProtocolStatus": "up",
1901 "mtu": 65535,
1902 },
1903 "Loopback666": {
1904 "name": "Loopback666",
1905 "interfaceStatus": "connected",
1906 "interfaceAddress": {"ipAddr": {"maskLen": 32, "address": "6.6.6.6"}},
1907 "ipv4Routable240": False,
1908 "lineProtocolStatus": "up",
1909 "mtu": 65535,
1910 },
1911 "Ethernet666": {
1912 "name": "Ethernet666",
1913 "interfaceStatus": "connected",
1914 "interfaceAddress": {"ipAddr": {"maskLen": 32, "address": "6.6.6.6"}},
1915 "ipv4Routable240": False,
1916 "lineProtocolStatus": "up",
1917 },
1918 }
1919 }
1920 ],
1921 "inputs": {"number": 2},
1922 "expected": {"result": AntaTestStatus.SUCCESS},
1923 },
1924 (VerifyLoopbackCount, "failure-loopback-down"): {
1925 "eos_data": [
1926 {
1927 "interfaces": {
1928 "Loopback42": {
1929 "name": "Loopback42",
1930 "interfaceStatus": "connected",
1931 "interfaceAddress": {"ipAddr": {"maskLen": 0, "address": "0.0.0.0"}, "unnumberedIntf": "Vlan42"},
1932 "ipv4Routable240": False,
1933 "lineProtocolStatus": "up",
1934 "mtu": 65535,
1935 },
1936 "Loopback666": {
1937 "name": "Loopback666",
1938 "interfaceStatus": "notconnect",
1939 "interfaceAddress": {"ipAddr": {"maskLen": 32, "address": "6.6.6.6"}},
1940 "ipv4Routable240": False,
1941 "lineProtocolStatus": "down",
1942 "mtu": 65535,
1943 },
1944 }
1945 }
1946 ],
1947 "inputs": {"number": 2},
1948 "expected": {
1949 "result": AntaTestStatus.FAILURE,
1950 "messages": [
1951 "Interface: Loopback666 - Invalid line protocol status - Expected: up Actual: down",
1952 "Interface: Loopback666 - Invalid interface status - Expected: connected Actual: notconnect",
1953 ],
1954 },
1955 },
1956 (VerifyLoopbackCount, "failure-count-loopback"): {
1957 "eos_data": [
1958 {
1959 "interfaces": {
1960 "Loopback42": {
1961 "name": "Loopback42",
1962 "interfaceStatus": "connected",
1963 "interfaceAddress": {"ipAddr": {"maskLen": 0, "address": "0.0.0.0"}, "unnumberedIntf": "Vlan42"},
1964 "ipv4Routable240": False,
1965 "lineProtocolStatus": "up",
1966 "mtu": 65535,
1967 }
1968 }
1969 }
1970 ],
1971 "inputs": {"number": 2},
1972 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Loopback interface(s) count mismatch: Expected 2 Actual: 1"]},
1973 },
1974 (VerifySVI, "success"): {
1975 "eos_data": [
1976 {
1977 "interfaces": {
1978 "Vlan42": {
1979 "name": "Vlan42",
1980 "interfaceStatus": "connected",
1981 "interfaceAddress": {"ipAddr": {"maskLen": 24, "address": "11.11.11.11"}},
1982 "ipv4Routable240": False,
1983 "lineProtocolStatus": "up",
1984 "mtu": 1500,
1985 }
1986 }
1987 }
1988 ],
1989 "expected": {"result": AntaTestStatus.SUCCESS},
1990 },
1991 (VerifySVI, "failure"): {
1992 "eos_data": [
1993 {
1994 "interfaces": {
1995 "Vlan42": {
1996 "name": "Vlan42",
1997 "interfaceStatus": "notconnect",
1998 "interfaceAddress": {"ipAddr": {"maskLen": 24, "address": "11.11.11.11"}},
1999 "ipv4Routable240": False,
2000 "lineProtocolStatus": "lowerLayerDown",
2001 "mtu": 1500,
2002 }
2003 }
2004 }
2005 ],
2006 "expected": {
2007 "result": AntaTestStatus.FAILURE,
2008 "messages": [
2009 "SVI: Vlan42 - Invalid line protocol status - Expected: up Actual: lowerLayerDown",
2010 "SVI: Vlan42 - Invalid interface status - Expected: connected Actual: notconnect",
2011 ],
2012 },
2013 },
2014 (VerifyL3MTU, "success"): {
2015 "eos_data": [
2016 {
2017 "interfaces": {
2018 "Ethernet2": {
2019 "name": "Ethernet2",
2020 "forwardingModel": "routed",
2021 "lineProtocolStatus": "up",
2022 "interfaceStatus": "connected",
2023 "hardware": "ethernet",
2024 "mtu": 1500,
2025 "l3MtuConfigured": True,
2026 "l2Mru": 0,
2027 },
2028 "Ethernet10": {
2029 "name": "Ethernet10",
2030 "forwardingModel": "bridged",
2031 "lineProtocolStatus": "up",
2032 "interfaceStatus": "connected",
2033 "hardware": "ethernet",
2034 "mtu": 1500,
2035 "l3MtuConfigured": False,
2036 "l2Mru": 0,
2037 },
2038 "Management1/1": {
2039 "name": "Management0",
2040 "forwardingModel": "routed",
2041 "lineProtocolStatus": "up",
2042 "interfaceStatus": "connected",
2043 "hardware": "ethernet",
2044 "mtu": 1500,
2045 "l3MtuConfigured": False,
2046 "l2Mru": 0,
2047 },
2048 "Port-Channel2": {
2049 "name": "Port-Channel2",
2050 "forwardingModel": "bridged",
2051 "lineProtocolStatus": "lowerLayerDown",
2052 "interfaceStatus": "notconnect",
2053 "hardware": "portChannel",
2054 "mtu": 1500,
2055 "l3MtuConfigured": False,
2056 "l2Mru": 0,
2057 },
2058 "Loopback0": {
2059 "name": "Loopback0",
2060 "forwardingModel": "routed",
2061 "lineProtocolStatus": "up",
2062 "interfaceStatus": "connected",
2063 "hardware": "loopback",
2064 "mtu": 65535,
2065 "l3MtuConfigured": False,
2066 "l2Mru": 0,
2067 },
2068 "Vxlan1": {
2069 "name": "Vxlan1",
2070 "forwardingModel": "bridged",
2071 "lineProtocolStatus": "down",
2072 "interfaceStatus": "notconnect",
2073 "hardware": "vxlan",
2074 "mtu": 0,
2075 "l3MtuConfigured": False,
2076 "l2Mru": 0,
2077 },
2078 }
2079 }
2080 ],
2081 "inputs": {"mtu": 1500},
2082 "expected": {"result": AntaTestStatus.SUCCESS},
2083 },
2084 (VerifyL3MTU, "success-ignored-interfaces"): {
2085 "eos_data": [
2086 {
2087 "interfaces": {
2088 "Ethernet2": {
2089 "name": "Ethernet2",
2090 "forwardingModel": "routed",
2091 "lineProtocolStatus": "up",
2092 "interfaceStatus": "connected",
2093 "hardware": "ethernet",
2094 "mtu": 1500,
2095 "l3MtuConfigured": True,
2096 "l2Mru": 0,
2097 },
2098 "Ethernet10": {
2099 "name": "Ethernet10",
2100 "forwardingModel": "routed",
2101 "lineProtocolStatus": "up",
2102 "interfaceStatus": "connected",
2103 "hardware": "ethernet",
2104 "mtu": 1501,
2105 "l3MtuConfigured": False,
2106 "l2Mru": 0,
2107 },
2108 "Management0": {
2109 "name": "Management0",
2110 "forwardingModel": "routed",
2111 "lineProtocolStatus": "up",
2112 "interfaceStatus": "connected",
2113 "hardware": "ethernet",
2114 "mtu": 1500,
2115 "l3MtuConfigured": False,
2116 "l2Mru": 0,
2117 },
2118 "Port-Channel2": {
2119 "name": "Port-Channel2",
2120 "forwardingModel": "bridged",
2121 "lineProtocolStatus": "lowerLayerDown",
2122 "interfaceStatus": "notconnect",
2123 "hardware": "portChannel",
2124 "mtu": 1500,
2125 "l3MtuConfigured": False,
2126 "l2Mru": 0,
2127 },
2128 "Loopback0": {
2129 "name": "Loopback0",
2130 "forwardingModel": "routed",
2131 "lineProtocolStatus": "up",
2132 "interfaceStatus": "connected",
2133 "hardware": "loopback",
2134 "mtu": 65535,
2135 "l3MtuConfigured": False,
2136 "l2Mru": 0,
2137 },
2138 "Vxlan1": {
2139 "name": "Vxlan1",
2140 "forwardingModel": "bridged",
2141 "lineProtocolStatus": "down",
2142 "interfaceStatus": "notconnect",
2143 "hardware": "vxlan",
2144 "mtu": 0,
2145 "l3MtuConfigured": False,
2146 "l2Mru": 0,
2147 },
2148 }
2149 }
2150 ],
2151 "inputs": {"mtu": 1500, "ignored_interfaces": ["Loopback", "Port-Channel", "Management", "Vxlan"], "specific_mtu": [{"Ethernet10": 1501}]},
2152 "expected": {"result": AntaTestStatus.SUCCESS},
2153 },
2154 (VerifyL3MTU, "failure"): {
2155 "eos_data": [
2156 {
2157 "interfaces": {
2158 "Ethernet2": {
2159 "name": "Ethernet2",
2160 "forwardingModel": "routed",
2161 "lineProtocolStatus": "up",
2162 "interfaceStatus": "connected",
2163 "hardware": "ethernet",
2164 "mtu": 1600,
2165 "l3MtuConfigured": True,
2166 "l2Mru": 0,
2167 },
2168 "Ethernet10": {
2169 "name": "Ethernet10",
2170 "forwardingModel": "routed",
2171 "lineProtocolStatus": "up",
2172 "interfaceStatus": "connected",
2173 "hardware": "ethernet",
2174 "mtu": 1500,
2175 "l3MtuConfigured": False,
2176 "l2Mru": 0,
2177 },
2178 "Management0": {
2179 "name": "Management0",
2180 "forwardingModel": "routed",
2181 "lineProtocolStatus": "up",
2182 "interfaceStatus": "connected",
2183 "hardware": "ethernet",
2184 "mtu": 1500,
2185 "l3MtuConfigured": False,
2186 "l2Mru": 0,
2187 },
2188 "Port-Channel2": {
2189 "name": "Port-Channel2",
2190 "forwardingModel": "bridged",
2191 "lineProtocolStatus": "lowerLayerDown",
2192 "interfaceStatus": "notconnect",
2193 "hardware": "portChannel",
2194 "mtu": 1500,
2195 "l3MtuConfigured": False,
2196 "l2Mru": 0,
2197 },
2198 "Loopback0": {
2199 "name": "Loopback0",
2200 "forwardingModel": "routed",
2201 "lineProtocolStatus": "up",
2202 "interfaceStatus": "connected",
2203 "hardware": "loopback",
2204 "mtu": 65535,
2205 "l3MtuConfigured": False,
2206 "l2Mru": 0,
2207 },
2208 "Vxlan1": {
2209 "name": "Vxlan1",
2210 "forwardingModel": "bridged",
2211 "lineProtocolStatus": "down",
2212 "interfaceStatus": "notconnect",
2213 "hardware": "vxlan",
2214 "mtu": 0,
2215 "l3MtuConfigured": False,
2216 "l2Mru": 0,
2217 },
2218 }
2219 }
2220 ],
2221 "inputs": {"mtu": 1500},
2222 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Ethernet2 - Incorrect MTU - Expected: 1500 Actual: 1600"]},
2223 },
2224 (VerifyL3MTU, "failure-specified-interface-mtu"): {
2225 "eos_data": [
2226 {
2227 "interfaces": {
2228 "Ethernet2": {
2229 "name": "Ethernet2",
2230 "forwardingModel": "routed",
2231 "lineProtocolStatus": "up",
2232 "interfaceStatus": "connected",
2233 "hardware": "ethernet",
2234 "mtu": 1500,
2235 "l3MtuConfigured": True,
2236 "l2Mru": 0,
2237 },
2238 "Ethernet10": {
2239 "name": "Ethernet10",
2240 "forwardingModel": "routed",
2241 "lineProtocolStatus": "up",
2242 "interfaceStatus": "connected",
2243 "hardware": "ethernet",
2244 "mtu": 1502,
2245 "l3MtuConfigured": False,
2246 "l2Mru": 0,
2247 },
2248 "Management0": {
2249 "name": "Management0",
2250 "forwardingModel": "routed",
2251 "lineProtocolStatus": "up",
2252 "interfaceStatus": "connected",
2253 "hardware": "ethernet",
2254 "mtu": 1500,
2255 "l3MtuConfigured": False,
2256 "l2Mru": 0,
2257 },
2258 "Port-Channel2": {
2259 "name": "Port-Channel2",
2260 "forwardingModel": "bridged",
2261 "lineProtocolStatus": "lowerLayerDown",
2262 "interfaceStatus": "notconnect",
2263 "hardware": "portChannel",
2264 "mtu": 1500,
2265 "l3MtuConfigured": False,
2266 "l2Mru": 0,
2267 },
2268 "Loopback0": {
2269 "name": "Loopback0",
2270 "forwardingModel": "routed",
2271 "lineProtocolStatus": "up",
2272 "interfaceStatus": "connected",
2273 "hardware": "loopback",
2274 "mtu": 65535,
2275 "l3MtuConfigured": False,
2276 "l2Mru": 0,
2277 },
2278 "Vxlan1": {
2279 "name": "Vxlan1",
2280 "forwardingModel": "bridged",
2281 "lineProtocolStatus": "down",
2282 "interfaceStatus": "notconnect",
2283 "hardware": "vxlan",
2284 "mtu": 0,
2285 "l3MtuConfigured": False,
2286 "l2Mru": 0,
2287 },
2288 }
2289 }
2290 ],
2291 "inputs": {"mtu": 1500, "ignored_interfaces": ["Loopback", "Port-Channel2", "Management", "Vxlan1"], "specific_mtu": [{"Ethernet10": 1501}]},
2292 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Ethernet10 - Incorrect MTU - Expected: 1501 Actual: 1502"]},
2293 },
2294 (VerifyL3MTU, "failure-ignored-specified-interface-mtu"): {
2295 "eos_data": [
2296 {
2297 "interfaces": {
2298 "Ethernet2": {
2299 "name": "Ethernet2",
2300 "forwardingModel": "routed",
2301 "lineProtocolStatus": "up",
2302 "interfaceStatus": "connected",
2303 "hardware": "ethernet",
2304 "mtu": 1503,
2305 "l3MtuConfigured": True,
2306 "l2Mru": 0,
2307 },
2308 "Ethernet1/1": {
2309 "name": "Ethernet1/1",
2310 "forwardingModel": "routed",
2311 "lineProtocolStatus": "up",
2312 "interfaceStatus": "connected",
2313 "hardware": "ethernet",
2314 "mtu": 1502,
2315 "l3MtuConfigured": False,
2316 "l2Mru": 0,
2317 },
2318 "Ethernet1.100": {
2319 "name": "Ethernet1.100",
2320 "forwardingModel": "routed",
2321 "lineProtocolStatus": "up",
2322 "interfaceStatus": "connected",
2323 "hardware": "ethernet",
2324 "mtu": 1507,
2325 "l3MtuConfigured": False,
2326 "l2Mru": 0,
2327 },
2328 "Port-Channel2": {
2329 "name": "Port-Channel2",
2330 "forwardingModel": "bridged",
2331 "lineProtocolStatus": "lowerLayerDown",
2332 "interfaceStatus": "notconnect",
2333 "hardware": "portChannel",
2334 "mtu": 1500,
2335 "l3MtuConfigured": False,
2336 "l2Mru": 0,
2337 },
2338 "Loopback0": {
2339 "name": "Loopback0",
2340 "forwardingModel": "routed",
2341 "lineProtocolStatus": "up",
2342 "interfaceStatus": "connected",
2343 "hardware": "loopback",
2344 "mtu": 65535,
2345 "l3MtuConfigured": False,
2346 "l2Mru": 0,
2347 },
2348 "Vxlan1": {
2349 "name": "Vxlan1",
2350 "forwardingModel": "bridged",
2351 "lineProtocolStatus": "down",
2352 "interfaceStatus": "notconnect",
2353 "hardware": "vxlan",
2354 "mtu": 0,
2355 "l3MtuConfigured": False,
2356 "l2Mru": 0,
2357 },
2358 }
2359 }
2360 ],
2361 "inputs": {
2362 "mtu": 1500,
2363 "ignored_interfaces": ["Loopback", "Port-Channel2", "Management", "Vxlan1", "Ethernet1/1", "Ethernet1.100"],
2364 "specific_mtu": [{"Ethernet1/1": 1501}],
2365 },
2366 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Ethernet2 - Incorrect MTU - Expected: 1500 Actual: 1503"]},
2367 },
2368 (VerifyL3MTU, "failure-ignored-specified-ethernet"): {
2369 "eos_data": [
2370 {
2371 "interfaces": {
2372 "Ethernet2": {
2373 "name": "Ethernet2",
2374 "forwardingModel": "routed",
2375 "lineProtocolStatus": "up",
2376 "interfaceStatus": "connected",
2377 "hardware": "ethernet",
2378 "mtu": 1503,
2379 "l3MtuConfigured": True,
2380 "l2Mru": 0,
2381 },
2382 "Ethernet1/1": {
2383 "name": "Ethernet1/1",
2384 "forwardingModel": "routed",
2385 "lineProtocolStatus": "up",
2386 "interfaceStatus": "connected",
2387 "hardware": "ethernet",
2388 "mtu": 1502,
2389 "l3MtuConfigured": False,
2390 "l2Mru": 0,
2391 },
2392 "Ethernet1.100": {
2393 "name": "Ethernet1.100",
2394 "forwardingModel": "routed",
2395 "lineProtocolStatus": "up",
2396 "interfaceStatus": "connected",
2397 "hardware": "ethernet",
2398 "mtu": 1507,
2399 "l3MtuConfigured": False,
2400 "l2Mru": 0,
2401 },
2402 "Port-Channel2": {
2403 "name": "Port-Channel2",
2404 "forwardingModel": "bridged",
2405 "lineProtocolStatus": "lowerLayerDown",
2406 "interfaceStatus": "notconnect",
2407 "hardware": "portChannel",
2408 "mtu": 1500,
2409 "l3MtuConfigured": False,
2410 "l2Mru": 0,
2411 },
2412 "Loopback0": {
2413 "name": "Loopback0",
2414 "forwardingModel": "routed",
2415 "lineProtocolStatus": "up",
2416 "interfaceStatus": "connected",
2417 "hardware": "loopback",
2418 "mtu": 65535,
2419 "l3MtuConfigured": False,
2420 "l2Mru": 0,
2421 },
2422 "Vxlan1": {
2423 "name": "Vxlan1",
2424 "forwardingModel": "bridged",
2425 "lineProtocolStatus": "down",
2426 "interfaceStatus": "notconnect",
2427 "hardware": "vxlan",
2428 "mtu": 0,
2429 "l3MtuConfigured": False,
2430 "l2Mru": 0,
2431 },
2432 }
2433 }
2434 ],
2435 "inputs": {"mtu": 1500, "ignored_interfaces": ["Loopback", "Ethernet1"], "specific_mtu": [{"Ethernet1/1": 1501}]},
2436 "expected": {
2437 "result": AntaTestStatus.FAILURE,
2438 "messages": [
2439 "Interface: Ethernet2 - Incorrect MTU - Expected: 1500 Actual: 1503",
2440 "Interface: Ethernet1/1 - Incorrect MTU - Expected: 1501 Actual: 1502",
2441 "Interface: Ethernet1.100 - Incorrect MTU - Expected: 1500 Actual: 1507",
2442 ],
2443 },
2444 },
2445 (VerifyL3MTU, "succuss-ethernet-all"): {
2446 "eos_data": [
2447 {
2448 "interfaces": {
2449 "Ethernet2": {
2450 "name": "Ethernet2",
2451 "forwardingModel": "routed",
2452 "lineProtocolStatus": "up",
2453 "interfaceStatus": "connected",
2454 "hardware": "ethernet",
2455 "mtu": 1503,
2456 "l3MtuConfigured": True,
2457 "l2Mru": 0,
2458 },
2459 "Ethernet1/1": {
2460 "name": "Ethernet1/1",
2461 "forwardingModel": "routed",
2462 "lineProtocolStatus": "up",
2463 "interfaceStatus": "connected",
2464 "hardware": "ethernet",
2465 "mtu": 1502,
2466 "l3MtuConfigured": False,
2467 "l2Mru": 0,
2468 },
2469 "Ethernet1.100": {
2470 "name": "Ethernet1.100",
2471 "forwardingModel": "routed",
2472 "lineProtocolStatus": "up",
2473 "interfaceStatus": "connected",
2474 "hardware": "ethernet",
2475 "mtu": 1507,
2476 "l3MtuConfigured": False,
2477 "l2Mru": 0,
2478 },
2479 "Port-Channel2": {
2480 "name": "Port-Channel2",
2481 "forwardingModel": "bridged",
2482 "lineProtocolStatus": "lowerLayerDown",
2483 "interfaceStatus": "notconnect",
2484 "hardware": "portChannel",
2485 "mtu": 1500,
2486 "l3MtuConfigured": False,
2487 "l2Mru": 0,
2488 },
2489 "Loopback0": {
2490 "name": "Loopback0",
2491 "forwardingModel": "routed",
2492 "lineProtocolStatus": "up",
2493 "interfaceStatus": "connected",
2494 "hardware": "loopback",
2495 "mtu": 65535,
2496 "l3MtuConfigured": False,
2497 "l2Mru": 0,
2498 },
2499 "Vxlan1": {
2500 "name": "Vxlan1",
2501 "forwardingModel": "bridged",
2502 "lineProtocolStatus": "down",
2503 "interfaceStatus": "notconnect",
2504 "hardware": "vxlan",
2505 "mtu": 0,
2506 "l3MtuConfigured": False,
2507 "l2Mru": 0,
2508 },
2509 }
2510 }
2511 ],
2512 "inputs": {"mtu": 1500, "ignored_interfaces": ["Loopback", "Ethernet"], "specific_mtu": [{"Ethernet1/1": 1501}]},
2513 "expected": {"result": AntaTestStatus.SUCCESS},
2514 },
2515 (VerifyL2MTU, "success"): {
2516 "eos_data": [
2517 {
2518 "interfaces": {
2519 "Ethernet2/1": {
2520 "name": "Ethernet2/1",
2521 "forwardingModel": "bridged",
2522 "lineProtocolStatus": "up",
2523 "interfaceStatus": "connected",
2524 "hardware": "ethernet",
2525 "mtu": 9218,
2526 "l3MtuConfigured": True,
2527 "l2Mru": 0,
2528 },
2529 "Ethernet10": {
2530 "name": "Ethernet10",
2531 "forwardingModel": "bridged",
2532 "lineProtocolStatus": "up",
2533 "interfaceStatus": "connected",
2534 "hardware": "ethernet",
2535 "mtu": 9214,
2536 "l3MtuConfigured": False,
2537 "l2Mru": 0,
2538 },
2539 "Management0": {
2540 "name": "Management0",
2541 "forwardingModel": "routed",
2542 "lineProtocolStatus": "up",
2543 "interfaceStatus": "connected",
2544 "hardware": "ethernet",
2545 "mtu": 1500,
2546 "l3MtuConfigured": False,
2547 "l2Mru": 0,
2548 },
2549 "Port-Channel2": {
2550 "name": "Port-Channel2",
2551 "forwardingModel": "bridged",
2552 "lineProtocolStatus": "lowerLayerDown",
2553 "interfaceStatus": "notconnect",
2554 "hardware": "portChannel",
2555 "mtu": 9214,
2556 "l3MtuConfigured": False,
2557 "l2Mru": 0,
2558 },
2559 "Loopback0": {
2560 "name": "Loopback0",
2561 "forwardingModel": "routed",
2562 "lineProtocolStatus": "up",
2563 "interfaceStatus": "connected",
2564 "hardware": "loopback",
2565 "mtu": 65535,
2566 "l3MtuConfigured": False,
2567 "l2Mru": 0,
2568 },
2569 "Vxlan1": {
2570 "name": "Vxlan1",
2571 "forwardingModel": "bridged",
2572 "lineProtocolStatus": "down",
2573 "interfaceStatus": "notconnect",
2574 "hardware": "vxlan",
2575 "mtu": 0,
2576 "l3MtuConfigured": False,
2577 "l2Mru": 0,
2578 },
2579 }
2580 }
2581 ],
2582 "inputs": {"mtu": 9214, "ignored_interfaces": ["Loopback0", "Port-Channel", "Management0", "Vxlan", "Ethernet2/1"], "specific_mtu": [{"Ethernet10": 9214}]},
2583 "expected": {"result": AntaTestStatus.SUCCESS},
2584 },
2585 (VerifyL2MTU, "failure"): {
2586 "eos_data": [
2587 {
2588 "interfaces": {
2589 "Ethernet2": {
2590 "name": "Ethernet2",
2591 "forwardingModel": "routed",
2592 "lineProtocolStatus": "up",
2593 "interfaceStatus": "connected",
2594 "hardware": "ethernet",
2595 "mtu": 1600,
2596 "l3MtuConfigured": True,
2597 "l2Mru": 0,
2598 },
2599 "Ethernet10": {
2600 "name": "Ethernet10",
2601 "forwardingModel": "bridged",
2602 "lineProtocolStatus": "up",
2603 "interfaceStatus": "connected",
2604 "hardware": "ethernet",
2605 "mtu": 9214,
2606 "l3MtuConfigured": False,
2607 "l2Mru": 0,
2608 },
2609 "Management0": {
2610 "name": "Management0",
2611 "forwardingModel": "routed",
2612 "lineProtocolStatus": "up",
2613 "interfaceStatus": "connected",
2614 "hardware": "ethernet",
2615 "mtu": 1500,
2616 "l3MtuConfigured": False,
2617 "l2Mru": 0,
2618 },
2619 "Port-Channel2": {
2620 "name": "Port-Channel2",
2621 "forwardingModel": "bridged",
2622 "lineProtocolStatus": "lowerLayerDown",
2623 "interfaceStatus": "notconnect",
2624 "hardware": "portChannel",
2625 "mtu": 9214,
2626 "l3MtuConfigured": False,
2627 "l2Mru": 0,
2628 },
2629 "Loopback0": {
2630 "name": "Loopback0",
2631 "forwardingModel": "routed",
2632 "lineProtocolStatus": "up",
2633 "interfaceStatus": "connected",
2634 "hardware": "loopback",
2635 "mtu": 65535,
2636 "l3MtuConfigured": False,
2637 "l2Mru": 0,
2638 },
2639 "Vxlan1": {
2640 "name": "Vxlan1",
2641 "forwardingModel": "bridged",
2642 "lineProtocolStatus": "down",
2643 "interfaceStatus": "notconnect",
2644 "hardware": "vxlan",
2645 "mtu": 0,
2646 "l3MtuConfigured": False,
2647 "l2Mru": 0,
2648 },
2649 }
2650 }
2651 ],
2652 "inputs": {"mtu": 1500},
2653 "expected": {
2654 "result": AntaTestStatus.FAILURE,
2655 "messages": [
2656 "Interface: Ethernet10 - Incorrect MTU - Expected: 1500 Actual: 9214",
2657 "Interface: Port-Channel2 - Incorrect MTU - Expected: 1500 Actual: 9214",
2658 ],
2659 },
2660 },
2661 (VerifyL2MTU, "failure-specific-interface"): {
2662 "eos_data": [
2663 {
2664 "interfaces": {
2665 "Ethernet1.100": {
2666 "name": "Ethernet2",
2667 "forwardingModel": "bridged",
2668 "lineProtocolStatus": "up",
2669 "interfaceStatus": "connected",
2670 "hardware": "ethernet",
2671 "mtu": 9218,
2672 "l3MtuConfigured": True,
2673 "l2Mru": 0,
2674 },
2675 "Ethernet10": {
2676 "name": "Ethernet10",
2677 "forwardingModel": "bridged",
2678 "lineProtocolStatus": "up",
2679 "interfaceStatus": "connected",
2680 "hardware": "ethernet",
2681 "mtu": 9214,
2682 "l3MtuConfigured": False,
2683 "l2Mru": 0,
2684 },
2685 "Management0": {
2686 "name": "Management0",
2687 "forwardingModel": "routed",
2688 "lineProtocolStatus": "up",
2689 "interfaceStatus": "connected",
2690 "hardware": "ethernet",
2691 "mtu": 1500,
2692 "l3MtuConfigured": False,
2693 "l2Mru": 0,
2694 },
2695 "Port-Channel2": {
2696 "name": "Port-Channel2",
2697 "forwardingModel": "bridged",
2698 "lineProtocolStatus": "lowerLayerDown",
2699 "interfaceStatus": "notconnect",
2700 "hardware": "portChannel",
2701 "mtu": 9214,
2702 "l3MtuConfigured": False,
2703 "l2Mru": 0,
2704 },
2705 "Loopback0": {
2706 "name": "Loopback0",
2707 "forwardingModel": "routed",
2708 "lineProtocolStatus": "up",
2709 "interfaceStatus": "connected",
2710 "hardware": "loopback",
2711 "mtu": 65535,
2712 "l3MtuConfigured": False,
2713 "l2Mru": 0,
2714 },
2715 "Vxlan1": {
2716 "name": "Vxlan1",
2717 "forwardingModel": "bridged",
2718 "lineProtocolStatus": "down",
2719 "interfaceStatus": "notconnect",
2720 "hardware": "vxlan",
2721 "mtu": 0,
2722 "l3MtuConfigured": False,
2723 "l2Mru": 0,
2724 },
2725 }
2726 }
2727 ],
2728 "inputs": {"specific_mtu": [{"Et10": 9214}, {"Port-Channel2": 10000}], "ignored_interfaces": ["Ethernet", "Vxlan1"]},
2729 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Port-Channel2 - Incorrect MTU - Expected: 10000 Actual: 9214"]},
2730 },
2731 (VerifyIPProxyARP, "success"): {
2732 "eos_data": [
2733 {
2734 "interfaces": {
2735 "Ethernet1": {"name": "Ethernet1", "lineProtocolStatus": "up", "interfaceStatus": "connected", "proxyArp": True},
2736 "Ethernet2": {"name": "Ethernet2", "lineProtocolStatus": "up", "interfaceStatus": "connected", "proxyArp": True},
2737 }
2738 }
2739 ],
2740 "inputs": {"interfaces": ["Ethernet1", "Ethernet2"]},
2741 "expected": {"result": AntaTestStatus.SUCCESS},
2742 },
2743 (VerifyIPProxyARP, "failure-interface-not-found"): {
2744 "eos_data": [{"interfaces": {"Ethernet1": {"name": "Ethernet1", "lineProtocolStatus": "up", "interfaceStatus": "connected", "proxyArp": True}}}],
2745 "inputs": {"interfaces": ["Ethernet1", "Ethernet2"]},
2746 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Ethernet2 - Not found"]},
2747 },
2748 (VerifyIPProxyARP, "failure"): {
2749 "eos_data": [
2750 {
2751 "interfaces": {
2752 "Ethernet1": {"name": "Ethernet1", "lineProtocolStatus": "up", "interfaceStatus": "connected", "proxyArp": True},
2753 "Ethernet2": {"name": "Ethernet2", "lineProtocolStatus": "up", "interfaceStatus": "connected", "proxyArp": False},
2754 }
2755 }
2756 ],
2757 "inputs": {"interfaces": ["Ethernet1", "Ethernet2"]},
2758 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Ethernet2 - Proxy-ARP disabled"]},
2759 },
2760 (VerifyInterfaceIPv4, "success"): {
2761 "eos_data": [
2762 {
2763 "interfaces": {
2764 "Ethernet2": {
2765 "interfaceAddress": {
2766 "primaryIp": {"address": "172.30.11.1", "maskLen": 31},
2767 "secondaryIpsOrderedList": [{"address": "10.10.10.1", "maskLen": 31}, {"address": "10.10.10.10", "maskLen": 31}],
2768 }
2769 },
2770 "Ethernet12": {
2771 "interfaceAddress": {
2772 "primaryIp": {"address": "172.30.11.10", "maskLen": 31},
2773 "secondaryIpsOrderedList": [{"address": "10.10.10.10", "maskLen": 31}, {"address": "10.10.10.20", "maskLen": 31}],
2774 }
2775 },
2776 }
2777 }
2778 ],
2779 "inputs": {
2780 "interfaces": [
2781 {"name": "Ethernet2", "primary_ip": "172.30.11.1/31", "secondary_ips": ["10.10.10.1/31", "10.10.10.10/31"]},
2782 {"name": "Ethernet12", "primary_ip": "172.30.11.10/31", "secondary_ips": ["10.10.10.10/31", "10.10.10.20/31"]},
2783 ]
2784 },
2785 "expected": {"result": AntaTestStatus.SUCCESS},
2786 },
2787 (VerifyInterfaceIPv4, "success-without-secondary-ip"): {
2788 "eos_data": [
2789 {
2790 "interfaces": {
2791 "Ethernet2": {"interfaceAddress": {"primaryIp": {"address": "172.30.11.0", "maskLen": 31}, "secondaryIpsOrderedList": []}},
2792 "Ethernet12": {"interfaceAddress": {"primaryIp": {"address": "172.30.11.10", "maskLen": 31}, "secondaryIpsOrderedList": []}},
2793 }
2794 }
2795 ],
2796 "inputs": {"interfaces": [{"name": "Ethernet2", "primary_ip": "172.30.11.0/31"}, {"name": "Ethernet12", "primary_ip": "172.30.11.10/31"}]},
2797 "expected": {"result": AntaTestStatus.SUCCESS},
2798 },
2799 (VerifyInterfaceIPv4, "failure-interface-not-found"): {
2800 "eos_data": [{"interfaces": {"Ethernet10": {"interfaceAddress": {"primaryIp": {"address": "172.30.11.0", "maskLen": 31}, "secondaryIpsOrderedList": []}}}}],
2801 "inputs": {
2802 "interfaces": [
2803 {"name": "Ethernet2", "primary_ip": "172.30.11.0/31", "secondary_ips": ["10.10.10.0/31", "10.10.10.10/31"]},
2804 {"name": "Ethernet12", "primary_ip": "172.30.11.20/31", "secondary_ips": ["10.10.11.0/31", "10.10.11.10/31"]},
2805 ]
2806 },
2807 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Ethernet2 - Not found", "Interface: Ethernet12 - Not found"]},
2808 },
2809 (VerifyInterfaceIPv4, "failure-not-l3-interface"): {
2810 "eos_data": [{"interfaces": {"Ethernet2": {"interfaceAddress": {}}, "Ethernet12": {"interfaceAddress": {}}}}],
2811 "inputs": {
2812 "interfaces": [
2813 {"name": "Ethernet2", "primary_ip": "172.30.11.0/31", "secondary_ips": ["10.10.10.0/31", "10.10.10.10/31"]},
2814 {"name": "Ethernet12", "primary_ip": "172.30.11.20/31", "secondary_ips": ["10.10.11.0/31", "10.10.11.10/31"]},
2815 ]
2816 },
2817 "expected": {
2818 "result": AntaTestStatus.FAILURE,
2819 "messages": ["Interface: Ethernet2 - IP address is not configured", "Interface: Ethernet12 - IP address is not configured"],
2820 },
2821 },
2822 (VerifyInterfaceIPv4, "failure-ip-address-not-configured"): {
2823 "eos_data": [
2824 {
2825 "interfaces": {
2826 "Ethernet2": {"interfaceAddress": {"primaryIp": {"address": "0.0.0.0", "maskLen": 0}, "secondaryIpsOrderedList": []}},
2827 "Ethernet12": {"interfaceAddress": {"primaryIp": {"address": "0.0.0.0", "maskLen": 0}, "secondaryIpsOrderedList": []}},
2828 }
2829 }
2830 ],
2831 "inputs": {
2832 "interfaces": [
2833 {"name": "Ethernet2", "primary_ip": "172.30.11.0/31", "secondary_ips": ["10.10.10.0/31", "10.10.10.10/31"]},
2834 {"name": "Ethernet12", "primary_ip": "172.30.11.10/31", "secondary_ips": ["10.10.11.0/31", "10.10.11.10/31"]},
2835 ]
2836 },
2837 "expected": {
2838 "result": AntaTestStatus.FAILURE,
2839 "messages": [
2840 "Interface: Ethernet2 - IP address mismatch - Expected: 172.30.11.0/31 Actual: 0.0.0.0/0",
2841 "Interface: Ethernet2 - Secondary IP address is not configured",
2842 "Interface: Ethernet12 - IP address mismatch - Expected: 172.30.11.10/31 Actual: 0.0.0.0/0",
2843 "Interface: Ethernet12 - Secondary IP address is not configured",
2844 ],
2845 },
2846 },
2847 (VerifyInterfaceIPv4, "failure-ip-address-missmatch"): {
2848 "eos_data": [
2849 {
2850 "interfaces": {
2851 "Ethernet2": {
2852 "interfaceAddress": {
2853 "primaryIp": {"address": "172.30.11.0", "maskLen": 31},
2854 "secondaryIpsOrderedList": [{"address": "10.10.10.0", "maskLen": 31}, {"address": "10.10.10.10", "maskLen": 31}],
2855 }
2856 },
2857 "Ethernet3": {
2858 "interfaceAddress": {
2859 "primaryIp": {"address": "172.30.10.10", "maskLen": 31},
2860 "secondaryIpsOrderedList": [{"address": "10.10.11.0", "maskLen": 31}, {"address": "10.11.11.10", "maskLen": 31}],
2861 }
2862 },
2863 }
2864 }
2865 ],
2866 "inputs": {
2867 "interfaces": [
2868 {"name": "Ethernet2", "primary_ip": "172.30.11.2/31", "secondary_ips": ["10.10.10.20/31", "10.10.10.30/31"]},
2869 {"name": "Ethernet3", "primary_ip": "172.30.10.2/31", "secondary_ips": ["10.10.11.0/31", "10.10.11.10/31"]},
2870 ]
2871 },
2872 "expected": {
2873 "result": AntaTestStatus.FAILURE,
2874 "messages": [
2875 "Interface: Ethernet2 - IP address mismatch - Expected: 172.30.11.2/31 Actual: 172.30.11.0/31",
2876 "Interface: Ethernet2 - Secondary IP address mismatch - Expected: 10.10.10.20/31, 10.10.10.30/31 Actual: 10.10.10.0/31, 10.10.10.10/31",
2877 "Interface: Ethernet3 - IP address mismatch - Expected: 172.30.10.2/31 Actual: 172.30.10.10/31",
2878 "Interface: Ethernet3 - Secondary IP address mismatch - Expected: 10.10.11.0/31, 10.10.11.10/31 Actual: 10.10.11.0/31, 10.11.11.10/31",
2879 ],
2880 },
2881 },
2882 (VerifyInterfaceIPv4, "failure-secondary-ip-address"): {
2883 "eos_data": [
2884 {
2885 "interfaces": {
2886 "Ethernet2": {"interfaceAddress": {"primaryIp": {"address": "172.30.11.0", "maskLen": 31}, "secondaryIpsOrderedList": []}},
2887 "Ethernet3": {
2888 "interfaceAddress": {
2889 "primaryIp": {"address": "172.30.10.10", "maskLen": 31},
2890 "secondaryIpsOrderedList": [{"address": "10.10.11.0", "maskLen": 31}, {"address": "10.11.11.10", "maskLen": 31}],
2891 }
2892 },
2893 }
2894 }
2895 ],
2896 "inputs": {
2897 "interfaces": [
2898 {"name": "Ethernet2", "primary_ip": "172.30.11.2/31", "secondary_ips": ["10.10.10.20/31", "10.10.10.30/31"]},
2899 {"name": "Ethernet3", "primary_ip": "172.30.10.2/31", "secondary_ips": ["10.10.11.0/31", "10.10.11.10/31"]},
2900 ]
2901 },
2902 "expected": {
2903 "result": AntaTestStatus.FAILURE,
2904 "messages": [
2905 "Interface: Ethernet2 - IP address mismatch - Expected: 172.30.11.2/31 Actual: 172.30.11.0/31",
2906 "Interface: Ethernet2 - Secondary IP address is not configured",
2907 "Interface: Ethernet3 - IP address mismatch - Expected: 172.30.10.2/31 Actual: 172.30.10.10/31",
2908 "Interface: Ethernet3 - Secondary IP address mismatch - Expected: 10.10.11.0/31, 10.10.11.10/31 Actual: 10.10.11.0/31, 10.11.11.10/31",
2909 ],
2910 },
2911 },
2912 (VerifyIpVirtualRouterMac, "success"): {
2913 "eos_data": [{"virtualMacs": [{"macAddress": "00:1c:73:00:dc:01"}]}],
2914 "inputs": {"mac_address": "00:1c:73:00:dc:01"},
2915 "expected": {"result": AntaTestStatus.SUCCESS},
2916 },
2917 (VerifyIpVirtualRouterMac, "faliure-incorrect-mac-address"): {
2918 "eos_data": [{"virtualMacs": [{"macAddress": "00:00:00:00:00:00"}]}],
2919 "inputs": {"mac_address": "00:1c:73:00:dc:01"},
2920 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["IP virtual router MAC address: 00:1c:73:00:dc:01 - Not configured"]},
2921 },
2922 (VerifyInterfacesSpeed, "success"): {
2923 "eos_data": [
2924 {
2925 "interfaces": {
2926 "Ethernet1": {"bandwidth": 1000000000, "autoNegotiate": "unknown", "duplex": "duplexFull", "lanes": 2},
2927 "Ethernet1/1/2": {"bandwidth": 1000000000, "autoNegotiate": "unknown", "duplex": "duplexFull", "lanes": 2},
2928 "Ethernet3": {"bandwidth": 100000000000, "autoNegotiate": "success", "duplex": "duplexFull", "lanes": 8},
2929 "Ethernet4": {"bandwidth": 2500000000, "autoNegotiate": "unknown", "duplex": "duplexFull", "lanes": 8},
2930 }
2931 }
2932 ],
2933 "inputs": {
2934 "interfaces": [
2935 {"name": "Ethernet1", "auto": False, "speed": 1},
2936 {"name": "Ethernet1", "auto": False, "speed": 1, "lanes": 2},
2937 {"name": "Ethernet1/1/2", "auto": False, "speed": 1},
2938 {"name": "Ethernet3", "auto": True, "speed": 100},
2939 {"name": "Ethernet3", "auto": True, "speed": 100, "lanes": 8},
2940 {"name": "Ethernet3", "auto": True, "speed": 100},
2941 {"name": "Ethernet4", "auto": False, "speed": 2.5},
2942 ]
2943 },
2944 "expected": {"result": AntaTestStatus.SUCCESS},
2945 },
2946 (VerifyInterfacesSpeed, "failure-incorrect-speed"): {
2947 "eos_data": [
2948 {
2949 "interfaces": {
2950 "Ethernet1": {"bandwidth": 100000000000, "autoNegotiate": "unknown", "duplex": "duplexFull", "lanes": 2},
2951 "Ethernet1/1/1": {"bandwidth": 100000000000, "autoNegotiate": "unknown", "duplex": "duplexFull", "lanes": 2},
2952 "Ethernet3": {"bandwidth": 10000000000, "autoNegotiate": "success", "duplex": "duplexFull", "lanes": 8},
2953 "Ethernet4": {"bandwidth": 25000000000, "autoNegotiate": "unknown", "duplex": "duplexFull", "lanes": 8},
2954 }
2955 }
2956 ],
2957 "inputs": {
2958 "interfaces": [
2959 {"name": "Ethernet1", "auto": False, "speed": 1},
2960 {"name": "Ethernet1/1/1", "auto": False, "speed": 1},
2961 {"name": "Ethernet3", "auto": True, "speed": 100},
2962 {"name": "Ethernet4", "auto": False, "speed": 2.5},
2963 ]
2964 },
2965 "expected": {
2966 "result": AntaTestStatus.FAILURE,
2967 "messages": [
2968 "Interface: Ethernet1 - Bandwidth mismatch - Expected: 1.0Gbps Actual: 100Gbps",
2969 "Interface: Ethernet1/1/1 - Bandwidth mismatch - Expected: 1.0Gbps Actual: 100Gbps",
2970 "Interface: Ethernet3 - Bandwidth mismatch - Expected: 100.0Gbps Actual: 10Gbps",
2971 "Interface: Ethernet4 - Bandwidth mismatch - Expected: 2.5Gbps Actual: 25Gbps",
2972 ],
2973 },
2974 },
2975 (VerifyInterfacesSpeed, "failure-incorrect-mode"): {
2976 "eos_data": [
2977 {
2978 "interfaces": {
2979 "Ethernet1": {"bandwidth": 1000000000, "autoNegotiate": "unknown", "duplex": "duplexHalf", "lanes": 2},
2980 "Ethernet1/2/2": {"bandwidth": 1000000000, "autoNegotiate": "unknown", "duplex": "duplexHalf", "lanes": 2},
2981 "Ethernet3": {"bandwidth": 100000000000, "autoNegotiate": "success", "duplex": "duplexHalf", "lanes": 8},
2982 "Ethernet4": {"bandwidth": 2500000000, "autoNegotiate": "unknown", "duplex": "duplexHalf", "lanes": 8},
2983 }
2984 }
2985 ],
2986 "inputs": {
2987 "interfaces": [
2988 {"name": "Ethernet1", "auto": False, "speed": 1},
2989 {"name": "Ethernet1/2/2", "auto": False, "speed": 1},
2990 {"name": "Ethernet3", "auto": True, "speed": 100},
2991 {"name": "Ethernet3", "auto": True, "speed": 100, "lanes": 8},
2992 {"name": "Ethernet4", "auto": False, "speed": 2.5},
2993 ]
2994 },
2995 "expected": {
2996 "result": AntaTestStatus.FAILURE,
2997 "messages": [
2998 "Interface: Ethernet1 - Duplex mode mismatch - Expected: duplexFull Actual: duplexHalf",
2999 "Interface: Ethernet1/2/2 - Duplex mode mismatch - Expected: duplexFull Actual: duplexHalf",
3000 "Interface: Ethernet3 - Duplex mode mismatch - Expected: duplexFull Actual: duplexHalf",
3001 "Interface: Ethernet3 - Duplex mode mismatch - Expected: duplexFull Actual: duplexHalf",
3002 "Interface: Ethernet4 - Duplex mode mismatch - Expected: duplexFull Actual: duplexHalf",
3003 ],
3004 },
3005 },
3006 (VerifyInterfacesSpeed, "failure-incorrect-lane"): {
3007 "eos_data": [
3008 {
3009 "interfaces": {
3010 "Ethernet1": {"bandwidth": 1000000000, "autoNegotiate": "unknown", "duplex": "duplexFull", "lanes": 4},
3011 "Ethernet2": {"bandwidth": 10000000000, "autoNegotiate": "unknown", "duplex": "duplexFull", "lanes": 4},
3012 "Ethernet3": {"bandwidth": 100000000000, "autoNegotiate": "success", "duplex": "duplexFull", "lanes": 4},
3013 "Ethernet4": {"bandwidth": 2500000000, "autoNegotiate": "unknown", "duplex": "duplexFull", "lanes": 6},
3014 "Ethernet4/1/1": {"bandwidth": 2500000000, "autoNegotiate": "unknown", "duplex": "duplexFull", "lanes": 6},
3015 }
3016 }
3017 ],
3018 "inputs": {
3019 "interfaces": [
3020 {"name": "Ethernet1", "auto": False, "speed": 1, "lanes": 2},
3021 {"name": "Ethernet3", "auto": True, "speed": 100, "lanes": 8},
3022 {"name": "Ethernet4", "auto": False, "speed": 2.5, "lanes": 4},
3023 {"name": "Ethernet4/1/1", "auto": False, "speed": 2.5, "lanes": 4},
3024 ]
3025 },
3026 "expected": {
3027 "result": AntaTestStatus.FAILURE,
3028 "messages": [
3029 "Interface: Ethernet1 - Data lanes count mismatch - Expected: 2 Actual: 4",
3030 "Interface: Ethernet3 - Data lanes count mismatch - Expected: 8 Actual: 4",
3031 "Interface: Ethernet4 - Data lanes count mismatch - Expected: 4 Actual: 6",
3032 "Interface: Ethernet4/1/1 - Data lanes count mismatch - Expected: 4 Actual: 6",
3033 ],
3034 },
3035 },
3036 (VerifyInterfacesSpeed, "failure-all-type"): {
3037 "eos_data": [
3038 {
3039 "interfaces": {
3040 "Ethernet1": {"bandwidth": 10000000000, "autoNegotiate": "unknown", "duplex": "duplexHalf", "lanes": 4},
3041 "Ethernet2/1/2": {"bandwidth": 1000000000, "autoNegotiate": "unknown", "duplex": "duplexHalf", "lanes": 2},
3042 "Ethernet3": {"bandwidth": 10000000000, "autoNegotiate": "unknown", "duplex": "duplexHalf", "lanes": 6},
3043 "Ethernet4": {"bandwidth": 25000000000, "autoNegotiate": "unknown", "duplex": "duplexHalf", "lanes": 4},
3044 }
3045 }
3046 ],
3047 "inputs": {
3048 "interfaces": [
3049 {"name": "Ethernet1", "auto": False, "speed": 1, "lanes": 2},
3050 {"name": "Ethernet2/1/2", "auto": False, "speed": 10},
3051 {"name": "Ethernet3", "auto": True, "speed": 100, "lanes": 8},
3052 {"name": "Ethernet4", "auto": False, "speed": 2.5},
3053 ]
3054 },
3055 "expected": {
3056 "result": AntaTestStatus.FAILURE,
3057 "messages": [
3058 "Interface: Ethernet1 - Bandwidth mismatch - Expected: 1.0Gbps Actual: 10Gbps",
3059 "Interface: Ethernet1 - Duplex mode mismatch - Expected: duplexFull Actual: duplexHalf",
3060 "Interface: Ethernet1 - Data lanes count mismatch - Expected: 2 Actual: 4",
3061 "Interface: Ethernet2/1/2 - Bandwidth mismatch - Expected: 10.0Gbps Actual: 1Gbps",
3062 "Interface: Ethernet2/1/2 - Duplex mode mismatch - Expected: duplexFull Actual: duplexHalf",
3063 "Interface: Ethernet3 - Bandwidth mismatch - Expected: 100.0Gbps Actual: 10Gbps",
3064 "Interface: Ethernet3 - Duplex mode mismatch - Expected: duplexFull Actual: duplexHalf",
3065 "Interface: Ethernet3 - Auto-negotiation mismatch - Expected: success Actual: unknown",
3066 "Interface: Ethernet3 - Data lanes count mismatch - Expected: 8 Actual: 6",
3067 "Interface: Ethernet4 - Bandwidth mismatch - Expected: 2.5Gbps Actual: 25Gbps",
3068 "Interface: Ethernet4 - Duplex mode mismatch - Expected: duplexFull Actual: duplexHalf",
3069 ],
3070 },
3071 },
3072 (VerifyLACPInterfacesStatus, "success"): {
3073 "eos_data": [
3074 {
3075 "portChannels": {
3076 "Port-Channel5": {
3077 "interfaces": {
3078 "Ethernet5": {
3079 "actorPortStatus": "bundled",
3080 "partnerPortState": {
3081 "activity": True,
3082 "timeout": False,
3083 "aggregation": True,
3084 "synchronization": True,
3085 "collecting": True,
3086 "distributing": True,
3087 },
3088 "actorPortState": {
3089 "activity": True,
3090 "timeout": False,
3091 "aggregation": True,
3092 "synchronization": True,
3093 "collecting": True,
3094 "distributing": True,
3095 },
3096 "details": {"partnerChurnState": "noChurn", "actorChurnState": "noChurn"},
3097 }
3098 }
3099 }
3100 },
3101 "orphanPorts": {},
3102 }
3103 ],
3104 "inputs": {"interfaces": [{"name": "Ethernet5", "portchannel": "Port-Channel5"}]},
3105 "expected": {"result": AntaTestStatus.SUCCESS},
3106 },
3107 (VerifyLACPInterfacesStatus, "success-validate-churn-state"): {
3108 "eos_data": [
3109 {
3110 "portChannels": {
3111 "Port-Channel5": {
3112 "interfaces": {
3113 "Ethernet5": {
3114 "actorPortStatus": "bundled",
3115 "partnerPortState": {
3116 "activity": True,
3117 "timeout": False,
3118 "aggregation": True,
3119 "synchronization": True,
3120 "collecting": True,
3121 "distributing": True,
3122 },
3123 "actorPortState": {
3124 "activity": True,
3125 "timeout": False,
3126 "aggregation": True,
3127 "synchronization": True,
3128 "collecting": True,
3129 "distributing": True,
3130 },
3131 "details": {"partnerChurnState": "noChurn", "actorChurnState": "noChurn"},
3132 }
3133 }
3134 }
3135 },
3136 "orphanPorts": {},
3137 }
3138 ],
3139 "inputs": {"interfaces": [{"name": "Ethernet5", "portchannel": "Port-Channel5", "lacp_churn_state": True}]},
3140 "expected": {"result": AntaTestStatus.SUCCESS},
3141 },
3142 (VerifyLACPInterfacesStatus, "success-short-timeout"): {
3143 "eos_data": [
3144 {
3145 "portChannels": {
3146 "Port-Channel5": {
3147 "interfaces": {
3148 "Ethernet5": {
3149 "actorPortStatus": "bundled",
3150 "partnerPortState": {
3151 "activity": True,
3152 "timeout": True,
3153 "aggregation": True,
3154 "synchronization": True,
3155 "collecting": True,
3156 "distributing": True,
3157 },
3158 "actorPortState": {
3159 "activity": True,
3160 "timeout": True,
3161 "aggregation": True,
3162 "synchronization": True,
3163 "collecting": True,
3164 "distributing": True,
3165 },
3166 "details": {"partnerChurnState": "noChurn", "actorChurnState": "noChurn"},
3167 }
3168 }
3169 }
3170 },
3171 "orphanPorts": {},
3172 }
3173 ],
3174 "inputs": {"interfaces": [{"name": "Ethernet5", "portchannel": "Port-Channel5", "lacp_rate_fast": True}]},
3175 "expected": {"result": AntaTestStatus.SUCCESS},
3176 },
3177 (VerifyLACPInterfacesStatus, "failure-not-bundled"): {
3178 "eos_data": [
3179 {
3180 "portChannels": {
3181 "Port-Channel5": {
3182 "interfaces": {
3183 "Ethernet5": {
3184 "actorPortStatus": "negotiation",
3185 "partnerPortState": {
3186 "activity": True,
3187 "timeout": False,
3188 "aggregation": True,
3189 "synchronization": False,
3190 "collecting": True,
3191 "distributing": True,
3192 "defaulted": False,
3193 "expired": False,
3194 },
3195 "actorPortState": {
3196 "activity": True,
3197 "timeout": False,
3198 "aggregation": True,
3199 "synchronization": True,
3200 "collecting": False,
3201 "distributing": False,
3202 "defaulted": False,
3203 "expired": False,
3204 },
3205 "details": {"partnerChurnState": "churnMonitor", "actorChurnState": "noChurn"},
3206 }
3207 }
3208 }
3209 },
3210 "orphanPorts": {},
3211 }
3212 ],
3213 "inputs": {"interfaces": [{"name": "Ethernet5", "portchannel": "Po5"}]},
3214 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Ethernet5 Port-Channel: Port-Channel5 - Not bundled - Port Status: negotiation"]},
3215 },
3216 (VerifyLACPInterfacesStatus, "failure-no-details-found"): {
3217 "eos_data": [{"portChannels": {"Port-Channel5": {"interfaces": {}}}}],
3218 "inputs": {"interfaces": [{"name": "Ethernet5", "portchannel": "Po 5"}]},
3219 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Ethernet5 Port-Channel: Port-Channel5 - Not configured"]},
3220 },
3221 (VerifyLACPInterfacesStatus, "failure-lacp-params"): {
3222 "eos_data": [
3223 {
3224 "portChannels": {
3225 "Port-Channel5": {
3226 "interfaces": {
3227 "Ethernet5": {
3228 "actorPortStatus": "bundled",
3229 "partnerPortState": {
3230 "activity": False,
3231 "timeout": False,
3232 "aggregation": False,
3233 "synchronization": False,
3234 "collecting": True,
3235 "distributing": True,
3236 },
3237 "actorPortState": {
3238 "activity": False,
3239 "timeout": False,
3240 "aggregation": False,
3241 "synchronization": False,
3242 "collecting": True,
3243 "distributing": True,
3244 },
3245 "details": {"partnerChurnState": "noChurn", "actorChurnState": "noChurn"},
3246 }
3247 }
3248 }
3249 },
3250 "orphanPorts": {},
3251 }
3252 ],
3253 "inputs": {"interfaces": [{"name": "Ethernet5", "portchannel": "port-channel 5"}]},
3254 "expected": {
3255 "result": AntaTestStatus.FAILURE,
3256 "messages": [
3257 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Actor port activity state mismatch - Expected: True Actual: False",
3258 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Actor port aggregation state mismatch - Expected: True Actual: False",
3259 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Actor port synchronization state mismatch - Expected: True Actual: False",
3260 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Partner port activity state mismatch - Expected: True Actual: False",
3261 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Partner port aggregation state mismatch - Expected: True Actual: False",
3262 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Partner port synchronization state mismatch - Expected: True Actual: False",
3263 ],
3264 },
3265 },
3266 (VerifyLACPInterfacesStatus, "failure-short-timeout"): {
3267 "eos_data": [
3268 {
3269 "portChannels": {
3270 "Port-Channel5": {
3271 "interfaces": {
3272 "Ethernet5": {
3273 "actorPortStatus": "bundled",
3274 "partnerPortState": {
3275 "activity": True,
3276 "timeout": False,
3277 "aggregation": True,
3278 "synchronization": True,
3279 "collecting": True,
3280 "distributing": True,
3281 },
3282 "actorPortState": {
3283 "activity": True,
3284 "timeout": False,
3285 "aggregation": True,
3286 "synchronization": True,
3287 "collecting": True,
3288 "distributing": True,
3289 },
3290 "details": {"partnerChurnState": "noChurn", "actorChurnState": "noChurn"},
3291 }
3292 }
3293 }
3294 },
3295 "orphanPorts": {},
3296 }
3297 ],
3298 "inputs": {"interfaces": [{"name": "Ethernet5", "portchannel": "port-channel 5", "lacp_rate_fast": True}]},
3299 "expected": {
3300 "result": AntaTestStatus.FAILURE,
3301 "messages": [
3302 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Actor port timeout state mismatch - Expected: True Actual: False",
3303 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Partner port timeout state mismatch - Expected: True Actual: False",
3304 ],
3305 },
3306 },
3307 (VerifyLACPInterfacesStatus, "failure-validate-churn-state"): {
3308 "eos_data": [
3309 {
3310 "portChannels": {
3311 "Port-Channel5": {
3312 "interfaces": {
3313 "Ethernet5": {
3314 "actorPortStatus": "bundled",
3315 "partnerPortState": {
3316 "activity": True,
3317 "timeout": True,
3318 "aggregation": True,
3319 "synchronization": True,
3320 "collecting": True,
3321 "distributing": True,
3322 },
3323 "actorPortState": {
3324 "activity": True,
3325 "timeout": True,
3326 "aggregation": True,
3327 "synchronization": True,
3328 "collecting": False,
3329 "distributing": False,
3330 },
3331 "details": {"partnerChurnState": "churnDetected", "actorChurnState": "churnDetected"},
3332 }
3333 }
3334 }
3335 },
3336 "orphanPorts": {},
3337 }
3338 ],
3339 "inputs": {"interfaces": [{"name": "Ethernet5", "portchannel": "Port-Channel5", "lacp_churn_state": False}]},
3340 "expected": {
3341 "result": AntaTestStatus.FAILURE,
3342 "messages": [
3343 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Actor port collecting state mismatch - Expected: True Actual: False",
3344 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Actor port distributing state mismatch - Expected: True Actual: False",
3345 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Actor port timeout state mismatch - Expected: False Actual: True",
3346 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Partner port timeout state mismatch - Expected: False Actual: True",
3347 ],
3348 },
3349 },
3350 (VerifyLACPInterfacesStatus, "failure-validate-actor-churn-state"): {
3351 "eos_data": [
3352 {
3353 "portChannels": {
3354 "Port-Channel5": {
3355 "interfaces": {
3356 "Ethernet5": {
3357 "actorPortStatus": "bundled",
3358 "partnerPortState": {
3359 "activity": True,
3360 "timeout": False,
3361 "aggregation": True,
3362 "synchronization": True,
3363 "collecting": True,
3364 "distributing": True,
3365 },
3366 "actorPortState": {
3367 "activity": True,
3368 "timeout": False,
3369 "aggregation": True,
3370 "synchronization": True,
3371 "collecting": False,
3372 "distributing": False,
3373 },
3374 "details": {"partnerChurnState": "noChurn", "actorChurnState": "churnDetected"},
3375 }
3376 }
3377 }
3378 },
3379 "orphanPorts": {},
3380 }
3381 ],
3382 "inputs": {"interfaces": [{"name": "Ethernet5", "portchannel": "Port-Channel5", "lacp_churn_state": True}]},
3383 "expected": {
3384 "result": AntaTestStatus.FAILURE,
3385 "messages": [
3386 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Actor port collecting state mismatch - Expected: True Actual: False",
3387 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Actor port distributing state mismatch - Expected: True Actual: False",
3388 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Churn detected (mismatch system ID)",
3389 ],
3390 },
3391 },
3392 (VerifyLACPInterfacesStatus, "failure-validate-partner-churn-state"): {
3393 "eos_data": [
3394 {
3395 "portChannels": {
3396 "Port-Channel5": {
3397 "interfaces": {
3398 "Ethernet5": {
3399 "actorPortStatus": "bundled",
3400 "partnerPortState": {
3401 "activity": True,
3402 "timeout": False,
3403 "aggregation": True,
3404 "synchronization": True,
3405 "collecting": True,
3406 "distributing": True,
3407 },
3408 "actorPortState": {
3409 "activity": True,
3410 "timeout": False,
3411 "aggregation": True,
3412 "synchronization": True,
3413 "collecting": False,
3414 "distributing": False,
3415 },
3416 "details": {"partnerChurnState": "churnDetected", "actorChurnState": "noChurn"},
3417 }
3418 }
3419 }
3420 },
3421 "orphanPorts": {},
3422 }
3423 ],
3424 "inputs": {"interfaces": [{"name": "Ethernet5", "portchannel": "Port-Channel5", "lacp_churn_state": True}]},
3425 "expected": {
3426 "result": AntaTestStatus.FAILURE,
3427 "messages": [
3428 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Actor port collecting state mismatch - Expected: True Actual: False",
3429 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Actor port distributing state mismatch - Expected: True Actual: False",
3430 "Interface: Ethernet5 Port-Channel: Port-Channel5 - Churn detected (mismatch system ID)",
3431 ],
3432 },
3433 },
3434 (VerifyInterfacesVoqAndEgressQueueDrops, "success"): {
3435 "eos_data": [
3436 {
3437 "interfaces": {
3438 "Ethernet48": {
3439 "trafficClasses": {
3440 "TC0": {
3441 "ingressVoqCounters": {
3442 "countersSum": {
3443 "droppedPackets": 0,
3444 },
3445 },
3446 "egressQueueCounters": {
3447 "countersSum": {
3448 "droppedPackets": 0,
3449 },
3450 },
3451 },
3452 "TC1": {
3453 "ingressVoqCounters": {
3454 "countersSum": {
3455 "droppedPackets": 0,
3456 },
3457 },
3458 "egressQueueCounters": {
3459 "countersSum": {
3460 "droppedPackets": 0,
3461 },
3462 },
3463 },
3464 }
3465 },
3466 "Ethernet49": {
3467 "trafficClasses": {
3468 "TC0": {
3469 "ingressVoqCounters": {
3470 "countersSum": {
3471 "droppedPackets": 0,
3472 },
3473 },
3474 "egressQueueCounters": {
3475 "countersSum": {
3476 "droppedPackets": 0,
3477 },
3478 },
3479 },
3480 "TC1": {
3481 "ingressVoqCounters": {
3482 "countersSum": {
3483 "droppedPackets": 0,
3484 },
3485 },
3486 "egressQueueCounters": {
3487 "countersSum": {
3488 "droppedPackets": 0,
3489 },
3490 },
3491 },
3492 }
3493 },
3494 }
3495 }
3496 ],
3497 "expected": {"result": AntaTestStatus.SUCCESS},
3498 },
3499 (VerifyInterfacesVoqAndEgressQueueDrops, "success-range-of-traffic-class"): {
3500 "eos_data": [
3501 {
3502 "interfaces": {
3503 "Ethernet48": {
3504 "trafficClasses": {
3505 "TC0-5": {
3506 "ingressVoqCounters": {
3507 "countersSum": {
3508 "droppedPackets": 0,
3509 },
3510 },
3511 "egressQueueCounters": {
3512 "countersSum": {
3513 "droppedPackets": 0,
3514 },
3515 },
3516 },
3517 }
3518 },
3519 "Ethernet49": {
3520 "trafficClasses": {
3521 "TC0-5": {
3522 "ingressVoqCounters": {
3523 "countersSum": {
3524 "droppedPackets": 0,
3525 },
3526 },
3527 "egressQueueCounters": {
3528 "countersSum": {
3529 "droppedPackets": 0,
3530 },
3531 },
3532 },
3533 }
3534 },
3535 }
3536 }
3537 ],
3538 "inputs": {"interfaces": ["Ethernet48", "Ethernet49"], "traffic_classes": ["TC0", "TC1", "TC2", "TC3", "TC4", "TC5"]},
3539 "expected": {"result": AntaTestStatus.SUCCESS},
3540 },
3541 (VerifyInterfacesVoqAndEgressQueueDrops, "success-specific-intf"): {
3542 "eos_data": [
3543 {
3544 "interfaces": {
3545 "Ethernet48": {
3546 "trafficClasses": {
3547 "TC0": {
3548 "ingressVoqCounters": {
3549 "countersSum": {
3550 "droppedPackets": 0,
3551 },
3552 },
3553 "egressQueueCounters": {
3554 "countersSum": {
3555 "droppedPackets": 0,
3556 },
3557 },
3558 },
3559 "TC1": {
3560 "ingressVoqCounters": {
3561 "countersSum": {
3562 "droppedPackets": 0,
3563 },
3564 },
3565 "egressQueueCounters": {
3566 "countersSum": {
3567 "droppedPackets": 0,
3568 },
3569 },
3570 },
3571 }
3572 },
3573 "Ethernet49": {
3574 "trafficClasses": {
3575 "TC0": {
3576 "ingressVoqCounters": {
3577 "countersSum": {
3578 "droppedPackets": 5,
3579 },
3580 },
3581 "egressQueueCounters": {
3582 "countersSum": {
3583 "droppedPackets": 5,
3584 },
3585 },
3586 },
3587 "TC1": {
3588 "ingressVoqCounters": {
3589 "countersSum": {
3590 "droppedPackets": 5,
3591 },
3592 },
3593 "egressQueueCounters": {
3594 "countersSum": {
3595 "droppedPackets": 5,
3596 },
3597 },
3598 },
3599 }
3600 },
3601 }
3602 }
3603 ],
3604 "inputs": {"interfaces": ["Ethernet48"]},
3605 "expected": {"result": AntaTestStatus.SUCCESS},
3606 },
3607 (VerifyInterfacesVoqAndEgressQueueDrops, "success-all-intf-specific-traffic-class"): {
3608 "eos_data": [
3609 {
3610 "interfaces": {
3611 "Ethernet48": {
3612 "trafficClasses": {
3613 "TC0": {
3614 "ingressVoqCounters": {
3615 "countersSum": {
3616 "droppedPackets": 0,
3617 },
3618 },
3619 "egressQueueCounters": {
3620 "countersSum": {
3621 "droppedPackets": 0,
3622 },
3623 },
3624 },
3625 "TC1": {
3626 "ingressVoqCounters": {
3627 "countersSum": {
3628 "droppedPackets": 4,
3629 },
3630 },
3631 "egressQueueCounters": {
3632 "countersSum": {
3633 "droppedPackets": 5,
3634 },
3635 },
3636 },
3637 }
3638 },
3639 "Ethernet49": {
3640 "trafficClasses": {
3641 "TC0": {
3642 "ingressVoqCounters": {
3643 "countersSum": {
3644 "droppedPackets": 0,
3645 },
3646 },
3647 "egressQueueCounters": {
3648 "countersSum": {
3649 "droppedPackets": 0,
3650 },
3651 },
3652 },
3653 "TC1": {
3654 "ingressVoqCounters": {
3655 "countersSum": {
3656 "droppedPackets": 5,
3657 },
3658 },
3659 "egressQueueCounters": {
3660 "countersSum": {
3661 "droppedPackets": 4,
3662 },
3663 },
3664 },
3665 }
3666 },
3667 }
3668 }
3669 ],
3670 "inputs": {"traffic_classes": ["TC0"]},
3671 "expected": {"result": AntaTestStatus.SUCCESS},
3672 },
3673 (VerifyInterfacesVoqAndEgressQueueDrops, "success-specific-intf-specific-traffic-class"): {
3674 "eos_data": [
3675 {
3676 "interfaces": {
3677 "Ethernet48": {
3678 "trafficClasses": {
3679 "TC0": {
3680 "ingressVoqCounters": {
3681 "countersSum": {
3682 "droppedPackets": 0,
3683 },
3684 },
3685 "egressQueueCounters": {
3686 "countersSum": {
3687 "droppedPackets": 0,
3688 },
3689 },
3690 },
3691 "TC1": {
3692 "ingressVoqCounters": {
3693 "countersSum": {
3694 "droppedPackets": 4,
3695 },
3696 },
3697 "egressQueueCounters": {
3698 "countersSum": {
3699 "droppedPackets": 5,
3700 },
3701 },
3702 },
3703 }
3704 },
3705 "Ethernet49": {
3706 "trafficClasses": {
3707 "TC0": {
3708 "ingressVoqCounters": {
3709 "countersSum": {
3710 "droppedPackets": 5,
3711 },
3712 },
3713 "egressQueueCounters": {
3714 "countersSum": {
3715 "droppedPackets": 6,
3716 },
3717 },
3718 },
3719 "TC1": {
3720 "ingressVoqCounters": {
3721 "countersSum": {
3722 "droppedPackets": 5,
3723 },
3724 },
3725 "egressQueueCounters": {
3726 "countersSum": {
3727 "droppedPackets": 4,
3728 },
3729 },
3730 },
3731 }
3732 },
3733 }
3734 }
3735 ],
3736 "inputs": {"interfaces": ["Ethernet48"], "traffic_classes": ["TC0"]},
3737 "expected": {"result": AntaTestStatus.SUCCESS},
3738 },
3739 (VerifyInterfacesVoqAndEgressQueueDrops, "failure"): {
3740 "eos_data": [
3741 {
3742 "interfaces": {
3743 "Ethernet48": {
3744 "trafficClasses": {
3745 "TC0": {
3746 "ingressVoqCounters": {
3747 "countersSum": {
3748 "droppedPackets": 3,
3749 },
3750 },
3751 "egressQueueCounters": {
3752 "countersSum": {
3753 "droppedPackets": 0,
3754 },
3755 },
3756 },
3757 "TC1": {
3758 "ingressVoqCounters": {
3759 "countersSum": {
3760 "droppedPackets": 4,
3761 },
3762 },
3763 "egressQueueCounters": {
3764 "countersSum": {
3765 "droppedPackets": 5,
3766 },
3767 },
3768 },
3769 }
3770 },
3771 "Ethernet49": {
3772 "trafficClasses": {
3773 "TC0": {
3774 "ingressVoqCounters": {
3775 "countersSum": {
3776 "droppedPackets": 5,
3777 },
3778 },
3779 "egressQueueCounters": {
3780 "countersSum": {
3781 "droppedPackets": 6,
3782 },
3783 },
3784 },
3785 "TC1": {
3786 "ingressVoqCounters": {
3787 "countersSum": {
3788 "droppedPackets": 7,
3789 },
3790 },
3791 "egressQueueCounters": {
3792 "countersSum": {
3793 "droppedPackets": 7,
3794 },
3795 },
3796 },
3797 }
3798 },
3799 }
3800 }
3801 ],
3802 "expected": {
3803 "result": AntaTestStatus.FAILURE,
3804 "messages": [
3805 "Interface: Ethernet48 Traffic Class: TC0 - Queue drops above threshold - Expected: <= 0 Actual VOQ: 3 Actual Egress: 0",
3806 "Interface: Ethernet48 Traffic Class: TC1 - Queue drops above threshold - Expected: <= 0 Actual VOQ: 4 Actual Egress: 5",
3807 "Interface: Ethernet49 Traffic Class: TC0 - Queue drops above threshold - Expected: <= 0 Actual VOQ: 5 Actual Egress: 6",
3808 "Interface: Ethernet49 Traffic Class: TC1 - Queue drops above threshold - Expected: <= 0 Actual VOQ: 7 Actual Egress: 7",
3809 ],
3810 },
3811 },
3812 (VerifyInterfacesVoqAndEgressQueueDrops, "failure-intf-not-found"): {
3813 "eos_data": [{"interfaces": {}}],
3814 "inputs": {"interfaces": ["Ethernet48"]},
3815 "expected": {
3816 "result": AntaTestStatus.FAILURE,
3817 "messages": [
3818 "Interface: Ethernet48 - Not found",
3819 ],
3820 },
3821 },
3822 (VerifyInterfacesVoqAndEgressQueueDrops, "failure-traffic-class-not-found"): {
3823 "eos_data": [
3824 {
3825 "interfaces": {
3826 "Ethernet48": {
3827 "trafficClasses": {
3828 "TC0": {
3829 "ingressVoqCounters": {
3830 "countersSum": {
3831 "droppedPackets": 3,
3832 },
3833 },
3834 "egressQueueCounters": {
3835 "countersSum": {
3836 "droppedPackets": 0,
3837 },
3838 },
3839 },
3840 }
3841 }
3842 }
3843 }
3844 ],
3845 "inputs": {"traffic_classes": ["TC1"]},
3846 "expected": {
3847 "result": AntaTestStatus.FAILURE,
3848 "messages": [
3849 "Interface: Ethernet48 Traffic Class: TC1 - Not found",
3850 ],
3851 },
3852 },
3853 (VerifyInterfacesVoqAndEgressQueueDrops, "failure-range-of-traffic-class"): {
3854 "eos_data": [
3855 {
3856 "interfaces": {
3857 "Ethernet48": {
3858 "trafficClasses": {
3859 "TC0-5": {
3860 "ingressVoqCounters": {
3861 "countersSum": {
3862 "droppedPackets": 1,
3863 },
3864 },
3865 "egressQueueCounters": {
3866 "countersSum": {
3867 "droppedPackets": 0,
3868 },
3869 },
3870 },
3871 }
3872 },
3873 "Ethernet49": {
3874 "trafficClasses": {
3875 "TC0-5": {
3876 "ingressVoqCounters": {
3877 "countersSum": {
3878 "droppedPackets": 1,
3879 },
3880 },
3881 "egressQueueCounters": {
3882 "countersSum": {
3883 "droppedPackets": 2,
3884 },
3885 },
3886 },
3887 }
3888 },
3889 }
3890 }
3891 ],
3892 "inputs": {"interfaces": ["Ethernet48", "Ethernet49"], "traffic_classes": ["TC0", "TC1", "TC2"]},
3893 "expected": {
3894 "result": AntaTestStatus.FAILURE,
3895 "messages": [
3896 "Interface: Ethernet48 Traffic Class: TC0 - Queue drops above threshold - Expected: <= 0 Actual VOQ: 1 Actual Egress: 0",
3897 "Interface: Ethernet48 Traffic Class: TC1 - Queue drops above threshold - Expected: <= 0 Actual VOQ: 1 Actual Egress: 0",
3898 "Interface: Ethernet48 Traffic Class: TC2 - Queue drops above threshold - Expected: <= 0 Actual VOQ: 1 Actual Egress: 0",
3899 "Interface: Ethernet49 Traffic Class: TC0 - Queue drops above threshold - Expected: <= 0 Actual VOQ: 1 Actual Egress: 2",
3900 "Interface: Ethernet49 Traffic Class: TC1 - Queue drops above threshold - Expected: <= 0 Actual VOQ: 1 Actual Egress: 2",
3901 "Interface: Ethernet49 Traffic Class: TC2 - Queue drops above threshold - Expected: <= 0 Actual VOQ: 1 Actual Egress: 2",
3902 ],
3903 },
3904 },
3905 (VerifyInterfacesTridentCounters, "success"): {
3906 "eos_data": [
3907 {
3908 "ethernet": {
3909 "Ethernet48": {
3910 "count": {
3911 "drop": {
3912 "nonCongestionDiscard": 0,
3913 "ipv4L3Discard": 0,
3914 "ipv6L3Discard": 0,
3915 "rxUrpfDrop": 0,
3916 "rxFpDrop": 0,
3917 "rxMmuDrop": 0,
3918 "rxPipelineDrop": 0,
3919 "txMmuDrop": 0,
3920 "txPipelineDrop": 0,
3921 "rxMCDrop": 0,
3922 "rxIngressNFDrop": 0,
3923 "rxBufferPoolDiscard": 0,
3924 "rxPolicyDiscard": 0,
3925 "txL3UCAgedDrop": 0,
3926 "txL2MCDrop": 0,
3927 "txTTLDrop": 0,
3928 "wredDropPktCounter": 0,
3929 },
3930 "error": {
3931 "txMACError": 0,
3932 "txL2MTUError": 0,
3933 "ipv4L3HeaderError": 0,
3934 "ipv6L3HeaderError": 0,
3935 "rxVlanDrop": 0,
3936 "rxTunnelError": 0,
3937 "rxL2MTUError": 0,
3938 "txUnknownDrop": 0,
3939 "txInvalidVlan": 0,
3940 "txSplitHorizonDrop": 0,
3941 "txVxltMiss": 0,
3942 "txFCSError": 0,
3943 "txPCError": 0,
3944 },
3945 "ok": {},
3946 }
3947 },
3948 "Ethernet3": {
3949 "count": {
3950 "drop": {
3951 "nonCongestionDiscard": 0,
3952 "ipv4L3Discard": 0,
3953 "ipv6L3Discard": 0,
3954 "rxUrpfDrop": 0,
3955 "rxFpDrop": 0,
3956 "rxMmuDrop": 0,
3957 "rxPipelineDrop": 0,
3958 "txMmuDrop": 0,
3959 "txPipelineDrop": 0,
3960 "rxMCDrop": 0,
3961 "rxIngressNFDrop": 0,
3962 "rxBufferPoolDiscard": 0,
3963 "rxPolicyDiscard": 0,
3964 "txL3UCAgedDrop": 0,
3965 "txL2MCDrop": 0,
3966 "txTTLDrop": 0,
3967 "wredDropPktCounter": 0,
3968 },
3969 "error": {
3970 "txMACError": 0,
3971 "txL2MTUError": 0,
3972 "ipv4L3HeaderError": 0,
3973 "ipv6L3HeaderError": 0,
3974 "rxVlanDrop": 0,
3975 "rxTunnelError": 0,
3976 "rxL2MTUError": 0,
3977 "txUnknownDrop": 0,
3978 "txInvalidVlan": 0,
3979 "txSplitHorizonDrop": 0,
3980 "txVxltMiss": 0,
3981 "txFCSError": 0,
3982 "txPCError": 0,
3983 },
3984 "ok": {},
3985 }
3986 },
3987 }
3988 }
3989 ],
3990 "inputs": {"ignored_counters": ["nonCongestionDiscard", "rxFpDrop"]},
3991 "expected": {"result": AntaTestStatus.SUCCESS},
3992 },
3993 (VerifyInterfacesTridentCounters, "success-drop-threshold"): {
3994 "eos_data": [
3995 {
3996 "ethernet": {
3997 "Ethernet48": {
3998 "count": {
3999 "drop": {
4000 "nonCongestionDiscard": 8,
4001 "ipv4L3Discard": 0,
4002 "ipv6L3Discard": 0,
4003 "rxUrpfDrop": 4,
4004 "rxFpDrop": 0,
4005 "rxMmuDrop": 0,
4006 "rxPipelineDrop": 0,
4007 "txMmuDrop": 4,
4008 "txPipelineDrop": 0,
4009 "rxMCDrop": 0,
4010 "rxIngressNFDrop": 0,
4011 "rxBufferPoolDiscard": 0,
4012 "rxPolicyDiscard": 0,
4013 "txL3UCAgedDrop": 0,
4014 "txL2MCDrop": 0,
4015 "txTTLDrop": 0,
4016 "wredDropPktCounter": 0,
4017 },
4018 "error": {
4019 "txMACError": 0,
4020 "txL2MTUError": 0,
4021 "ipv4L3HeaderError": 0,
4022 "ipv6L3HeaderError": 0,
4023 "rxVlanDrop": 0,
4024 "rxTunnelError": 0,
4025 "rxL2MTUError": 0,
4026 "txUnknownDrop": 0,
4027 "txInvalidVlan": 0,
4028 "txSplitHorizonDrop": 0,
4029 "txVxltMiss": 0,
4030 "txFCSError": 0,
4031 "txPCError": 0,
4032 },
4033 "ok": {},
4034 }
4035 },
4036 "Ethernet3": {
4037 "count": {
4038 "drop": {
4039 "nonCongestionDiscard": 10,
4040 "ipv4L3Discard": 0,
4041 "ipv6L3Discard": 4,
4042 "rxUrpfDrop": 0,
4043 "rxFpDrop": 1,
4044 "rxMmuDrop": 0,
4045 "rxPipelineDrop": 0,
4046 "txMmuDrop": 2,
4047 "txPipelineDrop": 0,
4048 "rxMCDrop": 0,
4049 "rxIngressNFDrop": 0,
4050 "rxBufferPoolDiscard": 3,
4051 "rxPolicyDiscard": 0,
4052 "txL3UCAgedDrop": 0,
4053 "txL2MCDrop": 0,
4054 "txTTLDrop": 0,
4055 "wredDropPktCounter": 0,
4056 },
4057 "error": {
4058 "txMACError": 0,
4059 "txL2MTUError": 0,
4060 "ipv4L3HeaderError": 0,
4061 "ipv6L3HeaderError": 0,
4062 "rxVlanDrop": 0,
4063 "rxTunnelError": 0,
4064 "rxL2MTUError": 0,
4065 "txUnknownDrop": 5,
4066 "txInvalidVlan": 0,
4067 "txSplitHorizonDrop": 0,
4068 "txVxltMiss": 0,
4069 "txFCSError": 0,
4070 "txPCError": 0,
4071 },
4072 "ok": {},
4073 }
4074 },
4075 }
4076 }
4077 ],
4078 "inputs": {"packet_drop_threshold": 10},
4079 "expected": {"result": AntaTestStatus.SUCCESS},
4080 },
4081 (VerifyInterfacesTridentCounters, "failure-drop-error-threshold"): {
4082 "eos_data": [
4083 {
4084 "ethernet": {
4085 "Ethernet48": {
4086 "count": {
4087 "drop": {
4088 "nonCongestionDiscard": 8,
4089 "ipv4L3Discard": 0,
4090 "ipv6L3Discard": 0,
4091 "rxUrpfDrop": 0,
4092 "rxFpDrop": 0,
4093 "rxMmuDrop": 0,
4094 "rxPipelineDrop": 0,
4095 "txMmuDrop": 4,
4096 "txPipelineDrop": 0,
4097 "rxMCDrop": 0,
4098 "rxIngressNFDrop": 0,
4099 "rxBufferPoolDiscard": 0,
4100 "rxPolicyDiscard": 0,
4101 "txL3UCAgedDrop": 0,
4102 "txL2MCDrop": 0,
4103 "txTTLDrop": 0,
4104 "wredDropPktCounter": 0,
4105 },
4106 "error": {
4107 "txMACError": 0,
4108 "txL2MTUError": 0,
4109 "ipv4L3HeaderError": 20,
4110 "ipv6L3HeaderError": 0,
4111 "rxVlanDrop": 0,
4112 "rxTunnelError": 0,
4113 "rxL2MTUError": 0,
4114 "txUnknownDrop": 0,
4115 "txInvalidVlan": 0,
4116 "txSplitHorizonDrop": 0,
4117 "txVxltMiss": 0,
4118 "txFCSError": 0,
4119 "txPCError": 0,
4120 },
4121 "ok": {},
4122 }
4123 },
4124 "Ethernet3": {
4125 "count": {
4126 "drop": {
4127 "nonCongestionDiscard": 10,
4128 "ipv4L3Discard": 0,
4129 "ipv6L3Discard": 0,
4130 "rxUrpfDrop": 0,
4131 "rxFpDrop": 0,
4132 "rxMmuDrop": 0,
4133 "rxPipelineDrop": 0,
4134 "txMmuDrop": 2,
4135 "txPipelineDrop": 0,
4136 "rxMCDrop": 0,
4137 "rxIngressNFDrop": 0,
4138 "rxBufferPoolDiscard": 0,
4139 "rxPolicyDiscard": 0,
4140 "txL3UCAgedDrop": 0,
4141 "txL2MCDrop": 0,
4142 "txTTLDrop": 0,
4143 "wredDropPktCounter": 0,
4144 },
4145 "error": {
4146 "txMACError": 0,
4147 "txL2MTUError": 10,
4148 "ipv4L3HeaderError": 0,
4149 "ipv6L3HeaderError": 0,
4150 "rxVlanDrop": 14,
4151 "rxTunnelError": 0,
4152 "rxL2MTUError": 0,
4153 "txUnknownDrop": 0,
4154 "txInvalidVlan": 0,
4155 "txSplitHorizonDrop": 0,
4156 "txVxltMiss": 0,
4157 "txFCSError": 0,
4158 "txPCError": 0,
4159 },
4160 "ok": {},
4161 }
4162 },
4163 }
4164 }
4165 ],
4166 "inputs": {"ignored_counters": ["nonCongestionDiscard", "rxFpDrop", "rxVlanDrop", "txMmuDrop"]},
4167 "expected": {
4168 "result": AntaTestStatus.FAILURE,
4169 "messages": [
4170 "Interface: Ethernet48 - Error counter ipv4L3HeaderError above threshold - Expected: <= 0 Actual: 20",
4171 "Interface: Ethernet3 - Error counter txL2MTUError above threshold - Expected: <= 0 Actual: 10",
4172 ],
4173 },
4174 },
4175 (VerifyInterfacesCounterDetails, "success"): {
4176 "eos_data": [
4177 {
4178 "interfaces": {
4179 "Ethernet2": {
4180 "name": "Ethernet2",
4181 "forwardingModel": "bridged",
4182 "lineProtocolStatus": "up",
4183 "interfaceStatus": "connected",
4184 "description": "",
4185 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4186 "interfaceCounters": {
4187 "inDiscards": 0,
4188 "outDiscards": 0,
4189 "outTotalPkts": 0,
4190 "linkStatusChanges": 2,
4191 "totalInErrors": 0,
4192 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4193 "totalOutErrors": 0,
4194 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 0},
4195 },
4196 },
4197 "Ethernet4": {
4198 "name": "Ethernet4",
4199 "forwardingModel": "bridged",
4200 "lineProtocolStatus": "up",
4201 "interfaceStatus": "connected",
4202 "description": "",
4203 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4204 "interfaceCounters": {
4205 "inDiscards": 0,
4206 "outDiscards": 0,
4207 "linkStatusChanges": 2,
4208 "totalInErrors": 0,
4209 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4210 "totalOutErrors": 0,
4211 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 0},
4212 },
4213 },
4214 "Ethernet1": {
4215 "name": "Ethernet1",
4216 "forwardingModel": "bridged",
4217 "lineProtocolStatus": "up",
4218 "interfaceStatus": "connected",
4219 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4220 "interfaceCounters": {
4221 "inDiscards": 0,
4222 "outDiscards": 0,
4223 "linkStatusChanges": 2,
4224 "totalInErrors": 0,
4225 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4226 "totalOutErrors": 0,
4227 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 0},
4228 },
4229 },
4230 "Ethernet3": {
4231 "name": "Ethernet3",
4232 "forwardingModel": "bridged",
4233 "lineProtocolStatus": "up",
4234 "interfaceStatus": "connected",
4235 "description": "",
4236 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4237 "interfaceCounters": {
4238 "inDiscards": 0,
4239 "outDiscards": 0,
4240 "outTotalPkts": 0,
4241 "linkStatusChanges": 2,
4242 "totalInErrors": 0,
4243 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4244 "totalOutErrors": 0,
4245 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 0},
4246 },
4247 },
4248 }
4249 },
4250 ],
4251 "inputs": {
4252 "interfaces": ["Ethernet1", "Ethernet2", "Ethernet4"],
4253 "ignored_interfaces": ["Ethernet3"],
4254 "counters_threshold": 0,
4255 "link_status_changes_threshold": 100,
4256 },
4257 "expected": {
4258 "result": AntaTestStatus.SUCCESS,
4259 },
4260 },
4261 (VerifyInterfacesCounterDetails, "failure-multiple-issues"): {
4262 "eos_data": [
4263 {
4264 "interfaces": {
4265 "Ethernet2": {
4266 "name": "Ethernet2",
4267 "lineProtocolStatus": "up",
4268 "interfaceStatus": "connected",
4269 "description": "",
4270 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4271 "interfaceCounters": {
4272 "inDiscards": 10,
4273 "outDiscards": 0,
4274 "linkStatusChanges": 12,
4275 "totalInErrors": 0,
4276 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4277 "totalOutErrors": 0,
4278 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 0},
4279 },
4280 },
4281 "Management0": {
4282 "name": "Management0",
4283 "lineProtocolStatus": "up",
4284 "interfaceStatus": "connected",
4285 "description": "OOB_MANAGEMENT",
4286 "interfaceCounters": {
4287 "inDiscards": 20,
4288 "outDiscards": 0,
4289 "linkStatusChanges": 1,
4290 "totalInErrors": 0,
4291 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4292 "totalOutErrors": 10,
4293 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 10},
4294 },
4295 },
4296 "Ethernet10": {
4297 "name": "Ethernet10",
4298 "lineProtocolStatus": "up",
4299 "interfaceStatus": "connected",
4300 "hardware": "ethernet",
4301 "description": "",
4302 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4303 "interfaceCounters": {
4304 "inDiscards": 0,
4305 "outDiscards": 10,
4306 "linkStatusChanges": 12,
4307 "totalInErrors": 10,
4308 "inputErrorsDetail": {"runtFrames": 10, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4309 "totalOutErrors": 0,
4310 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 20, "deferredTransmissions": 0, "txPause": 0},
4311 },
4312 },
4313 }
4314 }
4315 ],
4316 "inputs": {"interfaces": ["Management0", "Ethernet10"], "link_status_changes_threshold": 2},
4317 "expected": {
4318 "result": AntaTestStatus.FAILURE,
4319 "messages": [
4320 "Interface: Management0 Description: OOB_MANAGEMENT - Input discards above threshold - Expected: <= 0 Actual: 20",
4321 "Interface: Management0 Description: OOB_MANAGEMENT - Output errors above threshold - Expected: <= 0 Actual: 10",
4322 "Interface: Ethernet10 Uptime: 1 day - Link status changes above threshold - Expected: <= 2 Actual: 12",
4323 "Interface: Ethernet10 Uptime: 1 day - Output discards above threshold - Expected: <= 0 Actual: 10",
4324 "Interface: Ethernet10 Uptime: 1 day - Input errors above threshold - Expected: <= 0 Actual: 10",
4325 "Interface: Ethernet10 Uptime: 1 day - Runt frames above threshold - Expected: <= 0 Actual: 10",
4326 "Interface: Ethernet10 Uptime: 1 day - Late collisions above threshold - Expected: <= 0 Actual: 20",
4327 ],
4328 },
4329 },
4330 (VerifyInterfacesCounterDetails, "failure-input-error"): {
4331 "eos_data": [
4332 {
4333 "interfaces": {
4334 "Management1": {
4335 "name": "Management1",
4336 "forwardingModel": "bridged",
4337 "lineProtocolStatus": "up",
4338 "interfaceStatus": "connected",
4339 "description": "",
4340 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4341 "interfaceCounters": {
4342 "inDiscards": 0,
4343 "outDiscards": 0,
4344 "outTotalPkts": 0,
4345 "linkStatusChanges": 2,
4346 "totalInErrors": 0,
4347 "inputErrorsDetail": {"runtFrames": 30, "giantFrames": 0, "fcsErrors": 10, "alignmentErrors": 55, "symbolErrors": 20, "rxPause": 30},
4348 "totalOutErrors": 0,
4349 "outputErrorsDetail": {"collisions": 10, "lateCollisions": 10, "deferredTransmissions": 0, "txPause": 0},
4350 },
4351 },
4352 "Ethernet4": {
4353 "name": "Ethernet4",
4354 "forwardingModel": "bridged",
4355 "lineProtocolStatus": "up",
4356 "interfaceStatus": "connected",
4357 "description": "",
4358 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4359 "interfaceCounters": {
4360 "inDiscards": 0,
4361 "outDiscards": 0,
4362 "linkStatusChanges": 2,
4363 "totalInErrors": 0,
4364 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 30, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4365 "totalOutErrors": 0,
4366 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 30, "deferredTransmissions": 0, "txPause": 30},
4367 },
4368 },
4369 "Loopback0": {
4370 "name": "Loopback0",
4371 "forwardingModel": "bridged",
4372 "lineProtocolStatus": "up",
4373 "interfaceStatus": "connected",
4374 "description": "",
4375 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4376 "interfaceCounters": {
4377 "inDiscards": 0,
4378 "outDiscards": 0,
4379 "linkStatusChanges": 2,
4380 "totalInErrors": 0,
4381 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 30, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4382 "totalOutErrors": 0,
4383 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 30, "deferredTransmissions": 0, "txPause": 30},
4384 },
4385 },
4386 }
4387 },
4388 ],
4389 "inputs": {"ignored_interfaces": ["Ethernet4"], "counters_threshold": 10, "link_status_changes_threshold": 10},
4390 "expected": {
4391 "result": AntaTestStatus.FAILURE,
4392 "messages": [
4393 "Interface: Management1 Uptime: 1 day - Runt frames above threshold - Expected: <= 10 Actual: 30",
4394 "Interface: Management1 Uptime: 1 day - Alignment errors above threshold - Expected: <= 10 Actual: 55",
4395 "Interface: Management1 Uptime: 1 day - Symbol errors above threshold - Expected: <= 10 Actual: 20",
4396 ],
4397 },
4398 },
4399 (VerifyInterfacesCounterDetails, "failure-output-error"): {
4400 "eos_data": [
4401 {
4402 "interfaces": {
4403 "Management1": {
4404 "name": "Management1",
4405 "forwardingModel": "bridged",
4406 "lineProtocolStatus": "up",
4407 "interfaceStatus": "connected",
4408 "description": "",
4409 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4410 "interfaceCounters": {
4411 "inDiscards": 0,
4412 "outDiscards": 0,
4413 "outTotalPkts": 0,
4414 "linkStatusChanges": 2,
4415 "totalInErrors": 0,
4416 "inputErrorsDetail": {"runtFrames": 10, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 10, "symbolErrors": 20, "rxPause": 30},
4417 "totalOutErrors": 0,
4418 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 0},
4419 },
4420 },
4421 "Ethernet4": {
4422 "name": "Ethernet4",
4423 "forwardingModel": "bridged",
4424 "lineProtocolStatus": "up",
4425 "interfaceStatus": "connected",
4426 "description": "",
4427 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4428 "interfaceCounters": {
4429 "inDiscards": 0,
4430 "outDiscards": 0,
4431 "linkStatusChanges": 2,
4432 "totalInErrors": 0,
4433 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4434 "totalOutErrors": 0,
4435 "outputErrorsDetail": {"collisions": 20, "lateCollisions": 30, "deferredTransmissions": 0, "txPause": 30},
4436 },
4437 },
4438 }
4439 },
4440 ],
4441 "inputs": {"counters_threshold": 0, "link_status_changes_threshold": 20},
4442 "expected": {
4443 "result": AntaTestStatus.FAILURE,
4444 "messages": [
4445 "Interface: Management1 Uptime: 1 day - Runt frames above threshold - Expected: <= 0 Actual: 10",
4446 "Interface: Management1 Uptime: 1 day - Alignment errors above threshold - Expected: <= 0 Actual: 10",
4447 "Interface: Management1 Uptime: 1 day - Symbol errors above threshold - Expected: <= 0 Actual: 20",
4448 "Interface: Ethernet4 Uptime: 1 day - Collisions above threshold - Expected: <= 0 Actual: 20",
4449 "Interface: Ethernet4 Uptime: 1 day - Late collisions above threshold - Expected: <= 0 Actual: 30",
4450 ],
4451 },
4452 },
4453 (VerifyInterfacesCounterDetails, "failure-total-int-out-error"): {
4454 "eos_data": [
4455 {
4456 "interfaces": {
4457 "Management1": {
4458 "name": "Management1",
4459 "forwardingModel": "bridged",
4460 "lineProtocolStatus": "up",
4461 "interfaceStatus": "connected",
4462 "description": "",
4463 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4464 "interfaceCounters": {
4465 "inDiscards": 0,
4466 "outDiscards": 0,
4467 "outTotalPkts": 0,
4468 "linkStatusChanges": 2,
4469 "totalInErrors": 10,
4470 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 30},
4471 "totalOutErrors": 0,
4472 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 30},
4473 },
4474 },
4475 "Ethernet4": {
4476 "name": "Ethernet4",
4477 "forwardingModel": "bridged",
4478 "lineProtocolStatus": "up",
4479 "interfaceStatus": "connected",
4480 "description": "",
4481 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4482 "interfaceCounters": {
4483 "inDiscards": 0,
4484 "outDiscards": 0,
4485 "linkStatusChanges": 2,
4486 "totalInErrors": 0,
4487 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 20},
4488 "totalOutErrors": 30,
4489 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 30},
4490 },
4491 },
4492 }
4493 },
4494 ],
4495 "inputs": {"counters_threshold": 0, "link_status_changes_threshold": 20},
4496 "expected": {
4497 "result": AntaTestStatus.FAILURE,
4498 "messages": [
4499 "Interface: Management1 Uptime: 1 day - Input errors above threshold - Expected: <= 0 Actual: 10",
4500 "Interface: Ethernet4 Uptime: 1 day - Output errors above threshold - Expected: <= 0 Actual: 30",
4501 ],
4502 },
4503 },
4504 (VerifyInterfacesCounterDetails, "failure-int-out-packet-discard"): {
4505 "eos_data": [
4506 {
4507 "interfaces": {
4508 "Management1": {
4509 "name": "Management1",
4510 "forwardingModel": "bridged",
4511 "lineProtocolStatus": "up",
4512 "interfaceStatus": "connected",
4513 "description": "",
4514 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4515 "interfaceCounters": {
4516 "inDiscards": 0,
4517 "outDiscards": 30,
4518 "outTotalPkts": 0,
4519 "linkStatusChanges": 2,
4520 "totalInErrors": 10,
4521 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 10, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 30},
4522 "totalOutErrors": 0,
4523 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 30},
4524 },
4525 },
4526 "Ethernet4": {
4527 "name": "Ethernet4",
4528 "forwardingModel": "bridged",
4529 "lineProtocolStatus": "up",
4530 "interfaceStatus": "connected",
4531 "description": "",
4532 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4533 "interfaceCounters": {
4534 "inDiscards": 30,
4535 "outDiscards": 10,
4536 "linkStatusChanges": 2,
4537 "totalInErrors": 0,
4538 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 10, "symbolErrors": 0, "rxPause": 20},
4539 "totalOutErrors": 10,
4540 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 10, "deferredTransmissions": 0, "txPause": 30},
4541 },
4542 },
4543 }
4544 },
4545 ],
4546 "inputs": {"counters_threshold": 10, "link_status_changes_threshold": 20},
4547 "expected": {
4548 "result": AntaTestStatus.FAILURE,
4549 "messages": [
4550 "Interface: Management1 Uptime: 1 day - Output discards above threshold - Expected: <= 10 Actual: 30",
4551 "Interface: Ethernet4 Uptime: 1 day - Input discards above threshold - Expected: <= 10 Actual: 30",
4552 ],
4553 },
4554 },
4555 (VerifyInterfacesCounterDetails, "failure-link-status-changes"): {
4556 "eos_data": [
4557 {
4558 "interfaces": {
4559 "Management1/1": {
4560 "name": "Management1/1",
4561 "forwardingModel": "bridged",
4562 "lineProtocolStatus": "up",
4563 "interfaceStatus": "connected",
4564 "description": "",
4565 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4566 "interfaceCounters": {
4567 "inDiscards": 0,
4568 "outDiscards": 30,
4569 "outTotalPkts": 0,
4570 "linkStatusChanges": 45,
4571 "totalInErrors": 10,
4572 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 10, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 30},
4573 "totalOutErrors": 0,
4574 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 30},
4575 },
4576 },
4577 "Ethernet4/1": {
4578 "name": "Ethernet4/1",
4579 "forwardingModel": "bridged",
4580 "lineProtocolStatus": "down",
4581 "interfaceStatus": "notconnected",
4582 "description": "",
4583 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4584 "interfaceCounters": {
4585 "inDiscards": 30,
4586 "outDiscards": 10,
4587 "linkStatusChanges": 40,
4588 "totalInErrors": 0,
4589 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 10, "symbolErrors": 0, "rxPause": 20},
4590 "totalOutErrors": 10,
4591 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 10, "deferredTransmissions": 0, "txPause": 30},
4592 },
4593 },
4594 "Management0": {
4595 "name": "Management0",
4596 "forwardingModel": "bridged",
4597 "lineProtocolStatus": "down",
4598 "interfaceStatus": "notconnected",
4599 "description": "",
4600 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4601 },
4602 }
4603 },
4604 ],
4605 "inputs": {"ignored_interfaces": ["Management1/1"], "counters_threshold": 40, "link_status_changes_threshold": 20},
4606 "expected": {
4607 "result": AntaTestStatus.FAILURE,
4608 "messages": ["Interface: Ethernet4/1 Downtime: 1 day - Link status changes above threshold - Expected: <= 20 Actual: 40"],
4609 },
4610 },
4611 (VerifyInterfacesCounterDetails, "failure-specific-interface-not-found"): {
4612 "eos_data": [
4613 {
4614 "interfaces": {
4615 "Ethernet2/1": {
4616 "name": "Ethernet2/1",
4617 "forwardingModel": "bridged",
4618 "lineProtocolStatus": "up",
4619 "interfaceStatus": "connected",
4620 "description": "",
4621 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4622 "interfaceCounters": {
4623 "inDiscards": 0,
4624 "outDiscards": 0,
4625 "outTotalPkts": 0,
4626 "linkStatusChanges": 2,
4627 "totalInErrors": 0,
4628 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4629 "totalOutErrors": 0,
4630 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 0},
4631 },
4632 },
4633 "Ethernet4/2/1": {
4634 "name": "Ethernet4/2/1",
4635 "forwardingModel": "bridged",
4636 "lineProtocolStatus": "up",
4637 "interfaceStatus": "connected",
4638 "description": "",
4639 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4640 "interfaceCounters": {
4641 "inDiscards": 0,
4642 "outDiscards": 0,
4643 "linkStatusChanges": 2,
4644 "totalInErrors": 0,
4645 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4646 "totalOutErrors": 0,
4647 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 0},
4648 },
4649 },
4650 "Ethernet1/1/1": {
4651 "name": "Ethernet1/1/1",
4652 "forwardingModel": "bridged",
4653 "lineProtocolStatus": "up",
4654 "interfaceStatus": "connected",
4655 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4656 "interfaceCounters": {
4657 "inDiscards": 0,
4658 "outDiscards": 0,
4659 "linkStatusChanges": 2,
4660 "totalInErrors": 0,
4661 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4662 "totalOutErrors": 0,
4663 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 0},
4664 },
4665 },
4666 "Ethernet3": {
4667 "name": "Ethernet3",
4668 "forwardingModel": "bridged",
4669 "lineProtocolStatus": "up",
4670 "interfaceStatus": "connected",
4671 "description": "",
4672 "lastStatusChangeTimestamp": timestamp_one_day_ago,
4673 "interfaceCounters": {
4674 "inDiscards": 0,
4675 "outDiscards": 0,
4676 "outTotalPkts": 0,
4677 "linkStatusChanges": 2,
4678 "totalInErrors": 0,
4679 "inputErrorsDetail": {"runtFrames": 0, "giantFrames": 0, "fcsErrors": 0, "alignmentErrors": 0, "symbolErrors": 0, "rxPause": 0},
4680 "totalOutErrors": 0,
4681 "outputErrorsDetail": {"collisions": 0, "lateCollisions": 0, "deferredTransmissions": 0, "txPause": 0},
4682 },
4683 },
4684 }
4685 },
4686 ],
4687 "inputs": {"interfaces": ["Ethernet12/1/1", "Ethernet13/2", "Ethernet4/2/1"], "counters_threshold": 0, "link_status_changes_threshold": 100},
4688 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Ethernet12/1/1 - Not found", "Interface: Ethernet13/2 - Not found"]},
4689 },
4690 (VerifyInterfacesBER, "success"): {
4691 "eos_data": [
4692 {
4693 "interfacePhyStatuses": {
4694 "Ethernet1/1": {
4695 "phyStatuses": [
4696 {
4697 "description": {"phyChipName": "BCM88690-TSCBH", "location": "line"},
4698 "fec": {
4699 "correctedCodewords": {"value": 3, "changes": 303, "lastChange": 1749635205.1726532},
4700 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4701 },
4702 "preFecBer": {"value": 0.5378509864228316e-9},
4703 "pma": {"laneTxStatus": {}},
4704 "phyState": {"value": "linkUp", "changes": 2, "lastChange": 1749630055.512745},
4705 },
4706 {"description": {"phyChipName": "CRT50216"}},
4707 {
4708 "description": {"phyChipName": "CRT50216", "location": "system"},
4709 "fec": {
4710 "correctedCodewords": {"value": 2, "changes": 382, "lastChange": 1749635233.8094382},
4711 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4712 },
4713 "preFecBer": {"value": 1.3005834847433436e-12},
4714 },
4715 {
4716 "description": {"phyChipName": "CRT50216", "location": "line"},
4717 "fec": {
4718 "hiSer": {"value": False, "changes": 0, "lastChange": 0.0},
4719 "correctedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4720 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4721 "laneMap": {"0": 0, "1": 1, "2": 2, "3": 3},
4722 },
4723 "preFecBer": {"value": 1.3399973239803202e-22},
4724 },
4725 ],
4726 "interfaceState": {},
4727 "transceiver": {},
4728 "macFaults": {},
4729 },
4730 "Ethernet1/2": {
4731 "phyStatuses": [
4732 {
4733 "description": {"phyChipName": "BCM88690-TSCBH", "location": "line"},
4734 "chip": {},
4735 "operSpeed": "unknown",
4736 "fec": {
4737 "correctedCodewords": {"value": 3, "changes": 303, "lastChange": 1749635205.1726532},
4738 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4739 },
4740 "preFecBer": {"value": 1.3005834847433436e-2},
4741 },
4742 {
4743 "description": {"phyChipName": "CRT50216"},
4744 "chip": {"oui": 10137034, "model": 0, "rev": 0, "hwRev": "B0", "modelName": "CRT50216"},
4745 "firmwareRev": "02.21.02",
4746 },
4747 {"description": {"phyChipName": "CRT50216", "location": "system"}, "lanes": {}, "topPllVcoCap": {"txPllCap": 43, "rxPllCap": 43}},
4748 {"description": {"phyChipName": "CRT50216", "location": "line"}, "lanes": {}, "topPllVcoCap": {}},
4749 ],
4750 "interfaceState": {},
4751 "transceiver": {},
4752 "macFaults": {},
4753 },
4754 }
4755 },
4756 {
4757 "interfaceDescriptions": {
4758 "Ethernet1/1": {"description": "To Arelion Sweden AB", "lineProtocolStatus": "up", "interfaceStatus": "up"},
4759 "Ethernet1/2": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
4760 }
4761 },
4762 ],
4763 "inputs": {"interfaces": ["Ethernet1/1"], "ignored_interfaces": ["Ethernet1/2"], "max_ber_threshold": 1e-8},
4764 "expected": {"result": AntaTestStatus.SUCCESS},
4765 },
4766 (VerifyInterfacesBER, "success-default-input"): {
4767 "eos_data": [
4768 {
4769 "interfacePhyStatuses": {
4770 "Ethernet1/1": {
4771 "phyStatuses": [
4772 {
4773 "description": {"phyChipName": "BCM88690-TSCBH", "location": "line"},
4774 "fec": {
4775 "correctedCodewords": {"value": 3, "changes": 303, "lastChange": 1749635205.1726532},
4776 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4777 },
4778 "preFecBer": {"value": 1.5402777434414486e-13},
4779 "pma": {"laneTxStatus": {}},
4780 "phyState": {"value": "linkUp", "changes": 2, "lastChange": 1749630055.512745},
4781 },
4782 {"description": {"phyChipName": "CRT50216"}},
4783 {
4784 "description": {"phyChipName": "CRT50216", "location": "system"},
4785 "fec": {
4786 "correctedCodewords": {"value": 2, "changes": 382, "lastChange": 1749635233.8094382},
4787 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4788 },
4789 "preFecBer": {"value": 1.3005834847433436e-12},
4790 },
4791 {
4792 "description": {"phyChipName": "CRT50216", "location": "line"},
4793 "fec": {
4794 "hiSer": {"value": False, "changes": 0, "lastChange": 0.0},
4795 "correctedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4796 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4797 "laneMap": {"0": 0, "1": 1, "2": 2, "3": 3},
4798 },
4799 "preFecBer": {"value": 1.3399973239803202e-22},
4800 },
4801 ],
4802 "interfaceState": {},
4803 "transceiver": {},
4804 "macFaults": {},
4805 },
4806 "Ethernet1/2": {
4807 "phyStatuses": [
4808 {
4809 "description": {"phyChipName": "BCM88690-TSCBH", "location": "line"},
4810 "chip": {},
4811 "operSpeed": "unknown",
4812 },
4813 {
4814 "description": {"phyChipName": "CRT50216"},
4815 "chip": {"oui": 10137034, "model": 0, "rev": 0, "hwRev": "B0", "modelName": "CRT50216"},
4816 "firmwareRev": "02.21.02",
4817 },
4818 {"description": {"phyChipName": "CRT50216", "location": "system"}, "lanes": {}, "topPllVcoCap": {"txPllCap": 43, "rxPllCap": 43}},
4819 {"description": {"phyChipName": "CRT50216", "location": "line"}, "lanes": {}, "topPllVcoCap": {}},
4820 ],
4821 "interfaceState": {},
4822 "transceiver": {},
4823 "macFaults": {},
4824 },
4825 }
4826 },
4827 {
4828 "interfaceDescriptions": {
4829 "Ethernet1/1": {"description": "To Arelion Sweden AB", "lineProtocolStatus": "up", "interfaceStatus": "up"},
4830 "Ethernet1/2": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
4831 }
4832 },
4833 ],
4834 "expected": {"result": AntaTestStatus.SUCCESS},
4835 },
4836 (VerifyInterfacesBER, "failure-uncorrected-codewords"): {
4837 "eos_data": [
4838 {
4839 "interfacePhyStatuses": {
4840 "Ethernet1/1": {
4841 "phyStatuses": [
4842 {
4843 "description": {"phyChipName": "BCM88690-TSCBH", "location": "line"},
4844 "fec": {
4845 "correctedCodewords": {"value": 3, "changes": 303, "lastChange": 1749635205.1726532},
4846 "uncorrectedCodewords": {"value": 10, "changes": 0, "lastChange": 0.0},
4847 },
4848 "preFecBer": {"value": 1.5402777434414486e-23},
4849 "pma": {"laneTxStatus": {}},
4850 "phyState": {"value": "linkUp", "changes": 2, "lastChange": 1749630055.512745},
4851 },
4852 {"description": {"phyChipName": "CRT50216"}},
4853 {
4854 "description": {"phyChipName": "CRT50216", "location": "system"},
4855 "fec": {
4856 "correctedCodewords": {"value": 32, "changes": 382, "lastChange": 1749635233.8094382},
4857 "uncorrectedCodewords": {"value": 10, "changes": 0, "lastChange": 0.0},
4858 },
4859 "preFecBer": {"value": 1.3005834847433436e-22},
4860 },
4861 {
4862 "description": {"phyChipName": "CRT50216", "location": "line"},
4863 "fec": {
4864 "hiSer": {"value": False, "changes": 0, "lastChange": 0.0},
4865 "correctedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4866 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4867 "laneMap": {"0": 0, "1": 1, "2": 2, "3": 3},
4868 },
4869 "preFecBer": {"value": 1.3399973239803202e-22},
4870 },
4871 ],
4872 "interfaceState": {},
4873 "transceiver": {},
4874 "macFaults": {},
4875 },
4876 "Ethernet1/2": {
4877 "phyStatuses": [
4878 {
4879 "description": {"phyChipName": "BCM88690-TSCBH", "location": "line"},
4880 "chip": {},
4881 "fec": {
4882 "hiSer": {"value": False, "changes": 0, "lastChange": 0.0},
4883 "correctedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4884 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4885 "laneMap": {"0": 0, "1": 1, "2": 2, "3": 3},
4886 },
4887 "operSpeed": "unknown",
4888 },
4889 {
4890 "description": {"phyChipName": "CRT50216"},
4891 "chip": {"oui": 10137034, "model": 0, "rev": 0, "hwRev": "B0", "modelName": "CRT50216"},
4892 "firmwareRev": "02.21.02",
4893 },
4894 {"description": {"phyChipName": "CRT50216", "location": "system"}, "lanes": {}, "topPllVcoCap": {"txPllCap": 43, "rxPllCap": 43}},
4895 {"description": {"phyChipName": "CRT50216", "location": "line"}, "lanes": {}, "topPllVcoCap": {}},
4896 ],
4897 "interfaceState": {},
4898 "transceiver": {},
4899 "macFaults": {},
4900 },
4901 }
4902 },
4903 {
4904 "interfaceDescriptions": {
4905 "Ethernet1/1": {"description": "To Arelion Sweden AB", "lineProtocolStatus": "up", "interfaceStatus": "up"},
4906 "Ethernet1/2": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
4907 }
4908 },
4909 ],
4910 "inputs": {"interfaces": ["Ethernet1/1"], "max_ber_threshold": 1e-8},
4911 "expected": {
4912 "result": AntaTestStatus.FAILURE,
4913 "messages": [
4914 "Interface: Ethernet1/1 Description: To Arelion Sweden AB - Uncorrected FEC codewords detected - Expected: 0 Actual: 10",
4915 "Interface: Ethernet1/1 Description: To Arelion Sweden AB - Uncorrected FEC codewords detected - Expected: 0 Actual: 10",
4916 ],
4917 },
4918 },
4919 (VerifyInterfacesBER, "failure-low-ber-threshold"): {
4920 "eos_data": [
4921 {
4922 "interfacePhyStatuses": {
4923 "Ethernet1/1": {
4924 "phyStatuses": [
4925 {
4926 "description": {"phyChipName": "BCM88690-TSCBH", "location": "line"},
4927 "fec": {
4928 "correctedCodewords": {"value": 3, "changes": 303, "lastChange": 1749635205.1726532},
4929 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4930 },
4931 "preFecBer": {"value": 2.5402777434414486e-2},
4932 "pma": {"laneTxStatus": {}},
4933 "phyState": {"value": "linkUp", "changes": 2, "lastChange": 1749630055.512745},
4934 },
4935 {"description": {"phyChipName": "CRT50216"}},
4936 {
4937 "description": {"phyChipName": "CRT50216", "location": "system"},
4938 "fec": {
4939 "correctedCodewords": {"value": 2, "changes": 382, "lastChange": 1749635233.8094382},
4940 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4941 },
4942 "preFecBer": {"value": 1.3005834847433436e-12},
4943 },
4944 {
4945 "description": {"phyChipName": "CRT50216", "location": "line"},
4946 "fec": {
4947 "hiSer": {"value": False, "changes": 0, "lastChange": 0.0},
4948 "correctedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4949 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4950 "laneMap": {"0": 0, "1": 1, "2": 2, "3": 3},
4951 },
4952 "preFecBer": {"value": 1.3399973239803202e-3},
4953 },
4954 ],
4955 "interfaceState": {},
4956 "transceiver": {},
4957 "macFaults": {},
4958 },
4959 "Ethernet3/1/1": {
4960 "phyStatuses": [
4961 {
4962 "description": {"phyChipName": "BCM88690-TSCBH", "location": "line"},
4963 "fec": {
4964 "correctedCodewords": {"value": 3, "changes": 303, "lastChange": 1749635205.1726532},
4965 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4966 },
4967 "preFecBer": {"value": 2.5402777434414486e-2},
4968 "pma": {"laneTxStatus": {}},
4969 "phyState": {"value": "linkUp", "changes": 2, "lastChange": 1749630055.512745},
4970 },
4971 {"description": {"phyChipName": "CRT50216"}},
4972 {
4973 "description": {"phyChipName": "CRT50216", "location": "system"},
4974 "fec": {
4975 "correctedCodewords": {"value": 2, "changes": 382, "lastChange": 1749635233.8094382},
4976 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4977 },
4978 "preFecBer": {"value": 1.3005834847433436e-2},
4979 },
4980 {
4981 "description": {"phyChipName": "CRT50216", "location": "line"},
4982 "fec": {
4983 "hiSer": {"value": False, "changes": 0, "lastChange": 0.0},
4984 "correctedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4985 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
4986 "laneMap": {"0": 0, "1": 1, "2": 2, "3": 3},
4987 },
4988 "preFecBer": {"value": 1.3399973239803202e-3},
4989 },
4990 ],
4991 "interfaceState": {},
4992 "transceiver": {},
4993 "macFaults": {},
4994 },
4995 "Ethernet1/2": {
4996 "phyStatuses": [
4997 {
4998 "description": {"phyChipName": "BCM88690-TSCBH", "location": "line"},
4999 "chip": {},
5000 "operSpeed": "unknown",
5001 },
5002 {
5003 "description": {"phyChipName": "CRT50216"},
5004 "chip": {"oui": 10137034, "model": 0, "rev": 0, "hwRev": "B0", "modelName": "CRT50216"},
5005 "firmwareRev": "02.21.02",
5006 },
5007 {"description": {"phyChipName": "CRT50216", "location": "system"}, "lanes": {}, "topPllVcoCap": {"txPllCap": 43, "rxPllCap": 43}},
5008 {"description": {"phyChipName": "CRT50216", "location": "line"}, "lanes": {}, "topPllVcoCap": {}},
5009 ],
5010 "interfaceState": {},
5011 "transceiver": {},
5012 "macFaults": {},
5013 },
5014 }
5015 },
5016 {
5017 "interfaceDescriptions": {
5018 "Ethernet1/1": {"description": "To Arelion Sweden AB", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5019 "Ethernet1/2": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5020 "Ethernet3/1/1": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5021 }
5022 },
5023 ],
5024 "inputs": {"ignored_interfaces": ["Ethernet3/1/1"]},
5025 "expected": {
5026 "result": AntaTestStatus.FAILURE,
5027 "messages": [
5028 "Interface: Ethernet1/1 Description: To Arelion Sweden AB FEC Corrected: 3 FEC Uncorrected: 0 - BER above threshold -"
5029 " Expected: <= 1.00e-07 Actual: 2.54e-02",
5030 "Interface: Ethernet1/1 Description: To Arelion Sweden AB FEC Corrected: 0 FEC Uncorrected: 0 - BER above threshold -"
5031 " Expected: <= 1.00e-07 Actual: 1.34e-03",
5032 ],
5033 },
5034 },
5035 (VerifyInterfacesBER, "interface-not-found"): {
5036 "eos_data": [
5037 {
5038 "interfacePhyStatuses": {
5039 "Ethernet1/1": {
5040 "phyStatuses": [
5041 {
5042 "description": {"phyChipName": "BCM88690-TSCBH", "location": "line"},
5043 "fec": {
5044 "correctedCodewords": {"value": 3, "changes": 303, "lastChange": 1749635205.1726532},
5045 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
5046 },
5047 "preFecBer": {"value": 2.5402777434414486e-12},
5048 "pma": {"laneTxStatus": {}},
5049 "phyState": {"value": "linkUp", "changes": 2, "lastChange": 1749630055.512745},
5050 },
5051 {"description": {"phyChipName": "CRT50216"}},
5052 {
5053 "description": {"phyChipName": "CRT50216", "location": "system"},
5054 "fec": {
5055 "correctedCodewords": {"value": 2, "changes": 382, "lastChange": 1749635233.8094382},
5056 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
5057 },
5058 "preFecBer": {"value": 1.3005834847433436e-8},
5059 },
5060 {
5061 "description": {"phyChipName": "CRT50216", "location": "line"},
5062 "fec": {
5063 "hiSer": {"value": False, "changes": 0, "lastChange": 0.0},
5064 "correctedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
5065 "uncorrectedCodewords": {"value": 0, "changes": 0, "lastChange": 0.0},
5066 "laneMap": {"0": 0, "1": 1, "2": 2, "3": 3},
5067 },
5068 "preFecBer": {"value": 1.3399973239803202e-13},
5069 },
5070 ],
5071 "interfaceState": {},
5072 "transceiver": {},
5073 "macFaults": {},
5074 },
5075 }
5076 },
5077 {
5078 "interfaceDescriptions": {
5079 "Ethernet1/1": {"description": "To Arelion Sweden AB", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5080 "Ethernet1/2": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5081 }
5082 },
5083 ],
5084 "inputs": {"interfaces": ["Ethernet8/1"], "max_ber_threshold": 1e-9},
5085 "expected": {
5086 "result": AntaTestStatus.FAILURE,
5087 "messages": ["Interface: Ethernet8/1 - Not found"],
5088 },
5089 },
5090 (VerifyInterfacesOpticsReceivePower, "success"): {
5091 "eos_data": [
5092 {
5093 "interfaces": {
5094 "Ethernet1/1": {"displayName": "Ethernet1/1"},
5095 "Ethernet2/1": {
5096 "displayName": "Ethernet2/1",
5097 "vendorSn": "TEST05DA",
5098 "mediaType": "100GBASE-SR4",
5099 "parameters": {
5100 "rxPower": {
5101 "unit": "dBm",
5102 "channels": {"1": -30.08242460465652002, "2": -0.09972101229705288, "3": -40.31236951802751634, "4": -1.4630178822382547},
5103 "threshold": {
5104 "lowAlarm": -13.29754146925876,
5105 "lowAlarmOverridden": False,
5106 "lowWarn": -10.301183562535002,
5107 "lowWarnOverridden": False,
5108 },
5109 }
5110 },
5111 },
5112 "Ethernet3/1": {"displayName": "Ethernet3/1"},
5113 "Ethernet7/1": {
5114 "displayName": "Ethernet7/1",
5115 "vendorSn": "TEST08M",
5116 "mediaType": "40GBASE-SR4",
5117 "parameters": {
5118 "rxPower": {
5119 "unit": "dBm",
5120 "channels": {"1": -2.6019040097864092, "2": -2.3657200643706275, "3": -2.2242819530858995, "4": -2.7018749283906445},
5121 "threshold": {
5122 "lowAlarm": -12.502636844309393,
5123 "lowAlarmOverridden": False,
5124 "lowWarn": -9.500071430798577,
5125 "lowWarnOverridden": False,
5126 },
5127 }
5128 },
5129 },
5130 }
5131 },
5132 {
5133 "interfaceDescriptions": {
5134 "Ethernet1/1": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5135 "Ethernet2/1": {"description": "To_HS-154", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5136 "Ethernet3/1": {"description": "", "lineProtocolStatus": "down", "interfaceStatus": "down"},
5137 "Ethernet7/1": {"description": "GZ_CMCC_v6", "lineProtocolStatus": "down", "interfaceStatus": "down"},
5138 }
5139 },
5140 ],
5141 "inputs": {"ignored_interfaces": ["Ethernet2/1"], "failure_margin": 2},
5142 "expected": {
5143 "result": AntaTestStatus.SUCCESS,
5144 },
5145 },
5146 (VerifyInterfacesOpticsReceivePower, "success-valid-rx-power"): {
5147 "eos_data": [
5148 {
5149 "interfaces": {
5150 "Ethernet1/1": {"displayName": "Ethernet1/1"},
5151 "Ethernet2/1": {
5152 "displayName": "Ethernet2/1",
5153 "vendorSn": "TEST5DA",
5154 "mediaType": "100GBASE-SR4",
5155 "parameters": {
5156 "rxPower": {
5157 "unit": "dBm",
5158 "channels": {"1": -30, "2": -0.09972101229705288, "3": -0.31236951802751634, "4": -1.4630178822382547},
5159 "threshold": {
5160 "lowAlarm": -13.29754146925876,
5161 "lowAlarmOverridden": False,
5162 "lowWarn": -10.301183562535002,
5163 "lowWarnOverridden": False,
5164 },
5165 }
5166 },
5167 },
5168 "Ethernet3/1": {"displayName": "Ethernet3/1"},
5169 "Ethernet7/1": {
5170 "displayName": "Ethernet7/1",
5171 "vendorSn": "TEST8M",
5172 "mediaType": "40GBASE-SR4",
5173 "parameters": {
5174 "rxPower": {
5175 "unit": "dBm",
5176 "channels": {"1": -30, "2": -2.3657200643706275, "3": -23.2242819530858995, "4": -2.7018749283906445},
5177 "threshold": {
5178 "lowAlarm": -25.502636844309393,
5179 "lowAlarmOverridden": False,
5180 "lowWarn": -9.500071430798577,
5181 "lowWarnOverridden": False,
5182 },
5183 }
5184 },
5185 },
5186 }
5187 },
5188 {
5189 "interfaceDescriptions": {
5190 "Ethernet1/1": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5191 "Ethernet2/1": {"description": "To_HS-154", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5192 "Ethernet3/1": {"description": "", "lineProtocolStatus": "down", "interfaceStatus": "down"},
5193 "Ethernet7/1": {"description": "GZ_CMCC_v6", "lineProtocolStatus": "down", "interfaceStatus": "down"},
5194 }
5195 },
5196 ],
5197 "inputs": {"failure_margin": 2},
5198 "expected": {
5199 "result": AntaTestStatus.SUCCESS,
5200 },
5201 },
5202 (VerifyInterfacesOpticsReceivePower, "failure-optic-low-rx"): {
5203 "eos_data": [
5204 {
5205 "interfaces": {
5206 "Ethernet1/1": {"displayName": "Ethernet1/1"},
5207 "Ethernet2/1": {
5208 "displayName": "Ethernet2/1",
5209 "vendorSn": "TEST05DA",
5210 "mediaType": "100GBASE-SR4",
5211 "parameters": {
5212 "rxPower": {
5213 "unit": "dBm",
5214 "channels": {"1": -30.08242460465652002, "2": -0.09972101229705288, "3": -40.31236951802751634, "4": -1.4630178822382547},
5215 "threshold": {
5216 "lowAlarm": -13.29754146925876,
5217 "lowAlarmOverridden": False,
5218 "lowWarn": -10.301183562535002,
5219 "lowWarnOverridden": False,
5220 },
5221 }
5222 },
5223 },
5224 "Ethernet3/1": {"displayName": "Ethernet3/1"},
5225 "Ethernet7/1/1": {
5226 "displayName": "Ethernet7/1/1",
5227 "vendorSn": "TEST008M",
5228 "mediaType": "40GBASE-SR4",
5229 "parameters": {
5230 "rxPower": {
5231 "unit": "dBm",
5232 "channels": {"1": -29.6019040097864092, "2": -2.3657200643706275, "3": -23.2242819530858995, "4": -2.7018749283906445},
5233 "threshold": {
5234 "lowAlarm": -12.502636844309393,
5235 "lowAlarmOverridden": False,
5236 "lowWarn": -9.500071430798577,
5237 "lowWarnOverridden": False,
5238 },
5239 }
5240 },
5241 },
5242 "Ethernet8/1/1": {
5243 "displayName": "Ethernet8/1/1",
5244 "vendorSn": "TEST8M",
5245 "mediaType": "40GBASE-SR4",
5246 "parameters": {
5247 "rxPower": {
5248 "unit": "dBm",
5249 "channels": {"1": -29.6019040097864092, "2": -2.3657200643706275, "3": -23.2242819530858995, "4": -2.7018749283906445},
5250 "threshold": {
5251 "lowAlarm": -12.502636844309393,
5252 "lowAlarmOverridden": False,
5253 "lowWarn": -9.500071430798577,
5254 "lowWarnOverridden": False,
5255 },
5256 }
5257 },
5258 },
5259 }
5260 },
5261 {
5262 "interfaceDescriptions": {
5263 "Ethernet1/1": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5264 "Ethernet2/1": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5265 "Ethernet3/1": {"description": "", "lineProtocolStatus": "down", "interfaceStatus": "down"},
5266 "Ethernet7/1/1": {"description": "GZ_CMCC_v6", "lineProtocolStatus": "down", "interfaceStatus": "down"},
5267 "Ethernet8/1/1": {"description": "GZ_CMCC_v6", "lineProtocolStatus": "down", "interfaceStatus": "down"},
5268 }
5269 },
5270 ],
5271 "inputs": {"interfaces": ["Ethernet1/1", "Ethernet2/1", "Ethernet3/1"], "ignored_interfaces": ["Ethernet7/1/1"], "failure_margin": 2},
5272 "expected": {
5273 "result": AntaTestStatus.FAILURE,
5274 "messages": [
5275 "Interface: Ethernet1/1 - Receive power details are not found (DOM not supported)",
5276 "Interface: Ethernet2/1 Status: up Channel: 1 Optic: 100GBASE-SR4 - Low receive power detected - "
5277 "Expected: >= -11.30dBm (Alarm: -13.30dBm + Margin: 2dBm) Actual: -30.08dBm",
5278 "Interface: Ethernet2/1 Status: up Channel: 3 Optic: 100GBASE-SR4 - Low receive power detected - "
5279 "Expected: >= -11.30dBm (Alarm: -13.30dBm + Margin: 2dBm) Actual: -40.31dBm",
5280 "Interface: Ethernet3/1 - Receive power details are not found (DOM not supported)",
5281 ],
5282 },
5283 },
5284 (VerifyInterfacesOpticsReceivePower, "failure-due-to-margin"): {
5285 "eos_data": [
5286 {
5287 "interfaces": {
5288 "Ethernet1/1": {
5289 "displayName": "Ethernet1/1",
5290 "mediaType": "100GBASE-SR4",
5291 "parameters": {
5292 "rxPower": {
5293 "unit": "dBm",
5294 "channels": {"1": -12.0},
5295 "threshold": {"lowAlarm": -13.0},
5296 }
5297 },
5298 },
5299 }
5300 },
5301 {
5302 "interfaceDescriptions": {
5303 "Ethernet1/1": {"description": "Proactive failure test", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5304 }
5305 },
5306 ],
5307 "inputs": {"failure_margin": 2},
5308 "expected": {
5309 "result": AntaTestStatus.FAILURE,
5310 "messages": [
5311 "Interface: Ethernet1/1 Status: up Channel: 1 Optic: 100GBASE-SR4 - Low receive power detected - "
5312 "Expected: >= -11.00dBm (Alarm: -13.00dBm + Margin: 2dBm) Actual: -12.00dBm"
5313 ],
5314 },
5315 },
5316 (VerifyInterfacesOpticsReceivePower, "interface-not-found"): {
5317 "eos_data": [
5318 {
5319 "interfaces": {
5320 "Ethernet1/1": {"displayName": "Ethernet1/1"},
5321 "Ethernet2/1": {
5322 "displayName": "Ethernet2/1",
5323 "vendorSn": "TEST5DA",
5324 "mediaType": "100GBASE-SR4",
5325 "parameters": {
5326 "rxPower": {
5327 "unit": "dBm",
5328 "channels": {"1": -30.08242460465652002, "2": -0.09972101229705288, "3": -40.31236951802751634, "4": -1.4630178822382547},
5329 "threshold": {
5330 "lowAlarm": -13.29754146925876,
5331 "lowAlarmOverridden": False,
5332 "lowWarn": -10.301183562535002,
5333 "lowWarnOverridden": False,
5334 },
5335 }
5336 },
5337 },
5338 "Ethernet3/1": {"displayName": "Ethernet3/1"},
5339 }
5340 },
5341 {
5342 "interfaceDescriptions": {
5343 "Ethernet1/1": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5344 "Ethernet2/1": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5345 "Ethernet3/1": {"description": "", "lineProtocolStatus": "down", "interfaceStatus": "down"},
5346 }
5347 },
5348 ],
5349 "inputs": {"interfaces": ["Ethernet13/1"], "failure_margin": 2},
5350 "expected": {
5351 "result": AntaTestStatus.FAILURE,
5352 "messages": ["Interface: Ethernet13/1 - Optic not found"],
5353 },
5354 },
5355 (VerifyInterfacesOpticsReceivePower, "success-ignore-shutdown-interfaces"): {
5356 "eos_data": [
5357 {
5358 "interfaces": {
5359 "Ethernet1/1": {
5360 "displayName": "Ethernet1/1",
5361 "mediaType": "100GBASE-SR4",
5362 "parameters": {
5363 "rxPower": {
5364 "unit": "dBm",
5365 "channels": {"1": -2.0},
5366 "threshold": {"lowAlarm": -13.0},
5367 }
5368 },
5369 },
5370 "Ethernet2/1": {
5371 "displayName": "Ethernet2/1",
5372 "mediaType": "100GBASE-SR4",
5373 "parameters": {
5374 "rxPower": {
5375 "unit": "dBm",
5376 "channels": {"1": -25.0},
5377 "threshold": {"lowAlarm": -13.0},
5378 }
5379 },
5380 },
5381 }
5382 },
5383 {
5384 "interfaceDescriptions": {
5385 "Ethernet1/1": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5386 "Ethernet2/1": {"description": "", "lineProtocolStatus": "down", "interfaceStatus": "adminDown"},
5387 }
5388 },
5389 ],
5390 "inputs": {"failure_margin": 2, "ignore_shutdown_interfaces": True},
5391 "expected": {
5392 "result": AntaTestStatus.SUCCESS,
5393 },
5394 },
5395 (VerifyInterfacesOpticsReceivePower, "failure-shutdown-interface-not-ignored"): {
5396 "eos_data": [
5397 {
5398 "interfaces": {
5399 "Ethernet1/1": {
5400 "displayName": "Ethernet1/1",
5401 "mediaType": "100GBASE-SR4",
5402 "parameters": {
5403 "rxPower": {
5404 "unit": "dBm",
5405 "channels": {"1": -2.0},
5406 "threshold": {"lowAlarm": -13.0},
5407 }
5408 },
5409 },
5410 "Ethernet2/1": {
5411 "displayName": "Ethernet2/1",
5412 "mediaType": "100GBASE-SR4",
5413 "parameters": {
5414 "rxPower": {
5415 "unit": "dBm",
5416 "channels": {"1": -25.0},
5417 "threshold": {"lowAlarm": -13.0},
5418 }
5419 },
5420 },
5421 }
5422 },
5423 {
5424 "interfaceDescriptions": {
5425 "Ethernet1/1": {"description": "", "lineProtocolStatus": "up", "interfaceStatus": "up"},
5426 "Ethernet2/1": {"description": "", "lineProtocolStatus": "down", "interfaceStatus": "adminDown"},
5427 }
5428 },
5429 ],
5430 "inputs": {"failure_margin": 2},
5431 "expected": {
5432 "result": AntaTestStatus.FAILURE,
5433 "messages": [
5434 "Interface: Ethernet2/1 Status: adminDown Channel: 1 Optic: 100GBASE-SR4 - Low receive power detected - "
5435 "Expected: >= -11.00dBm (Alarm: -13.00dBm + Margin: 2dBm) Actual: -25.00dBm"
5436 ],
5437 },
5438 },
5439 (VerifyInterfacesEgressQueueDrops, "success-all"): {
5440 "eos_data": [
5441 {
5442 "egressQueueCounters": {
5443 "interfaces": {
5444 "Ethernet1": {
5445 "ucastQueues": {
5446 "trafficClasses": {
5447 "TC0": {
5448 "dropPrecedences": {
5449 "DP0": {
5450 "droppedPackets": 0,
5451 }
5452 }
5453 },
5454 "TC1": {
5455 "dropPrecedences": {
5456 "DP0": {
5457 "droppedPackets": 0,
5458 }
5459 }
5460 },
5461 }
5462 },
5463 "mcastQueues": {
5464 "trafficClasses": {
5465 "TC0": {
5466 "dropPrecedences": {
5467 "DP0": {
5468 "droppedPackets": 0,
5469 }
5470 }
5471 },
5472 "TC1": {
5473 "dropPrecedences": {
5474 "DP0": {
5475 "droppedPackets": 0,
5476 }
5477 }
5478 },
5479 }
5480 },
5481 },
5482 "Ethernet2": {
5483 "ucastQueues": {
5484 "trafficClasses": {
5485 "TC0": {
5486 "dropPrecedences": {
5487 "DP0": {
5488 "droppedPackets": 0,
5489 }
5490 }
5491 },
5492 "TC1": {
5493 "dropPrecedences": {
5494 "DP0": {
5495 "droppedPackets": 0,
5496 }
5497 }
5498 },
5499 }
5500 },
5501 "mcastQueues": {
5502 "trafficClasses": {
5503 "TC0": {
5504 "dropPrecedences": {
5505 "DP0": {
5506 "droppedPackets": 0,
5507 }
5508 }
5509 },
5510 "TC1": {
5511 "dropPrecedences": {
5512 "DP0": {
5513 "droppedPackets": 4,
5514 }
5515 }
5516 },
5517 }
5518 },
5519 },
5520 }
5521 }
5522 }
5523 ],
5524 "inputs": {"ignored_interfaces": ["Ethernet2"]},
5525 "expected": {"result": AntaTestStatus.SUCCESS},
5526 },
5527 (VerifyInterfacesEgressQueueDrops, "success-all-modular"): {
5528 "eos_data": [
5529 {
5530 "egressQueueCounters": {
5531 "interfaces": {
5532 "Ethernet1/1": {
5533 "ucastQueues": {
5534 "trafficClasses": {
5535 "TC0": {
5536 "dropPrecedences": {
5537 "DP0": {
5538 "droppedPackets": 0,
5539 }
5540 }
5541 },
5542 "TC1": {
5543 "dropPrecedences": {
5544 "DP0": {
5545 "droppedPackets": 0,
5546 }
5547 }
5548 },
5549 }
5550 },
5551 "mcastQueues": {
5552 "trafficClasses": {
5553 "TC0": {
5554 "dropPrecedences": {
5555 "DP0": {
5556 "droppedPackets": 0,
5557 }
5558 }
5559 },
5560 "TC1": {
5561 "dropPrecedences": {
5562 "DP0": {
5563 "droppedPackets": 0,
5564 }
5565 }
5566 },
5567 }
5568 },
5569 },
5570 "Ethernet2/1": {
5571 "ucastQueues": {
5572 "trafficClasses": {
5573 "TC0": {
5574 "dropPrecedences": {
5575 "DP0": {
5576 "droppedPackets": 0,
5577 }
5578 }
5579 },
5580 "TC1": {
5581 "dropPrecedences": {
5582 "DP0": {
5583 "droppedPackets": 0,
5584 }
5585 }
5586 },
5587 }
5588 },
5589 "mcastQueues": {
5590 "trafficClasses": {
5591 "TC0": {
5592 "dropPrecedences": {
5593 "DP0": {
5594 "droppedPackets": 0,
5595 }
5596 }
5597 },
5598 "TC1": {
5599 "dropPrecedences": {
5600 "DP0": {
5601 "droppedPackets": 0,
5602 }
5603 }
5604 },
5605 }
5606 },
5607 },
5608 }
5609 }
5610 }
5611 ],
5612 "expected": {"result": AntaTestStatus.SUCCESS},
5613 },
5614 (VerifyInterfacesEgressQueueDrops, "success-traffic-claas-and-dp-range"): {
5615 "eos_data": [
5616 {
5617 "egressQueueCounters": {
5618 "interfaces": {
5619 "Ethernet1": {
5620 "ucastQueues": {
5621 "trafficClasses": {
5622 "TC0-2": {
5623 "dropPrecedences": {
5624 "DP0-2": {
5625 "droppedPackets": 0,
5626 }
5627 }
5628 },
5629 }
5630 },
5631 "mcastQueues": {
5632 "trafficClasses": {
5633 "TC0-2": {
5634 "dropPrecedences": {
5635 "DP0-2": {
5636 "droppedPackets": 0,
5637 }
5638 }
5639 },
5640 }
5641 },
5642 },
5643 "Ethernet2": {
5644 "ucastQueues": {
5645 "trafficClasses": {
5646 "TC0-2": {
5647 "dropPrecedences": {
5648 "DP0-2": {
5649 "droppedPackets": 0,
5650 }
5651 }
5652 },
5653 }
5654 },
5655 "mcastQueues": {
5656 "trafficClasses": {
5657 "TC0-2": {
5658 "dropPrecedences": {
5659 "DP0-2": {
5660 "droppedPackets": 0,
5661 }
5662 }
5663 },
5664 }
5665 },
5666 },
5667 }
5668 }
5669 }
5670 ],
5671 "inputs": {"traffic_classes": ["TC0", "TC1", "TC2"], "drop_precedences": ["DP0", "DP1", "DP2"]},
5672 "expected": {"result": AntaTestStatus.SUCCESS},
5673 },
5674 (VerifyInterfacesEgressQueueDrops, "success-unicast"): {
5675 "eos_data": [
5676 {
5677 "egressQueueCounters": {
5678 "interfaces": {
5679 "Ethernet1": {
5680 "ucastQueues": {
5681 "trafficClasses": {
5682 "TC0": {
5683 "dropPrecedences": {
5684 "DP0": {
5685 "droppedPackets": 0,
5686 }
5687 }
5688 },
5689 "TC1": {
5690 "dropPrecedences": {
5691 "DP0": {
5692 "droppedPackets": 0,
5693 }
5694 }
5695 },
5696 }
5697 },
5698 }
5699 }
5700 }
5701 }
5702 ],
5703 "inputs": {"queue_types": ["unicast"]},
5704 "expected": {"result": AntaTestStatus.SUCCESS},
5705 },
5706 (VerifyInterfacesEgressQueueDrops, "success-multicast"): {
5707 "eos_data": [
5708 {
5709 "egressQueueCounters": {
5710 "interfaces": {
5711 "Ethernet1": {
5712 "mcastQueues": {
5713 "trafficClasses": {
5714 "TC0": {
5715 "dropPrecedences": {
5716 "DP0": {
5717 "droppedPackets": 0,
5718 }
5719 }
5720 },
5721 "TC1": {
5722 "dropPrecedences": {
5723 "DP0": {
5724 "droppedPackets": 0,
5725 }
5726 }
5727 },
5728 }
5729 },
5730 }
5731 }
5732 }
5733 }
5734 ],
5735 "inputs": {"queue_types": ["multicast"]},
5736 "expected": {"result": AntaTestStatus.SUCCESS},
5737 },
5738 (VerifyInterfacesEgressQueueDrops, "success-specific-intf"): {
5739 "eos_data": [
5740 {
5741 "egressQueueCounters": {
5742 "interfaces": {
5743 "Ethernet1": {
5744 "mcastQueues": {
5745 "trafficClasses": {
5746 "TC0": {
5747 "dropPrecedences": {
5748 "DP0": {
5749 "droppedPackets": 0,
5750 }
5751 }
5752 },
5753 "TC1": {
5754 "dropPrecedences": {
5755 "DP0": {
5756 "droppedPackets": 0,
5757 }
5758 }
5759 },
5760 }
5761 },
5762 },
5763 "Ethernet2": {
5764 "mcastQueues": {
5765 "trafficClasses": {
5766 "TC0": {
5767 "dropPrecedences": {
5768 "DP0": {
5769 "droppedPackets": 4,
5770 }
5771 }
5772 },
5773 "TC1": {
5774 "dropPrecedences": {
5775 "DP0": {
5776 "droppedPackets": 4,
5777 }
5778 }
5779 },
5780 }
5781 },
5782 },
5783 }
5784 }
5785 }
5786 ],
5787 "inputs": {"interfaces": ["Ethernet1"], "queue_types": ["multicast"]},
5788 "expected": {"result": AntaTestStatus.SUCCESS},
5789 },
5790 (VerifyInterfacesEgressQueueDrops, "success-specific-traffic-class"): {
5791 "eos_data": [
5792 {
5793 "egressQueueCounters": {
5794 "interfaces": {
5795 "Ethernet1": {
5796 "mcastQueues": {
5797 "trafficClasses": {
5798 "TC0": {
5799 "dropPrecedences": {
5800 "DP0": {
5801 "droppedPackets": 0,
5802 }
5803 }
5804 },
5805 "TC1": {
5806 "dropPrecedences": {
5807 "DP0": {
5808 "droppedPackets": 3,
5809 }
5810 }
5811 },
5812 }
5813 },
5814 },
5815 "Ethernet2": {
5816 "mcastQueues": {
5817 "trafficClasses": {
5818 "TC0": {
5819 "dropPrecedences": {
5820 "DP0": {
5821 "droppedPackets": 0,
5822 }
5823 }
5824 },
5825 "TC1": {
5826 "dropPrecedences": {
5827 "DP0": {
5828 "droppedPackets": 4,
5829 }
5830 }
5831 },
5832 }
5833 },
5834 },
5835 }
5836 }
5837 }
5838 ],
5839 "inputs": {"traffic_classes": ["TC0"], "queue_types": ["multicast"]},
5840 "expected": {"result": AntaTestStatus.SUCCESS},
5841 },
5842 (VerifyInterfacesEgressQueueDrops, "failure"): {
5843 "eos_data": [
5844 {
5845 "egressQueueCounters": {
5846 "interfaces": {
5847 "Ethernet1": {
5848 "ucastQueues": {
5849 "trafficClasses": {
5850 "TC0": {
5851 "dropPrecedences": {
5852 "DP0": {
5853 "droppedPackets": 2,
5854 }
5855 }
5856 },
5857 "TC1": {
5858 "dropPrecedences": {
5859 "DP0": {
5860 "droppedPackets": 0,
5861 }
5862 }
5863 },
5864 }
5865 },
5866 "mcastQueues": {
5867 "trafficClasses": {
5868 "TC0": {
5869 "dropPrecedences": {
5870 "DP0": {
5871 "droppedPackets": 0,
5872 }
5873 }
5874 },
5875 "TC1": {
5876 "dropPrecedences": {
5877 "DP0": {
5878 "droppedPackets": 3,
5879 }
5880 }
5881 },
5882 }
5883 },
5884 },
5885 "Ethernet2": {
5886 "ucastQueues": {
5887 "trafficClasses": {
5888 "TC0": {
5889 "dropPrecedences": {
5890 "DP0": {
5891 "droppedPackets": 0,
5892 }
5893 }
5894 },
5895 "TC1": {
5896 "dropPrecedences": {
5897 "DP0": {
5898 "droppedPackets": 2,
5899 }
5900 }
5901 },
5902 }
5903 },
5904 "mcastQueues": {
5905 "trafficClasses": {
5906 "TC0": {
5907 "dropPrecedences": {
5908 "DP0": {
5909 "droppedPackets": 3,
5910 }
5911 }
5912 },
5913 "TC1": {
5914 "dropPrecedences": {
5915 "DP0": {
5916 "droppedPackets": 0,
5917 }
5918 }
5919 },
5920 }
5921 },
5922 },
5923 }
5924 }
5925 }
5926 ],
5927 "expected": {
5928 "result": AntaTestStatus.FAILURE,
5929 "messages": [
5930 "Interface: Ethernet1 Traffic Class: TC0 Queue Type: unicast Drop Precedence: DP0 - Queue drops above threshold - Expected: <= 0 Actual: 2",
5931 "Interface: Ethernet1 Traffic Class: TC1 Queue Type: multicast Drop Precedence: DP0 - Queue drops above threshold - Expected: <= 0 Actual: 3",
5932 "Interface: Ethernet2 Traffic Class: TC1 Queue Type: unicast Drop Precedence: DP0 - Queue drops above threshold - Expected: <= 0 Actual: 2",
5933 "Interface: Ethernet2 Traffic Class: TC0 Queue Type: multicast Drop Precedence: DP0 - Queue drops above threshold - Expected: <= 0 Actual: 3",
5934 ],
5935 },
5936 },
5937 (VerifyInterfacesEgressQueueDrops, "failure-specific-intf"): {
5938 "eos_data": [
5939 {
5940 "egressQueueCounters": {
5941 "interfaces": {
5942 "Ethernet2": {
5943 "mcastQueues": {
5944 "trafficClasses": {
5945 "TC0": {
5946 "dropPrecedences": {
5947 "DP0": {
5948 "droppedPackets": 4,
5949 }
5950 }
5951 },
5952 "TC1": {
5953 "dropPrecedences": {
5954 "DP0": {
5955 "droppedPackets": 4,
5956 }
5957 }
5958 },
5959 }
5960 },
5961 }
5962 }
5963 }
5964 }
5965 ],
5966 "inputs": {"interfaces": ["Ethernet1"], "queue_types": ["multicast"]},
5967 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Ethernet1 - Not found"]},
5968 },
5969 (VerifyInterfacesEgressQueueDrops, "failure-specific-traffic-class"): {
5970 "eos_data": [
5971 {
5972 "egressQueueCounters": {
5973 "interfaces": {
5974 "Ethernet1": {
5975 "mcastQueues": {
5976 "trafficClasses": {
5977 "TC1": {
5978 "dropPrecedences": {
5979 "DP0": {
5980 "droppedPackets": 3,
5981 }
5982 }
5983 }
5984 }
5985 },
5986 },
5987 "Ethernet2": {
5988 "mcastQueues": {
5989 "trafficClasses": {
5990 "TC1": {
5991 "dropPrecedences": {
5992 "DP0": {
5993 "droppedPackets": 4,
5994 }
5995 }
5996 }
5997 }
5998 },
5999 },
6000 }
6001 }
6002 }
6003 ],
6004 "inputs": {"traffic_classes": ["TC0"], "queue_types": ["multicast"]},
6005 "expected": {
6006 "result": AntaTestStatus.FAILURE,
6007 "messages": [
6008 "Interface: Ethernet1 Queue Type: multicast Traffic Class: TC0 - Not found",
6009 "Interface: Ethernet2 Queue Type: multicast Traffic Class: TC0 - Not found",
6010 ],
6011 },
6012 },
6013 (VerifyInterfacesEgressQueueDrops, "failure-traffic-claas-and-dp-range"): {
6014 "eos_data": [
6015 {
6016 "egressQueueCounters": {
6017 "interfaces": {
6018 "Ethernet1": {
6019 "ucastQueues": {
6020 "trafficClasses": {
6021 "TC0-2": {
6022 "dropPrecedences": {
6023 "DP0-2": {
6024 "droppedPackets": 2,
6025 }
6026 }
6027 },
6028 }
6029 },
6030 },
6031 }
6032 }
6033 }
6034 ],
6035 "inputs": {"traffic_classes": ["TC0", "TC1"], "drop_precedences": ["DP0", "DP1"], "queue_types": ["unicast"]},
6036 "expected": {
6037 "result": AntaTestStatus.FAILURE,
6038 "messages": [
6039 "Interface: Ethernet1 Traffic Class: TC0 Queue Type: unicast Drop Precedence: DP0 - Queue drops above threshold - Expected: <= 0 Actual: 2",
6040 "Interface: Ethernet1 Traffic Class: TC0 Queue Type: unicast Drop Precedence: DP1 - Queue drops above threshold - Expected: <= 0 Actual: 2",
6041 "Interface: Ethernet1 Traffic Class: TC1 Queue Type: unicast Drop Precedence: DP0 - Queue drops above threshold - Expected: <= 0 Actual: 2",
6042 "Interface: Ethernet1 Traffic Class: TC1 Queue Type: unicast Drop Precedence: DP1 - Queue drops above threshold - Expected: <= 0 Actual: 2",
6043 ],
6044 },
6045 },
6046 (VerifyInterfacesEgressQueueDrops, "failure-precedence-not-found"): {
6047 "eos_data": [
6048 {
6049 "egressQueueCounters": {
6050 "interfaces": {
6051 "Ethernet1": {
6052 "ucastQueues": {
6053 "trafficClasses": {
6054 "TC0-2": {"dropPrecedences": {}},
6055 }
6056 },
6057 },
6058 }
6059 }
6060 }
6061 ],
6062 "inputs": {"traffic_classes": ["TC0", "TC1"], "drop_precedences": ["DP0"], "queue_types": ["unicast"]},
6063 "expected": {
6064 "result": AntaTestStatus.FAILURE,
6065 "messages": [
6066 "Interface: Ethernet1 Traffic Class: TC0 Queue Type: unicast Drop Precedence: DP0 - Not found",
6067 "Interface: Ethernet1 Traffic Class: TC1 Queue Type: unicast Drop Precedence: DP0 - Not found",
6068 ],
6069 },
6070 },
6071 (VerifyInterfacesEgressQueueDrops, "failure-modular"): {
6072 "eos_data": [
6073 {
6074 "egressQueueCounters": {
6075 "interfaces": {
6076 "Ethernet1/1": {
6077 "ucastQueues": {
6078 "trafficClasses": {
6079 "TC0": {
6080 "dropPrecedences": {
6081 "DP0": {
6082 "droppedPackets": 2,
6083 }
6084 }
6085 },
6086 "TC1": {
6087 "dropPrecedences": {
6088 "DP0": {
6089 "droppedPackets": 2,
6090 }
6091 }
6092 },
6093 }
6094 },
6095 "mcastQueues": {
6096 "trafficClasses": {
6097 "TC0": {
6098 "dropPrecedences": {
6099 "DP0": {
6100 "droppedPackets": 1,
6101 }
6102 }
6103 },
6104 "TC1": {
6105 "dropPrecedences": {
6106 "DP0": {
6107 "droppedPackets": 0,
6108 }
6109 }
6110 },
6111 }
6112 },
6113 },
6114 "Ethernet2/1": {
6115 "ucastQueues": {
6116 "trafficClasses": {
6117 "TC0": {
6118 "dropPrecedences": {
6119 "DP0": {
6120 "droppedPackets": 0,
6121 }
6122 }
6123 },
6124 "TC1": {
6125 "dropPrecedences": {
6126 "DP0": {
6127 "droppedPackets": 0,
6128 }
6129 }
6130 },
6131 }
6132 },
6133 "mcastQueues": {
6134 "trafficClasses": {
6135 "TC0": {
6136 "dropPrecedences": {
6137 "DP0": {
6138 "droppedPackets": 0,
6139 }
6140 }
6141 },
6142 "TC1": {
6143 "dropPrecedences": {
6144 "DP0": {
6145 "droppedPackets": 0,
6146 }
6147 }
6148 },
6149 }
6150 },
6151 },
6152 }
6153 }
6154 }
6155 ],
6156 "expected": {
6157 "result": AntaTestStatus.FAILURE,
6158 "messages": [
6159 "Interface: Ethernet1/1 Traffic Class: TC0 Queue Type: unicast Drop Precedence: DP0 - Queue drops above threshold - Expected: <= 0 Actual: 2",
6160 "Interface: Ethernet1/1 Traffic Class: TC1 Queue Type: unicast Drop Precedence: DP0 - Queue drops above threshold - Expected: <= 0 Actual: 2",
6161 "Interface: Ethernet1/1 Traffic Class: TC0 Queue Type: multicast Drop Precedence: DP0 - Queue drops above threshold - Expected: <= 0 Actual: 1",
6162 ],
6163 },
6164 },
6165 (VerifyInterfacesOpticsTemperature, "success"): {
6166 "eos_data": [
6167 {
6168 "interfaces": {
6169 "Ethernet1/1": {
6170 "displayName": "Ethernet1/1",
6171 "parameters": {
6172 "temperature": {
6173 "unit": "C",
6174 "channels": {"-": 33.85546875},
6175 },
6176 },
6177 },
6178 "Ethernet1/2": {
6179 "displayName": "Ethernet1/2",
6180 "parameters": {
6181 "temperature": {
6182 "unit": "C",
6183 "channels": {"-": 33.85546875},
6184 },
6185 },
6186 },
6187 "Ethernet1/3": {
6188 "displayName": "Ethernet1/3",
6189 "parameters": {
6190 "temperature": {
6191 "unit": "C",
6192 "channels": {"-": 33.85546875},
6193 },
6194 },
6195 },
6196 }
6197 }
6198 ],
6199 "expected": {"result": AntaTestStatus.SUCCESS},
6200 },
6201 (VerifyInterfacesOpticsTemperature, "success-specific-interface"): {
6202 "eos_data": [
6203 {
6204 "interfaces": {
6205 "Ethernet25/8": {
6206 "displayName": "Ethernet25/8",
6207 "parameters": {
6208 "temperature": {
6209 "unit": "C",
6210 "channels": {"-": 80.85546875},
6211 },
6212 },
6213 },
6214 "Ethernet1/1": {
6215 "displayName": "Ethernet1/1",
6216 "parameters": {
6217 "temperature": {
6218 "unit": "C",
6219 "channels": {"-": 60.85546875},
6220 },
6221 },
6222 },
6223 "Ethernet1/2": {
6224 "displayName": "Ethernet1/2",
6225 "parameters": {
6226 "temperature": {
6227 "unit": "C",
6228 "channels": {"-": 33.85546875},
6229 },
6230 },
6231 },
6232 }
6233 }
6234 ],
6235 "inputs": {"interfaces": ["Ethernet1/1", "Ethernet1/2"], "max_transceiver_temperature": 70},
6236 "expected": {"result": AntaTestStatus.SUCCESS},
6237 },
6238 (VerifyInterfacesOpticsTemperature, "success-ignored-intf"): {
6239 "eos_data": [
6240 {
6241 "interfaces": {
6242 "Ethernet1/1": {
6243 "displayName": "Ethernet1/1",
6244 "parameters": {
6245 "temperature": {
6246 "unit": "C",
6247 "channels": {"-": 80.85546875},
6248 },
6249 },
6250 },
6251 "Ethernet1/2": {
6252 "displayName": "Ethernet1/2",
6253 "parameters": {
6254 "temperature": {
6255 "unit": "C",
6256 "channels": {"-": 33.85546875},
6257 },
6258 },
6259 },
6260 }
6261 }
6262 ],
6263 "inputs": {"ignored_interfaces": ["Ethernet1/1"], "max_transceiver_temperature": 70},
6264 "expected": {"result": AntaTestStatus.SUCCESS},
6265 },
6266 (VerifyInterfacesOpticsTemperature, "failure-no-optics-specific-interface"): {
6267 "eos_data": [
6268 {
6269 "interfaces": {
6270 "Ethernet25/8": {},
6271 "Ethernet1/1": {},
6272 "Ethernet1/2": {},
6273 "Ethernet1/3": {},
6274 }
6275 }
6276 ],
6277 "inputs": {"interfaces": ["Ethernet1/1"], "max_transceiver_temperature": 70},
6278 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Interface: Ethernet1/1 - Optic not found"]},
6279 },
6280 (VerifyInterfacesOpticsTemperature, "failure-all"): {
6281 "eos_data": [
6282 {
6283 "interfaces": {
6284 "Ethernet1/1": {
6285 "displayName": "Ethernet1/1",
6286 "parameters": {
6287 "temperature": {
6288 "unit": "C",
6289 "channels": {"-": 73.7575},
6290 },
6291 },
6292 },
6293 "Ethernet1/2": {
6294 "displayName": "Ethernet1/2",
6295 "parameters": {
6296 "temperature": {
6297 "unit": "C",
6298 "channels": {"-": 75.7575},
6299 },
6300 },
6301 },
6302 }
6303 }
6304 ],
6305 "expected": {
6306 "result": AntaTestStatus.FAILURE,
6307 "messages": [
6308 "Interface: Ethernet1/1 - High transceiver temperature detected - Expected: <= 68.0°C Actual: 73.76°C",
6309 "Interface: Ethernet1/2 - High transceiver temperature detected - Expected: <= 68.0°C Actual: 75.76°C",
6310 ],
6311 },
6312 },
6313 (VerifyInterfacesOpticsTemperature, "failure-specific-interface"): {
6314 "eos_data": [
6315 {
6316 "interfaces": {
6317 "Ethernet25/8": {},
6318 "Ethernet1/1": {
6319 "displayName": "Ethernet1/1",
6320 "parameters": {
6321 "temperature": {
6322 "unit": "C",
6323 "channels": {"-": 73.7575},
6324 },
6325 },
6326 },
6327 "Ethernet1/2": {
6328 "displayName": "Ethernet1/2",
6329 "parameters": {
6330 "temperature": {
6331 "unit": "C",
6332 "channels": {"-": 73.7575},
6333 },
6334 },
6335 },
6336 }
6337 }
6338 ],
6339 "inputs": {"interfaces": ["Ethernet1/1"], "max_transceiver_temperature": 70},
6340 "expected": {
6341 "result": AntaTestStatus.FAILURE,
6342 "messages": [
6343 "Interface: Ethernet1/1 - High transceiver temperature detected - Expected: <= 70.0°C Actual: 73.76°C",
6344 ],
6345 },
6346 },
6347 (VerifyInterfacesOpticsTemperature, "failure-specific-interface-details-not-found"): {
6348 "eos_data": [
6349 {
6350 "interfaces": {
6351 "Ethernet25/8": {},
6352 "Ethernet1/1": {"displayName": "Ethernet1/1", "parameters": {}},
6353 "Ethernet1/2": {
6354 "displayName": "Ethernet1/2",
6355 "parameters": {
6356 "temperature": {
6357 "unit": "C",
6358 "channels": {"-": 73.7575},
6359 },
6360 },
6361 },
6362 }
6363 }
6364 ],
6365 "inputs": {"interfaces": ["Ethernet1/1"], "max_transceiver_temperature": 70},
6366 "expected": {
6367 "result": AntaTestStatus.FAILURE,
6368 "messages": [
6369 "Interface: Ethernet1/1 - Temperature details are not found (DOM not supported)",
6370 ],
6371 },
6372 },
6373 (VerifyInterfacesECNCounters, "success"): {
6374 "eos_data": [
6375 {
6376 "intfQueueCounters": {
6377 "Ethernet10/28/1": {
6378 "queueCounters": {
6379 "0": "0",
6380 "1": "0",
6381 "2": "0",
6382 },
6383 },
6384 "Ethernet10/20/1": {
6385 "queueCounters": {
6386 "0": "0",
6387 "1": "0",
6388 "2": "0",
6389 },
6390 },
6391 "Ethernet10/16/1": {
6392 "queueCounters": {
6393 "0": "0",
6394 "1": "0",
6395 "2": "0",
6396 },
6397 },
6398 "Ethernet10/3/1": {
6399 "queueCounters": {
6400 "0": "0",
6401 "1": "0",
6402 "2": "0",
6403 },
6404 },
6405 }
6406 }
6407 ],
6408 "expected": {"result": AntaTestStatus.SUCCESS},
6409 },
6410 (VerifyInterfacesECNCounters, "success-specific-interface"): {
6411 "eos_data": [
6412 {
6413 "intfQueueCounters": {
6414 "Ethernet10/28/1": {
6415 "queueCounters": {
6416 "0": "0",
6417 "1": "0",
6418 "2": "0",
6419 },
6420 },
6421 "Ethernet10/20/1": {
6422 "queueCounters": {
6423 "0": "0",
6424 "1": "0",
6425 "2": "0",
6426 },
6427 },
6428 "Ethernet10/16/1": {
6429 "queueCounters": {
6430 "0": "-",
6431 "1": "0",
6432 "2": "0",
6433 },
6434 },
6435 "Ethernet10/3/1": {
6436 "queueCounters": {
6437 "0": "-",
6438 "1": "0",
6439 "2": "0",
6440 },
6441 },
6442 }
6443 }
6444 ],
6445 "inputs": {"interfaces": ["Ethernet10/28/1", "Ethernet10/20/1"]},
6446 "expected": {"result": AntaTestStatus.SUCCESS},
6447 },
6448 (VerifyInterfacesECNCounters, "success-ignored-interface"): {
6449 "eos_data": [
6450 {
6451 "intfQueueCounters": {
6452 "Ethernet10/28/1": {
6453 "queueCounters": {
6454 "0": "0",
6455 "1": "0",
6456 "2": "0",
6457 },
6458 },
6459 "Ethernet10/20/1": {
6460 "queueCounters": {
6461 "0": "0",
6462 "1": "0",
6463 "2": "0",
6464 },
6465 },
6466 "Ethernet10/16/1": {
6467 "queueCounters": {
6468 "0": "-",
6469 "1": "0",
6470 "2": "0",
6471 },
6472 },
6473 "Ethernet10/3/1": {
6474 "queueCounters": {
6475 "0": "-",
6476 "1": "0",
6477 "2": "0",
6478 },
6479 },
6480 }
6481 }
6482 ],
6483 "inputs": {"ignored_interfaces": ["Ethernet10/16/1", "Ethernet10/3/1"]},
6484 "expected": {"result": AntaTestStatus.SUCCESS},
6485 },
6486 (VerifyInterfacesECNCounters, "failure"): {
6487 "eos_data": [
6488 {
6489 "intfQueueCounters": {
6490 "Ethernet10/28/1": {
6491 "queueCounters": {
6492 "0": "-",
6493 "1": "0",
6494 "2": "0",
6495 },
6496 },
6497 "Ethernet10/20/1": {
6498 "queueCounters": {
6499 "0": "0",
6500 "1": "2",
6501 "2": "0",
6502 },
6503 },
6504 "Ethernet10/16/1": {
6505 "queueCounters": {
6506 "0": "0",
6507 "1": "0",
6508 "2": "-",
6509 },
6510 },
6511 "Ethernet10/3/1": {
6512 "queueCounters": {
6513 "0": "0",
6514 "1": "0",
6515 "2": "2",
6516 },
6517 },
6518 }
6519 }
6520 ],
6521 "expected": {
6522 "result": AntaTestStatus.FAILURE,
6523 "messages": [
6524 "Interface: Ethernet10/20/1 Queue: 1 - Counters above threshold - Expected: <= 0 Actual: 2",
6525 "Interface: Ethernet10/3/1 Queue: 2 - Counters above threshold - Expected: <= 0 Actual: 2",
6526 ],
6527 },
6528 },
6529 (VerifyInterfacesECNCounters, "failure-specific-interface"): {
6530 "eos_data": [
6531 {
6532 "intfQueueCounters": {
6533 "Ethernet10/20/1": {
6534 "queueCounters": {
6535 "0": "-",
6536 "1": "-",
6537 "2": "0",
6538 },
6539 },
6540 "Ethernet10/16/1": {
6541 "queueCounters": {
6542 "0": "-",
6543 "1": "0",
6544 "2": "0",
6545 },
6546 },
6547 "Ethernet10/3/1": {
6548 "queueCounters": {
6549 "0": "-",
6550 "1": "0",
6551 "2": "0",
6552 },
6553 },
6554 }
6555 }
6556 ],
6557 "inputs": {"interfaces": ["Ethernet10/28/1", "Ethernet10/20/1"]},
6558 "expected": {
6559 "result": AntaTestStatus.FAILURE,
6560 "messages": [
6561 "Interface: Ethernet10/28/1 - Not found",
6562 ],
6563 },
6564 },
6565 (VerifyInterfacesPFCCounters, "success"): {
6566 "eos_data": [
6567 {
6568 "interfaceCounters": {
6569 "Ethernet3/1/1": {"rxFrames": 0, "txFrames": 0},
6570 "Ethernet3/2/1": {"rxFrames": 0, "txFrames": 0},
6571 "Ethernet3/3/1": {"rxFrames": 0, "txFrames": 0},
6572 "Ethernet3/4/1": {"rxFrames": 0, "txFrames": 0},
6573 }
6574 }
6575 ],
6576 "expected": {"result": AntaTestStatus.SUCCESS},
6577 },
6578 (VerifyInterfacesPFCCounters, "success-specific-interface"): {
6579 "eos_data": [
6580 {
6581 "interfaceCounters": {
6582 "Ethernet3/1/1": {"rxFrames": 0, "txFrames": 0},
6583 "Ethernet3/2/1": {"rxFrames": 0, "txFrames": 0},
6584 "Ethernet3/3/1": {"rxFrames": 2, "txFrames": 0},
6585 "Ethernet3/4/1": {"rxFrames": 0, "txFrames": 2},
6586 }
6587 }
6588 ],
6589 "inputs": {"interfaces": ["Ethernet3/1/1", "Ethernet3/2/1"]},
6590 "expected": {"result": AntaTestStatus.SUCCESS},
6591 },
6592 (VerifyInterfacesPFCCounters, "success-ignored-interface"): {
6593 "eos_data": [
6594 {
6595 "interfaceCounters": {
6596 "Ethernet3/1/1": {"rxFrames": 0, "txFrames": 0},
6597 "Ethernet3/2/1": {"rxFrames": 0, "txFrames": 0},
6598 "Ethernet3/3/1": {"rxFrames": 2, "txFrames": 0},
6599 "Ethernet3/4/1": {"rxFrames": 0, "txFrames": 2},
6600 }
6601 }
6602 ],
6603 "inputs": {"ignored_interfaces": ["Ethernet3/3/1", "Ethernet3/4/1"]},
6604 "expected": {"result": AntaTestStatus.SUCCESS},
6605 },
6606 (VerifyInterfacesPFCCounters, "failure"): {
6607 "eos_data": [
6608 {
6609 "interfaceCounters": {
6610 "Ethernet3/1/1": {"rxFrames": 1, "txFrames": 0},
6611 "Ethernet3/2/1": {"rxFrames": 0, "txFrames": 2},
6612 "Ethernet3/3/1": {"rxFrames": 2, "txFrames": 0},
6613 "Ethernet3/4/1": {"rxFrames": 0, "txFrames": 1},
6614 }
6615 }
6616 ],
6617 "expected": {
6618 "result": AntaTestStatus.FAILURE,
6619 "messages": [
6620 "Interface: Ethernet3/1/1 - Counters above threshold - Expected: <= 0 Actual RX PFC: 1 Actual TX PFC: 0",
6621 "Interface: Ethernet3/2/1 - Counters above threshold - Expected: <= 0 Actual RX PFC: 0 Actual TX PFC: 2",
6622 "Interface: Ethernet3/3/1 - Counters above threshold - Expected: <= 0 Actual RX PFC: 2 Actual TX PFC: 0",
6623 "Interface: Ethernet3/4/1 - Counters above threshold - Expected: <= 0 Actual RX PFC: 0 Actual TX PFC: 1",
6624 ],
6625 },
6626 },
6627 (VerifyInterfacesPFCCounters, "failure-specific-interface"): {
6628 "eos_data": [
6629 {
6630 "interfaceCounters": {
6631 "Ethernet3/2/1": {
6632 "rxFrames": 1,
6633 "txFrames": 2,
6634 },
6635 "Ethernet3/3/1": {"rxFrames": 2, "txFrames": 0},
6636 "Ethernet3/4/1": {"rxFrames": 0, "txFrames": 2},
6637 }
6638 }
6639 ],
6640 "inputs": {"interfaces": ["Ethernet3/1/1", "Ethernet3/2/1"]},
6641 "expected": {
6642 "result": AntaTestStatus.FAILURE,
6643 "messages": [
6644 "Interface: Ethernet3/1/1 - Not found",
6645 "Interface: Ethernet3/2/1 - Counters above threshold - Expected: <= 0 Actual RX PFC: 1 Actual TX PFC: 2",
6646 ],
6647 },
6648 },
6649 }