Debian Codegraph @

tests/units/anta_tests/test_hardware.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.hardware."""
5 # pylint: disable=too-many-lines
6 # TODO: Cleanup unused data or move some tests to another module
7
8 from __future__ import annotations
9
10 import sys
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.hardware import (
16 VerifyAbsenceOfLinecards,
17 VerifyAdverseDrops,
18 VerifyChassisHealth,
19 VerifyEnvironmentCooling,
20 VerifyEnvironmentPower,
21 VerifyEnvironmentSystemCooling,
22 VerifyHardwareCapacityUtilization,
23 VerifyInventory,
24 VerifyModuleStatus,
25 VerifyPCIeErrors,
26 VerifySupervisorRedundancy,
27 VerifyTemperature,
28 VerifyTransceiversManufacturers,
29 VerifyTransceiversTemperature,
30 )
31 from tests.units.anta_tests import test
32
33 if TYPE_CHECKING:
34 from tests.units.anta_tests import AntaUnitTestData
35
36 DATA: AntaUnitTestData = {
37 (VerifyTransceiversManufacturers, "success"): {
38 "eos_data": [
39 {
40 "xcvrSlots": {
41 "1": {"mfgName": "Arista Networks", "modelName": "QSFP-100G-DR", "serialNum": "XKT203501340", "hardwareRev": "21"},
42 "2": {"mfgName": "Arista Networks", "modelName": "QSFP-100G-DR", "serialNum": "XKT203501337", "hardwareRev": "21"},
43 }
44 }
45 ],
46 "inputs": {"manufacturers": ["Arista Networks"]},
47 "expected": {
48 "result": AntaTestStatus.SUCCESS,
49 "atomic_results": [
50 {
51 "description": "Port: 1",
52 "result": AntaTestStatus.SUCCESS,
53 },
54 {
55 "description": "Port: 2",
56 "result": AntaTestStatus.SUCCESS,
57 },
58 ],
59 },
60 },
61 (VerifyTransceiversManufacturers, "success-multi-chasis"): {
62 "eos_data": [
63 {
64 "xcvrSlots": {
65 "2/1": {
66 "mfgName": "Arista Networks",
67 },
68 "2/2": {
69 "mfgName": "Arista Networks",
70 },
71 }
72 }
73 ],
74 "inputs": {"manufacturers": ["Arista Networks"]},
75 "expected": {
76 "result": AntaTestStatus.SUCCESS,
77 "atomic_results": [
78 {
79 "description": "Port: 2/1",
80 "result": AntaTestStatus.SUCCESS,
81 },
82 {
83 "description": "Port: 2/2",
84 "result": AntaTestStatus.SUCCESS,
85 },
86 ],
87 },
88 },
89 (VerifyTransceiversManufacturers, "failure"): {
90 "eos_data": [
91 {
92 "xcvrSlots": {
93 "1": {"mfgName": "Arista Networks", "modelName": "QSFP-100G-DR", "serialNum": "XKT203501340", "hardwareRev": "21"},
94 "2": {"mfgName": "Arista Networks", "modelName": "QSFP-100G-DR", "serialNum": "XKT203501337", "hardwareRev": "21"},
95 }
96 }
97 ],
98 "inputs": {"manufacturers": ["Arista"]},
99 "expected": {
100 "result": AntaTestStatus.FAILURE,
101 "messages": [
102 "Port: 1 - Transceiver is from unapproved manufacturers - Expected: Arista Actual: Arista Networks",
103 "Port: 2 - Transceiver is from unapproved manufacturers - Expected: Arista Actual: Arista Networks",
104 ],
105 "atomic_results": [
106 {
107 "description": "Port: 1",
108 "result": AntaTestStatus.FAILURE,
109 "messages": ["Transceiver is from unapproved manufacturers - Expected: Arista Actual: Arista Networks"],
110 },
111 {
112 "description": "Port: 2",
113 "result": AntaTestStatus.FAILURE,
114 "messages": ["Transceiver is from unapproved manufacturers - Expected: Arista Actual: Arista Networks"],
115 },
116 ],
117 },
118 },
119 (VerifyTransceiversManufacturers, "failure-unsupported"): {
120 "eos_data": [
121 {
122 "xcvrSlots": {
123 "1": {"mfgName": "", "modelName": "", "serialNum": "", "hardwareRev": ""},
124 }
125 }
126 ],
127 "inputs": {"manufacturers": ["Arista"]},
128 "expected": {
129 "result": AntaTestStatus.FAILURE,
130 "messages": [
131 "Port: 1 - Manufacturer name is not available - This may indicate an unsupported or faulty transceiver",
132 ],
133 "atomic_results": [
134 {
135 "description": "Port: 1",
136 "result": AntaTestStatus.FAILURE,
137 "messages": ["Manufacturer name is not available - This may indicate an unsupported or faulty transceiver"],
138 },
139 ],
140 },
141 },
142 (VerifyTransceiversManufacturers, "success-allow-not-present"): {
143 "eos_data": [
144 {
145 "xcvrSlots": {
146 "1": {"mfgName": "Arista Networks"},
147 "2": {"mfgName": "Not Present"},
148 }
149 }
150 ],
151 "inputs": {"manufacturers": ["Arista Networks"], "allow_not_present": True},
152 "expected": {
153 "result": AntaTestStatus.SUCCESS,
154 "atomic_results": [
155 {
156 "description": "Port: 1",
157 "result": AntaTestStatus.SUCCESS,
158 },
159 ],
160 },
161 },
162 (VerifyTransceiversManufacturers, "failure-not-present-not-allowed"): {
163 "eos_data": [
164 {
165 "xcvrSlots": {
166 "1": {"mfgName": "Arista Networks"},
167 "2": {"mfgName": "Not Present"},
168 }
169 }
170 ],
171 "inputs": {"manufacturers": ["Arista Networks"], "allow_not_present": False},
172 "expected": {
173 "result": AntaTestStatus.FAILURE,
174 "messages": [
175 "Port: 2 - Transceiver is from unapproved manufacturers - Expected: Arista Networks Actual: Not Present",
176 ],
177 "atomic_results": [
178 {
179 "description": "Port: 1",
180 "result": AntaTestStatus.SUCCESS,
181 },
182 {
183 "description": "Port: 2",
184 "result": AntaTestStatus.FAILURE,
185 "messages": ["Transceiver is from unapproved manufacturers - Expected: Arista Networks Actual: Not Present"],
186 },
187 ],
188 },
189 },
190 (VerifyTemperature, "success"): {
191 "eos_data": [
192 {
193 "systemStatus": "temperatureOk",
194 "ambientThreshold": 45,
195 "tempSensors": [
196 {
197 "name": "TempSensor1",
198 "description": "Cpu temp sensor",
199 "overheatThreshold": 90.0,
200 "criticalThreshold": 95.0,
201 "hwStatus": "ok",
202 "currentTemperature": 52.85271955304604,
203 },
204 {
205 "name": "TempSensor2",
206 "description": "Switch card temp sensor",
207 "overheatThreshold": 75.0,
208 "criticalThreshold": 85.0,
209 "hwStatus": "ok",
210 "currentTemperature": 45.875,
211 },
212 ],
213 "powerSupplySlots": [
214 {
215 "relPos": "1",
216 "entPhysicalClass": "PowerSupply",
217 "tempSensors": [
218 {
219 "name": "TempSensorP1/1",
220 "description": "Hotspot",
221 "overheatThreshold": 95.0,
222 "criticalThreshold": 100.0,
223 "targetTemperature": 80.0,
224 "hwStatus": "ok",
225 "currentTemperature": 54.0,
226 },
227 {
228 "relPos": "2",
229 "name": "TempSensorP1/2",
230 "description": "Inlet",
231 "overheatThreshold": 70.0,
232 "criticalThreshold": 75.0,
233 "targetTemperature": 55.0,
234 "hwStatus": "ok",
235 "currentTemperature": 44.0,
236 },
237 ],
238 },
239 {
240 "relPos": "2",
241 "entPhysicalClass": "PowerSupply",
242 "tempSensors": [
243 {
244 "relPos": "1",
245 "name": "TempSensorP2/1",
246 "description": "Hotspot",
247 "overheatThreshold": 95.0,
248 "criticalThreshold": 100.0,
249 "hwStatus": "ok",
250 "currentTemperature": 60.0,
251 },
252 {
253 "name": "TempSensorP2/2",
254 "description": "Inlet",
255 "overheatThreshold": 70.0,
256 "criticalThreshold": 75.0,
257 "targetTemperature": 55.0,
258 "hwStatus": "ok",
259 "currentTemperature": 49.0,
260 },
261 ],
262 },
263 ],
264 "cardSlots": [
265 {
266 "relPos": "2",
267 "entPhysicalClass": "Supervisor",
268 "tempSensors": [
269 {
270 "relPos": "1",
271 "name": "TempSensor2/1",
272 "description": "Digital Temperature Sensor on cpu0",
273 "overheatThreshold": 95.0,
274 "criticalThreshold": 105.0,
275 "targetTemperature": 65.0,
276 "hwStatus": "ok",
277 "currentTemperature": 34.0,
278 },
279 {
280 "relPos": "2",
281 "name": "TempSensor2/2",
282 "description": "Digital Temperature Sensor on cpu1",
283 "overheatThreshold": 95.0,
284 "criticalThreshold": 105.0,
285 "targetTemperature": 65.0,
286 "hwStatus": "ok",
287 "currentTemperature": 34.0,
288 },
289 {
290 "relPos": "8",
291 "name": "TempSensor2/8",
292 "description": "Digital Temperature Sensor on cpu7",
293 "overheatThreshold": 95.0,
294 "criticalThreshold": 105.0,
295 "targetTemperature": 65.0,
296 "hwStatus": "ok",
297 "currentTemperature": 34.0,
298 },
299 ],
300 },
301 {
302 "relPos": "3",
303 "entPhysicalClass": "Linecard",
304 "tempSensors": [
305 {
306 "relPos": "5",
307 "name": "TempSensor3/5",
308 "description": "Board rear sensor",
309 "overheatThreshold": 90.0,
310 "criticalThreshold": 100.0,
311 "targetTemperature": 65.0,
312 "hwStatus": "ok",
313 "currentTemperature": 25.625,
314 },
315 {
316 "relPos": "6",
317 "name": "TempSensor3/6",
318 "description": "Board front sensor",
319 "overheatThreshold": 75.0,
320 "criticalThreshold": 85.0,
321 "targetTemperature": 60.0,
322 "hwStatus": "ok",
323 "currentTemperature": 25.375,
324 },
325 ],
326 },
327 ],
328 }
329 ],
330 "expected": {"result": AntaTestStatus.SUCCESS},
331 },
332 (VerifyTemperature, "success-check-sensors-status-true"): {
333 "eos_data": [
334 {
335 "systemStatus": "temperatureOk",
336 "ambientThreshold": 45,
337 "tempSensors": [
338 {
339 "name": "TempSensor1",
340 "description": "Cpu temp sensor",
341 "overheatThreshold": 90.0,
342 "criticalThreshold": 95.0,
343 "hwStatus": "ok",
344 "currentTemperature": 52.85271955304604,
345 },
346 {
347 "name": "TempSensor2",
348 "description": "Switch card temp sensor",
349 "overheatThreshold": 75.0,
350 "criticalThreshold": 85.0,
351 "hwStatus": "ok",
352 "currentTemperature": 45.875,
353 },
354 ],
355 "powerSupplySlots": [
356 {
357 "relPos": "1",
358 "entPhysicalClass": "PowerSupply",
359 "tempSensors": [
360 {
361 "name": "TempSensorP1/1",
362 "description": "Hotspot",
363 "overheatThreshold": 95.0,
364 "criticalThreshold": 100.0,
365 "targetTemperature": 80.0,
366 "hwStatus": "ok",
367 "currentTemperature": 54.0,
368 },
369 {
370 "relPos": "2",
371 "name": "TempSensorP1/2",
372 "description": "Inlet",
373 "overheatThreshold": 70.0,
374 "criticalThreshold": 75.0,
375 "targetTemperature": 55.0,
376 "hwStatus": "ok",
377 "currentTemperature": 44.0,
378 },
379 ],
380 },
381 {
382 "relPos": "2",
383 "entPhysicalClass": "PowerSupply",
384 "tempSensors": [
385 {
386 "relPos": "1",
387 "name": "TempSensorP2/1",
388 "description": "Hotspot",
389 "overheatThreshold": 95.0,
390 "criticalThreshold": 100.0,
391 "hwStatus": "ok",
392 "currentTemperature": 60.0,
393 },
394 {
395 "name": "TempSensorP2/2",
396 "description": "Inlet",
397 "overheatThreshold": 70.0,
398 "criticalThreshold": 75.0,
399 "targetTemperature": 55.0,
400 "hwStatus": "ok",
401 "currentTemperature": 49.0,
402 },
403 ],
404 },
405 ],
406 "cardSlots": [
407 {
408 "relPos": "2",
409 "entPhysicalClass": "Supervisor",
410 "tempSensors": [
411 {
412 "relPos": "1",
413 "name": "TempSensor2/1",
414 "description": "Digital Temperature Sensor on cpu0",
415 "overheatThreshold": 95.0,
416 "criticalThreshold": 105.0,
417 "targetTemperature": 65.0,
418 "hwStatus": "ok",
419 "currentTemperature": 34.0,
420 },
421 {
422 "relPos": "2",
423 "name": "TempSensor2/2",
424 "description": "Digital Temperature Sensor on cpu1",
425 "overheatThreshold": 95.0,
426 "criticalThreshold": 105.0,
427 "targetTemperature": 65.0,
428 "hwStatus": "ok",
429 "currentTemperature": 34.0,
430 },
431 ],
432 },
433 {
434 "relPos": "3",
435 "entPhysicalClass": "Linecard",
436 "tempSensors": [
437 {
438 "relPos": "5",
439 "name": "TempSensor3/5",
440 "description": "Board rear sensor",
441 "overheatThreshold": 90.0,
442 "criticalThreshold": 100.0,
443 "targetTemperature": 65.0,
444 "hwStatus": "ok",
445 "currentTemperature": 25.625,
446 },
447 {
448 "relPos": "6",
449 "name": "TempSensor3/6",
450 "description": "Board front sensor",
451 "overheatThreshold": 75.0,
452 "criticalThreshold": 85.0,
453 "targetTemperature": 60.0,
454 "hwStatus": "ok",
455 "currentTemperature": 25.375,
456 },
457 ],
458 },
459 ],
460 }
461 ],
462 "inputs": {"check_temp_sensors": True},
463 "expected": {"result": AntaTestStatus.SUCCESS},
464 },
465 (VerifyTemperature, "failure-hw-status-high-temp"): {
466 "eos_data": [
467 {
468 "systemStatus": "temperatureOk",
469 "ambientThreshold": 45,
470 "tempSensors": [
471 {
472 "name": "TempSensor1",
473 "description": "Cpu temp sensor",
474 "overheatThreshold": 90.0,
475 "criticalThreshold": 95.0,
476 "hwStatus": "ok",
477 "currentTemperature": 93.85271955304604,
478 },
479 {
480 "name": "TempSensor2",
481 "description": "Switch card temp sensor",
482 "overheatThreshold": 75.0,
483 "criticalThreshold": 85.0,
484 "hwStatus": "ok",
485 "currentTemperature": 74.875,
486 },
487 ],
488 "powerSupplySlots": [
489 {
490 "relPos": "1",
491 "entPhysicalClass": "PowerSupply",
492 "tempSensors": [
493 {
494 "name": "TempSensorP1/1",
495 "description": "Hotspot",
496 "overheatThreshold": 90.0,
497 "criticalThreshold": 100.0,
498 "targetTemperature": 80.0,
499 "hwStatus": "ok",
500 "currentTemperature": 68.171875,
501 },
502 {
503 "relPos": "2",
504 "name": "TempSensorP1/2",
505 "description": "Inlet",
506 "overheatThreshold": 70.0,
507 "criticalThreshold": 75.0,
508 "targetTemperature": 55.0,
509 "hwStatus": "ok",
510 "currentTemperature": 68.0,
511 },
512 ],
513 },
514 {
515 "relPos": "2",
516 "entPhysicalClass": "PowerSupply",
517 "tempSensors": [
518 {
519 "relPos": "1",
520 "name": "TempSensorP2/1",
521 "description": "Hotspot",
522 "overheatThreshold": 95.0,
523 "criticalThreshold": 100.0,
524 "hwStatus": "ok",
525 "currentTemperature": 83.0,
526 },
527 {
528 "name": "TempSensorP2/2",
529 "description": "Inlet",
530 "overheatThreshold": 70.0,
531 "criticalThreshold": 75.0,
532 "targetTemperature": 55.0,
533 "hwStatus": "ok",
534 "currentTemperature": 49.0,
535 },
536 ],
537 },
538 ],
539 "cardSlots": [
540 {
541 "relPos": "2",
542 "entPhysicalClass": "Supervisor",
543 "tempSensors": [
544 {
545 "relPos": "1",
546 "name": "TempSensor2/1",
547 "description": "Digital Temperature Sensor on cpu0",
548 "overheatThreshold": 95.0,
549 "criticalThreshold": 105.0,
550 "targetTemperature": 65.0,
551 "hwStatus": "ok",
552 "currentTemperature": 51.0,
553 },
554 {
555 "relPos": "2",
556 "name": "TempSensor2/2",
557 "description": "Digital Temperature Sensor on cpu1",
558 "overheatThreshold": 95.0,
559 "criticalThreshold": 105.0,
560 "targetTemperature": 65.0,
561 "hwStatus": "ok",
562 "currentTemperature": 34.0,
563 },
564 ],
565 },
566 {
567 "relPos": "3",
568 "entPhysicalClass": "Linecard",
569 "tempSensors": [
570 {
571 "relPos": "5",
572 "name": "TempSensor3/5",
573 "description": "Board rear sensor",
574 "overheatThreshold": 90.0,
575 "criticalThreshold": 100.0,
576 "targetTemperature": 65.0,
577 "hwStatus": "ok",
578 "currentTemperature": 25.625,
579 },
580 {
581 "relPos": "6",
582 "name": "TempSensor3/6",
583 "description": "Board front sensor",
584 "overheatThreshold": 75.0,
585 "criticalThreshold": 85.0,
586 "targetTemperature": 60.0,
587 "hwStatus": "ok",
588 "currentTemperature": 72.375,
589 },
590 ],
591 },
592 ],
593 }
594 ],
595 "inputs": {"check_temp_sensors": True},
596 "expected": {
597 "result": AntaTestStatus.FAILURE,
598 "messages": [
599 "Sensor: TempSensor1 Description: Cpu temp sensor - Temperature is getting high - Expected: <= 85.00°C (Overheat: 90.00°C - Margin: 5°C) "
600 "Actual: 93.85°C",
601 "Sensor: TempSensor2 Description: Switch card temp sensor - Temperature is getting high - Expected: <= 70.00°C (Overheat: 75.00°C - Margin: 5°C) "
602 "Actual: 74.88°C",
603 "Sensor: TempSensorP1/2 Description: Inlet - Temperature is getting high - Expected: <= 65.00°C (Overheat: 70.00°C - Margin: 5°C) Actual: 68.00°C",
604 "Sensor: TempSensor3/6 Description: Board front sensor - Temperature is getting high - Expected: <= 70.00°C (Overheat: 75.00°C - Margin: 5°C) "
605 "Actual: 72.38°C",
606 ],
607 },
608 },
609 (VerifyTemperature, "failure-temperature-status"): {
610 "eos_data": [
611 {
612 "systemStatus": "temperatureCritical",
613 "ambientThreshold": 45,
614 "tempSensors": [
615 {
616 "name": "TempSensor1",
617 "description": "Cpu temp sensor",
618 "overheatThreshold": 90.0,
619 "criticalThreshold": 95.0,
620 "hwStatus": "ok",
621 "currentTemperature": 52.85271955304604,
622 },
623 ],
624 "powerSupplySlots": [
625 {
626 "relPos": "1",
627 "entPhysicalClass": "PowerSupply",
628 "tempSensors": [
629 {
630 "name": "TempSensorP1/1",
631 "description": "Hotspot",
632 "overheatThreshold": 55.0,
633 "criticalThreshold": 100.0,
634 "targetTemperature": 80.0,
635 "hwStatus": "ok",
636 "currentTemperature": 54.0,
637 },
638 ],
639 },
640 {
641 "relPos": "2",
642 "entPhysicalClass": "PowerSupply",
643 "tempSensors": [
644 {
645 "relPos": "1",
646 "name": "TempSensorP2/1",
647 "description": "Hotspot",
648 "overheatThreshold": 95.0,
649 "criticalThreshold": 100.0,
650 "hwStatus": "ok",
651 "currentTemperature": 60.0,
652 },
653 ],
654 },
655 ],
656 "cardSlots": [
657 {
658 "relPos": "2",
659 "entPhysicalClass": "Supervisor",
660 "tempSensors": [
661 {
662 "relPos": "1",
663 "name": "TempSensor2/1",
664 "description": "Digital Temperature Sensor on cpu0",
665 "overheatThreshold": 95.0,
666 "criticalThreshold": 105.0,
667 "targetTemperature": 65.0,
668 "hwStatus": "ok",
669 "currentTemperature": 34.0,
670 },
671 ],
672 },
673 {
674 "relPos": "3",
675 "entPhysicalClass": "Linecard",
676 "tempSensors": [
677 {
678 "relPos": "5",
679 "name": "TempSensor3/5",
680 "description": "Board rear sensor",
681 "overheatThreshold": 90.0,
682 "criticalThreshold": 100.0,
683 "targetTemperature": 65.0,
684 "hwStatus": "ok",
685 "currentTemperature": 25.625,
686 },
687 ],
688 },
689 ],
690 }
691 ],
692 "inputs": {"failure_margin": 6},
693 "expected": {
694 "result": AntaTestStatus.FAILURE,
695 "messages": ["Device temperature exceeds acceptable limits - Expected: temperatureOk Actual: temperatureCritical"],
696 },
697 },
698 (VerifyTemperature, "failure-hardware-status"): {
699 "eos_data": [
700 {
701 "systemStatus": "temperatureOk",
702 "ambientThreshold": 45,
703 "tempSensors": [
704 {
705 "name": "TempSensor1",
706 "description": "Cpu temp sensor",
707 "overheatThreshold": 90.0,
708 "criticalThreshold": 95.0,
709 "hwStatus": "disabled",
710 },
711 ],
712 "powerSupplySlots": [
713 {
714 "relPos": "1",
715 "entPhysicalClass": "PowerSupply",
716 "tempSensors": [
717 {
718 "name": "TempSensorP1/1",
719 "description": "Hotspot",
720 "overheatThreshold": 55.0,
721 "criticalThreshold": 100.0,
722 "targetTemperature": 80.0,
723 "hwStatus": "ok",
724 "currentTemperature": 34.0,
725 },
726 ],
727 },
728 {
729 "relPos": "2",
730 "entPhysicalClass": "PowerSupply",
731 "tempSensors": [
732 {
733 "relPos": "1",
734 "name": "TempSensorP2/1",
735 "description": "Hotspot",
736 "overheatThreshold": 95.0,
737 "criticalThreshold": 100.0,
738 "hwStatus": "disabled",
739 },
740 ],
741 },
742 ],
743 "cardSlots": [
744 {
745 "relPos": "2",
746 "entPhysicalClass": "Supervisor",
747 "tempSensors": [
748 {
749 "relPos": "1",
750 "name": "TempSensor2/1",
751 "description": "Digital Temperature Sensor on cpu0",
752 "overheatThreshold": 95.0,
753 "criticalThreshold": 105.0,
754 "targetTemperature": 65.0,
755 "hwStatus": "disabled",
756 },
757 ],
758 },
759 ],
760 }
761 ],
762 "inputs": {"failure_margin": 6, "check_temp_sensors": True},
763 "expected": {
764 "result": AntaTestStatus.FAILURE,
765 "messages": [
766 "Sensor: TempSensor1 Description: Cpu temp sensor - Invalid hardware status - Expected: ok Actual: disabled",
767 "Sensor: TempSensorP2/1 Description: Hotspot - Invalid hardware status - Expected: ok Actual: disabled",
768 "Sensor: TempSensor2/1 Description: Digital Temperature Sensor on cpu0 - Invalid hardware status - Expected: ok Actual: disabled",
769 ],
770 },
771 },
772 (VerifyTemperature, "failure-all"): {
773 "eos_data": [
774 {
775 "systemStatus": "temperatureCritical",
776 "ambientThreshold": 45,
777 "tempSensors": [
778 {
779 "name": "TempSensor1",
780 "description": "Cpu temp sensor",
781 "overheatThreshold": 90.0,
782 "criticalThreshold": 95.0,
783 "hwStatus": "failed",
784 "currentTemperature": 52.85271955304604,
785 },
786 {
787 "name": "TempSensor2",
788 "description": "Switch card temp sensor",
789 "overheatThreshold": 75.0,
790 "criticalThreshold": 85.0,
791 "hwStatus": "ok",
792 "currentTemperature": 45.875,
793 },
794 ],
795 "powerSupplySlots": [
796 {
797 "relPos": "1",
798 "entPhysicalClass": "PowerSupply",
799 "tempSensors": [
800 {
801 "name": "TempSensorP1/1",
802 "description": "Hotspot",
803 "overheatThreshold": 55.0,
804 "criticalThreshold": 100.0,
805 "targetTemperature": 80.0,
806 "hwStatus": "failed",
807 "currentTemperature": 54.0,
808 },
809 {
810 "relPos": "2",
811 "name": "TempSensorP1/2",
812 "description": "Inlet",
813 "overheatThreshold": 70.0,
814 "criticalThreshold": 50.0,
815 "targetTemperature": 55.0,
816 "hwStatus": "ok",
817 "currentTemperature": 44.0,
818 },
819 ],
820 },
821 {
822 "relPos": "2",
823 "entPhysicalClass": "PowerSupply",
824 "tempSensors": [
825 {
826 "relPos": "1",
827 "name": "TempSensorP2/1",
828 "description": "Hotspot",
829 "overheatThreshold": 95.0,
830 "criticalThreshold": 100.0,
831 "hwStatus": "ok",
832 "currentTemperature": 60.0,
833 },
834 {
835 "name": "TempSensorP2/2",
836 "description": "Inlet",
837 "overheatThreshold": 60.0,
838 "criticalThreshold": 75.0,
839 "targetTemperature": 55.0,
840 "hwStatus": "ok",
841 "currentTemperature": 34.0,
842 },
843 ],
844 },
845 ],
846 "cardSlots": [
847 {
848 "relPos": "2",
849 "entPhysicalClass": "Supervisor",
850 "tempSensors": [
851 {
852 "relPos": "1",
853 "name": "TempSensor2/1",
854 "description": "Digital Temperature Sensor on cpu0",
855 "overheatThreshold": 95.0,
856 "criticalThreshold": 105.0,
857 "targetTemperature": 65.0,
858 "hwStatus": "ok",
859 "currentTemperature": 34.0,
860 },
861 {
862 "relPos": "2",
863 "name": "TempSensor2/2",
864 "description": "Digital Temperature Sensor on cpu1",
865 "overheatThreshold": 95.0,
866 "criticalThreshold": 105.0,
867 "targetTemperature": 65.0,
868 "hwStatus": "ok",
869 "currentTemperature": 93.0,
870 },
871 {
872 "relPos": "8",
873 "name": "TempSensor2/8",
874 "description": "Digital Temperature Sensor on cpu7",
875 "overheatThreshold": 95.0,
876 "criticalThreshold": 105.0,
877 "targetTemperature": 65.0,
878 "hwStatus": "ok",
879 "currentTemperature": 60.0,
880 },
881 ],
882 },
883 {
884 "relPos": "3",
885 "entPhysicalClass": "Linecard",
886 "tempSensors": [
887 {
888 "relPos": "5",
889 "name": "TempSensor3/5",
890 "description": "Board rear sensor",
891 "overheatThreshold": 90.0,
892 "criticalThreshold": 100.0,
893 "targetTemperature": 65.0,
894 "hwStatus": "ok",
895 "currentTemperature": 25.625,
896 },
897 {
898 "relPos": "6",
899 "name": "TempSensor3/6",
900 "description": "Board front sensor",
901 "overheatThreshold": 75.0,
902 "criticalThreshold": 85.0,
903 "targetTemperature": 60.0,
904 "hwStatus": "ok",
905 "currentTemperature": 25.375,
906 },
907 ],
908 },
909 ],
910 }
911 ],
912 "inputs": {"check_temp_sensors": True},
913 "expected": {
914 "result": AntaTestStatus.FAILURE,
915 "messages": [
916 "Device temperature exceeds acceptable limits - Expected: temperatureOk Actual: temperatureCritical",
917 "Sensor: TempSensor1 Description: Cpu temp sensor - Invalid hardware status - Expected: ok Actual: failed",
918 "Sensor: TempSensorP1/1 Description: Hotspot - Invalid hardware status - Expected: ok Actual: failed",
919 "Sensor: TempSensor2/2 Description: Digital Temperature Sensor on cpu1 - Temperature is getting high - "
920 "Expected: <= 90.00°C (Overheat: 95.00°C - Margin: 5°C) Actual: 93.00°C",
921 ],
922 },
923 },
924 (VerifyTransceiversTemperature, "success"): {
925 "eos_data": [
926 {
927 "tempSensors": [
928 {
929 "maxTemperature": 25.03125,
930 "maxTemperatureLastChange": 1682509618.2227979,
931 "hwStatus": "ok",
932 "alertCount": 0,
933 "description": "Xcvr54 temp sensor",
934 "overheatThreshold": 70.0,
935 "criticalThreshold": 70.0,
936 "inAlertState": False,
937 "targetTemperature": 62.0,
938 "relPos": "54",
939 "currentTemperature": 24.171875,
940 "setPointTemperature": 61.8,
941 "pidDriverCount": 0,
942 "isPidDriver": False,
943 "name": "DomTemperatureSensor54",
944 }
945 ],
946 "cardSlots": [],
947 }
948 ],
949 "expected": {
950 "result": AntaTestStatus.SUCCESS,
951 "atomic_results": [
952 {
953 "description": "Sensor: DomTemperatureSensor54",
954 "result": AntaTestStatus.SUCCESS,
955 }
956 ],
957 },
958 },
959 (VerifyTransceiversTemperature, "failure-hwStatus"): {
960 "eos_data": [
961 {
962 "tempSensors": [
963 {
964 "maxTemperature": 25.03125,
965 "maxTemperatureLastChange": 1682509618.2227979,
966 "hwStatus": "failed",
967 "alertCount": 0,
968 "description": "Xcvr54 temp sensor",
969 "overheatThreshold": 70.0,
970 "criticalThreshold": 70.0,
971 "inAlertState": False,
972 "targetTemperature": 62.0,
973 "relPos": "54",
974 "currentTemperature": 24.171875,
975 "setPointTemperature": 61.8,
976 "pidDriverCount": 0,
977 "isPidDriver": False,
978 "name": "DomTemperatureSensor54",
979 }
980 ],
981 "cardSlots": [],
982 }
983 ],
984 "expected": {
985 "result": AntaTestStatus.FAILURE,
986 "messages": ["Sensor: DomTemperatureSensor54 - Invalid hardware state - Expected: ok Actual: failed"],
987 "atomic_results": [
988 {
989 "description": "Sensor: DomTemperatureSensor54",
990 "result": AntaTestStatus.FAILURE,
991 "messages": ["Invalid hardware state - Expected: ok Actual: failed"],
992 }
993 ],
994 },
995 },
996 (VerifyTransceiversTemperature, "failure-alertCount"): {
997 "eos_data": [
998 {
999 "tempSensors": [
1000 {
1001 "maxTemperature": 25.03125,
1002 "maxTemperatureLastChange": 1682509618.2227979,
1003 "hwStatus": "ok",
1004 "alertCount": 1,
1005 "description": "Xcvr54 temp sensor",
1006 "overheatThreshold": 70.0,
1007 "criticalThreshold": 70.0,
1008 "inAlertState": False,
1009 "targetTemperature": 62.0,
1010 "relPos": "54",
1011 "currentTemperature": 24.171875,
1012 "setPointTemperature": 61.8,
1013 "pidDriverCount": 0,
1014 "isPidDriver": False,
1015 "name": "DomTemperatureSensor54",
1016 }
1017 ],
1018 "cardSlots": [],
1019 }
1020 ],
1021 "expected": {
1022 "result": AntaTestStatus.FAILURE,
1023 "messages": ["Sensor: DomTemperatureSensor54 - Incorrect alert counter - Expected: 0 Actual: 1"],
1024 "atomic_results": [
1025 {"description": "Sensor: DomTemperatureSensor54", "result": AntaTestStatus.FAILURE, "messages": ["Incorrect alert counter - Expected: 0 Actual: 1"]}
1026 ],
1027 },
1028 },
1029 (VerifyTransceiversTemperature, "failure-both"): {
1030 "eos_data": [
1031 {
1032 "tempSensors": [
1033 {
1034 "maxTemperature": 25.03125,
1035 "maxTemperatureLastChange": 1682509618.2227979,
1036 "hwStatus": "failed",
1037 "alertCount": 2,
1038 "description": "Xcvr54 temp sensor",
1039 "overheatThreshold": 70.0,
1040 "criticalThreshold": 70.0,
1041 "inAlertState": False,
1042 "targetTemperature": 62.0,
1043 "relPos": "54",
1044 "currentTemperature": 24.171875,
1045 "setPointTemperature": 61.8,
1046 "pidDriverCount": 0,
1047 "isPidDriver": False,
1048 "name": "DomTemperatureSensor54",
1049 }
1050 ],
1051 "cardSlots": [],
1052 }
1053 ],
1054 "expected": {
1055 "result": AntaTestStatus.FAILURE,
1056 "messages": [
1057 "Sensor: DomTemperatureSensor54 - Invalid hardware state - Expected: ok Actual: failed",
1058 "Sensor: DomTemperatureSensor54 - Incorrect alert counter - Expected: 0 Actual: 2",
1059 ],
1060 "atomic_results": [
1061 {
1062 "description": "Sensor: DomTemperatureSensor54",
1063 "result": AntaTestStatus.FAILURE,
1064 "messages": [
1065 "Invalid hardware state - Expected: ok Actual: failed",
1066 "Incorrect alert counter - Expected: 0 Actual: 2",
1067 ],
1068 }
1069 ],
1070 },
1071 },
1072 (VerifyEnvironmentSystemCooling, "success"): {
1073 "eos_data": [
1074 {
1075 "defaultZones": False,
1076 "numCoolingZones": [],
1077 "coolingMode": "automatic",
1078 "ambientTemperature": 24.5,
1079 "shutdownOnInsufficientFans": True,
1080 "airflowDirection": "frontToBackAirflow",
1081 "overrideFanSpeed": 0,
1082 "powerSupplySlots": [],
1083 "fanTraySlots": [],
1084 "minFanSpeed": 0,
1085 "currentZones": 1,
1086 "configuredZones": 0,
1087 "systemStatus": "coolingOk",
1088 }
1089 ],
1090 "expected": {"result": AntaTestStatus.SUCCESS},
1091 },
1092 (VerifyEnvironmentSystemCooling, "failure"): {
1093 "eos_data": [
1094 {
1095 "defaultZones": False,
1096 "numCoolingZones": [],
1097 "coolingMode": "automatic",
1098 "ambientTemperature": 24.5,
1099 "shutdownOnInsufficientFans": True,
1100 "airflowDirection": "frontToBackAirflow",
1101 "overrideFanSpeed": 0,
1102 "powerSupplySlots": [],
1103 "fanTraySlots": [],
1104 "minFanSpeed": 0,
1105 "currentZones": 1,
1106 "configuredZones": 0,
1107 "systemStatus": "coolingKo",
1108 }
1109 ],
1110 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Device system cooling status invalid - Expected: coolingOk Actual: coolingKo"]},
1111 },
1112 (VerifyEnvironmentCooling, "success"): {
1113 "eos_data": [
1114 {
1115 "defaultZones": False,
1116 "numCoolingZones": [],
1117 "coolingMode": "automatic",
1118 "ambientTemperature": 24.5,
1119 "shutdownOnInsufficientFans": True,
1120 "airflowDirection": "frontToBackAirflow",
1121 "overrideFanSpeed": 0,
1122 "powerSupplySlots": [
1123 {
1124 "status": "ok",
1125 "fans": [
1126 {
1127 "status": "ok",
1128 "uptime": 1682498937.0240965,
1129 "maxSpeed": 23000,
1130 "lastSpeedStableChangeTime": 1682499033.0403435,
1131 "configuredSpeed": 30,
1132 "actualSpeed": 33,
1133 "speedHwOverride": True,
1134 "speedStable": True,
1135 "label": "PowerSupply1/1",
1136 }
1137 ],
1138 "speed": 30,
1139 "label": "PowerSupply1",
1140 },
1141 {
1142 "status": "ok",
1143 "fans": [
1144 {
1145 "status": "ok",
1146 "uptime": 1682498935.9121106,
1147 "maxSpeed": 23000,
1148 "lastSpeedStableChangeTime": 1682499092.4665174,
1149 "configuredSpeed": 30,
1150 "actualSpeed": 33,
1151 "speedHwOverride": True,
1152 "speedStable": True,
1153 "label": "PowerSupply2/1",
1154 }
1155 ],
1156 "speed": 30,
1157 "label": "PowerSupply2",
1158 },
1159 ],
1160 "fanTraySlots": [
1161 {
1162 "status": "ok",
1163 "fans": [
1164 {
1165 "status": "ok",
1166 "uptime": 1682498923.9303148,
1167 "maxSpeed": 17500,
1168 "lastSpeedStableChangeTime": 1682498975.0139885,
1169 "configuredSpeed": 30,
1170 "actualSpeed": 29,
1171 "speedHwOverride": False,
1172 "speedStable": True,
1173 "label": "1/1",
1174 }
1175 ],
1176 "speed": 30,
1177 "label": "1",
1178 },
1179 {
1180 "status": "ok",
1181 "fans": [
1182 {
1183 "status": "ok",
1184 "uptime": 1682498923.9304729,
1185 "maxSpeed": 17500,
1186 "lastSpeedStableChangeTime": 1682498939.9329433,
1187 "configuredSpeed": 30,
1188 "actualSpeed": 30,
1189 "speedHwOverride": False,
1190 "speedStable": True,
1191 "label": "2/1",
1192 }
1193 ],
1194 "speed": 30,
1195 "label": "2",
1196 },
1197 {
1198 "status": "ok",
1199 "fans": [
1200 {
1201 "status": "ok",
1202 "uptime": 1682498923.9383528,
1203 "maxSpeed": 17500,
1204 "lastSpeedStableChangeTime": 1682498975.0140095,
1205 "configuredSpeed": 30,
1206 "actualSpeed": 30,
1207 "speedHwOverride": False,
1208 "speedStable": True,
1209 "label": "3/1",
1210 }
1211 ],
1212 "speed": 30,
1213 "label": "3",
1214 },
1215 {
1216 "status": "ok",
1217 "fans": [
1218 {
1219 "status": "ok",
1220 "uptime": 1682498923.9303904,
1221 "maxSpeed": 17500,
1222 "lastSpeedStableChangeTime": 1682498975.0140295,
1223 "configuredSpeed": 30,
1224 "actualSpeed": 30,
1225 "speedHwOverride": False,
1226 "speedStable": True,
1227 "label": "4/1",
1228 }
1229 ],
1230 "speed": 30,
1231 "label": "4",
1232 },
1233 ],
1234 "minFanSpeed": 0,
1235 "currentZones": 1,
1236 "configuredZones": 0,
1237 "systemStatus": "coolingOk",
1238 }
1239 ],
1240 "inputs": {"states": ["ok"]},
1241 "expected": {
1242 "result": AntaTestStatus.SUCCESS,
1243 "atomic_results": [
1244 {
1245 "description": "Power Slot: PowerSupply1 Fan: PowerSupply1/1",
1246 "result": AntaTestStatus.SUCCESS,
1247 },
1248 {
1249 "description": "Power Slot: PowerSupply2 Fan: PowerSupply2/1",
1250 "result": AntaTestStatus.SUCCESS,
1251 },
1252 {
1253 "description": "Fan Tray: 1 Fan: 1/1",
1254 "result": AntaTestStatus.SUCCESS,
1255 },
1256 {
1257 "description": "Fan Tray: 2 Fan: 2/1",
1258 "result": AntaTestStatus.SUCCESS,
1259 },
1260 {
1261 "description": "Fan Tray: 3 Fan: 3/1",
1262 "result": AntaTestStatus.SUCCESS,
1263 },
1264 {
1265 "description": "Fan Tray: 4 Fan: 4/1",
1266 "result": AntaTestStatus.SUCCESS,
1267 },
1268 ],
1269 },
1270 },
1271 (VerifyEnvironmentCooling, "success-config-speed"): {
1272 "eos_data": [
1273 {
1274 "defaultZones": False,
1275 "numCoolingZones": [],
1276 "coolingMode": "automatic",
1277 "ambientTemperature": 24.5,
1278 "shutdownOnInsufficientFans": True,
1279 "airflowDirection": "frontToBackAirflow",
1280 "overrideFanSpeed": 0,
1281 "powerSupplySlots": [
1282 {
1283 "status": "ok",
1284 "fans": [
1285 {
1286 "status": "ok",
1287 "uptime": 1682498937.0240965,
1288 "maxSpeed": 23000,
1289 "lastSpeedStableChangeTime": 1682499033.0403435,
1290 "configuredSpeed": 30,
1291 "actualSpeed": 33,
1292 "speedHwOverride": True,
1293 "speedStable": True,
1294 "label": "PowerSupply1/1",
1295 }
1296 ],
1297 "speed": 30,
1298 "label": "PowerSupply1",
1299 },
1300 {
1301 "status": "ok",
1302 "fans": [
1303 {
1304 "status": "ok",
1305 "uptime": 1682498935.9121106,
1306 "maxSpeed": 23000,
1307 "lastSpeedStableChangeTime": 1682499092.4665174,
1308 "configuredSpeed": 30,
1309 "actualSpeed": 33,
1310 "speedHwOverride": True,
1311 "speedStable": True,
1312 "label": "PowerSupply2/1",
1313 }
1314 ],
1315 "speed": 30,
1316 "label": "PowerSupply2",
1317 },
1318 ],
1319 "fanTraySlots": [
1320 {
1321 "status": "ok",
1322 "fans": [
1323 {
1324 "status": "ok",
1325 "uptime": 1682498923.9303148,
1326 "maxSpeed": 17500,
1327 "lastSpeedStableChangeTime": 1682498975.0139885,
1328 "configuredSpeed": 30,
1329 "actualSpeed": 29,
1330 "speedHwOverride": False,
1331 "speedStable": True,
1332 "label": "1/1",
1333 }
1334 ],
1335 "speed": 30,
1336 "label": "1",
1337 },
1338 {
1339 "status": "ok",
1340 "fans": [
1341 {
1342 "status": "ok",
1343 "uptime": 1682498923.9304729,
1344 "maxSpeed": 17500,
1345 "lastSpeedStableChangeTime": 1682498939.9329433,
1346 "configuredSpeed": 30,
1347 "actualSpeed": 30,
1348 "speedHwOverride": False,
1349 "speedStable": True,
1350 "label": "2/1",
1351 }
1352 ],
1353 "speed": 30,
1354 "label": "2",
1355 },
1356 {
1357 "status": "ok",
1358 "fans": [
1359 {
1360 "status": "ok",
1361 "uptime": 1682498923.9383528,
1362 "maxSpeed": 17500,
1363 "lastSpeedStableChangeTime": 1682498975.0140095,
1364 "configuredSpeed": 30,
1365 "actualSpeed": 30,
1366 "speedHwOverride": False,
1367 "speedStable": True,
1368 "label": "3/1",
1369 }
1370 ],
1371 "speed": 30,
1372 "label": "3",
1373 },
1374 {
1375 "status": "ok",
1376 "fans": [
1377 {
1378 "status": "ok",
1379 "uptime": 1682498923.9303904,
1380 "maxSpeed": 17500,
1381 "lastSpeedStableChangeTime": 1682498975.0140295,
1382 "configuredSpeed": 30,
1383 "actualSpeed": 30,
1384 "speedHwOverride": False,
1385 "speedStable": True,
1386 "label": "4/1",
1387 }
1388 ],
1389 "speed": 30,
1390 "label": "4",
1391 },
1392 ],
1393 "minFanSpeed": 0,
1394 "currentZones": 1,
1395 "configuredZones": 0,
1396 "systemStatus": "coolingOk",
1397 }
1398 ],
1399 "inputs": {"states": ["ok"], "configured_fan_speed_limit": 80},
1400 "expected": {
1401 "result": AntaTestStatus.SUCCESS,
1402 "atomic_results": [
1403 {
1404 "description": "Power Slot: PowerSupply1 Fan: PowerSupply1/1",
1405 "result": AntaTestStatus.SUCCESS,
1406 },
1407 {
1408 "description": "Power Slot: PowerSupply2 Fan: PowerSupply2/1",
1409 "result": AntaTestStatus.SUCCESS,
1410 },
1411 {
1412 "description": "Fan Tray: 1 Fan: 1/1",
1413 "result": AntaTestStatus.SUCCESS,
1414 },
1415 {
1416 "description": "Fan Tray: 2 Fan: 2/1",
1417 "result": AntaTestStatus.SUCCESS,
1418 },
1419 {
1420 "description": "Fan Tray: 3 Fan: 3/1",
1421 "result": AntaTestStatus.SUCCESS,
1422 },
1423 {
1424 "description": "Fan Tray: 4 Fan: 4/1",
1425 "result": AntaTestStatus.SUCCESS,
1426 },
1427 ],
1428 },
1429 },
1430 (VerifyEnvironmentCooling, "success-additional-states"): {
1431 "eos_data": [
1432 {
1433 "defaultZones": False,
1434 "numCoolingZones": [],
1435 "coolingMode": "automatic",
1436 "ambientTemperature": 24.5,
1437 "shutdownOnInsufficientFans": True,
1438 "airflowDirection": "frontToBackAirflow",
1439 "overrideFanSpeed": 0,
1440 "powerSupplySlots": [
1441 {
1442 "status": "ok",
1443 "fans": [
1444 {
1445 "status": "ok",
1446 "uptime": 1682498937.0240965,
1447 "maxSpeed": 23000,
1448 "lastSpeedStableChangeTime": 1682499033.0403435,
1449 "configuredSpeed": 30,
1450 "actualSpeed": 33,
1451 "speedHwOverride": True,
1452 "speedStable": True,
1453 "label": "PowerSupply1/1",
1454 }
1455 ],
1456 "speed": 30,
1457 "label": "PowerSupply1",
1458 },
1459 {
1460 "status": "ok",
1461 "fans": [
1462 {
1463 "status": "powerLoss",
1464 "uptime": 1682498935.9121106,
1465 "maxSpeed": 23000,
1466 "lastSpeedStableChangeTime": 1682499092.4665174,
1467 "configuredSpeed": 30,
1468 "actualSpeed": 33,
1469 "speedHwOverride": True,
1470 "speedStable": True,
1471 "label": "PowerSupply2/1",
1472 }
1473 ],
1474 "speed": 30,
1475 "label": "PowerSupply2",
1476 },
1477 ],
1478 "fanTraySlots": [
1479 {
1480 "status": "ok",
1481 "fans": [
1482 {
1483 "status": "ok",
1484 "uptime": 1682498923.9303148,
1485 "maxSpeed": 17500,
1486 "lastSpeedStableChangeTime": 1682498975.0139885,
1487 "configuredSpeed": 30,
1488 "actualSpeed": 29,
1489 "speedHwOverride": False,
1490 "speedStable": True,
1491 "label": "1/1",
1492 }
1493 ],
1494 "speed": 30,
1495 "label": "1",
1496 },
1497 {
1498 "status": "ok",
1499 "fans": [
1500 {
1501 "status": "ok",
1502 "uptime": 1682498923.9304729,
1503 "maxSpeed": 17500,
1504 "lastSpeedStableChangeTime": 1682498939.9329433,
1505 "configuredSpeed": 30,
1506 "actualSpeed": 30,
1507 "speedHwOverride": False,
1508 "speedStable": True,
1509 "label": "2/1",
1510 }
1511 ],
1512 "speed": 30,
1513 "label": "2",
1514 },
1515 {
1516 "status": "ok",
1517 "fans": [
1518 {
1519 "status": "ok",
1520 "uptime": 1682498923.9383528,
1521 "maxSpeed": 17500,
1522 "lastSpeedStableChangeTime": 1682498975.0140095,
1523 "configuredSpeed": 30,
1524 "actualSpeed": 30,
1525 "speedHwOverride": False,
1526 "speedStable": True,
1527 "label": "3/1",
1528 }
1529 ],
1530 "speed": 30,
1531 "label": "3",
1532 },
1533 {
1534 "status": "ok",
1535 "fans": [
1536 {
1537 "status": "ok",
1538 "uptime": 1682498923.9303904,
1539 "maxSpeed": 17500,
1540 "lastSpeedStableChangeTime": 1682498975.0140295,
1541 "configuredSpeed": 30,
1542 "actualSpeed": 30,
1543 "speedHwOverride": False,
1544 "speedStable": True,
1545 "label": "4/1",
1546 }
1547 ],
1548 "speed": 30,
1549 "label": "4",
1550 },
1551 ],
1552 "minFanSpeed": 0,
1553 "currentZones": 1,
1554 "configuredZones": 0,
1555 "systemStatus": "coolingOk",
1556 }
1557 ],
1558 "inputs": {"states": ["ok", "powerLoss"]},
1559 "expected": {
1560 "result": AntaTestStatus.SUCCESS,
1561 "atomic_results": [
1562 {
1563 "description": "Power Slot: PowerSupply1 Fan: PowerSupply1/1",
1564 "result": AntaTestStatus.SUCCESS,
1565 },
1566 {
1567 "description": "Power Slot: PowerSupply2 Fan: PowerSupply2/1",
1568 "result": AntaTestStatus.SUCCESS,
1569 },
1570 {
1571 "description": "Fan Tray: 1 Fan: 1/1",
1572 "result": AntaTestStatus.SUCCESS,
1573 },
1574 {
1575 "description": "Fan Tray: 2 Fan: 2/1",
1576 "result": AntaTestStatus.SUCCESS,
1577 },
1578 {
1579 "description": "Fan Tray: 3 Fan: 3/1",
1580 "result": AntaTestStatus.SUCCESS,
1581 },
1582 {
1583 "description": "Fan Tray: 4 Fan: 4/1",
1584 "result": AntaTestStatus.SUCCESS,
1585 },
1586 ],
1587 },
1588 },
1589 (VerifyEnvironmentCooling, "failure-fan-tray"): {
1590 "eos_data": [
1591 {
1592 "defaultZones": False,
1593 "numCoolingZones": [],
1594 "coolingMode": "automatic",
1595 "ambientTemperature": 24.5,
1596 "shutdownOnInsufficientFans": True,
1597 "airflowDirection": "frontToBackAirflow",
1598 "overrideFanSpeed": 0,
1599 "powerSupplySlots": [
1600 {
1601 "status": "ok",
1602 "fans": [
1603 {
1604 "status": "ok",
1605 "uptime": 1682498937.0240965,
1606 "maxSpeed": 23000,
1607 "lastSpeedStableChangeTime": 1682499033.0403435,
1608 "configuredSpeed": 30,
1609 "actualSpeed": 33,
1610 "speedHwOverride": True,
1611 "speedStable": True,
1612 "label": "PowerSupply1/1",
1613 }
1614 ],
1615 "speed": 30,
1616 "label": "PowerSupply1",
1617 },
1618 {
1619 "status": "ok",
1620 "fans": [
1621 {
1622 "status": "ok",
1623 "uptime": 1682498935.9121106,
1624 "maxSpeed": 23000,
1625 "lastSpeedStableChangeTime": 1682499092.4665174,
1626 "configuredSpeed": 30,
1627 "actualSpeed": 33,
1628 "speedHwOverride": True,
1629 "speedStable": True,
1630 "label": "PowerSupply2/1",
1631 }
1632 ],
1633 "speed": 30,
1634 "label": "PowerSupply2",
1635 },
1636 ],
1637 "fanTraySlots": [
1638 {
1639 "status": "ok",
1640 "fans": [
1641 {
1642 "status": "unknownHwStatus",
1643 "uptime": 1682498923.9303148,
1644 "maxSpeed": 17500,
1645 "lastSpeedStableChangeTime": 1682498975.0139885,
1646 "configuredSpeed": 30,
1647 "actualSpeed": 29,
1648 "speedHwOverride": False,
1649 "speedStable": True,
1650 "label": "1/1",
1651 }
1652 ],
1653 "speed": 30,
1654 "label": "1",
1655 },
1656 {
1657 "status": "ok",
1658 "fans": [
1659 {
1660 "status": "ok",
1661 "uptime": 1682498923.9304729,
1662 "maxSpeed": 17500,
1663 "lastSpeedStableChangeTime": 1682498939.9329433,
1664 "configuredSpeed": 30,
1665 "actualSpeed": 30,
1666 "speedHwOverride": False,
1667 "speedStable": True,
1668 "label": "2/1",
1669 }
1670 ],
1671 "speed": 30,
1672 "label": "2",
1673 },
1674 {
1675 "status": "ok",
1676 "fans": [
1677 {
1678 "status": "powerLoss",
1679 "uptime": 1682498923.9383528,
1680 "maxSpeed": 17500,
1681 "lastSpeedStableChangeTime": 1682498975.0140095,
1682 "configuredSpeed": 30,
1683 "actualSpeed": 30,
1684 "speedHwOverride": False,
1685 "speedStable": True,
1686 "label": "3/1",
1687 }
1688 ],
1689 "speed": 30,
1690 "label": "3",
1691 },
1692 {
1693 "status": "ok",
1694 "fans": [
1695 {
1696 "status": "ok",
1697 "uptime": 1682498923.9303904,
1698 "maxSpeed": 17500,
1699 "lastSpeedStableChangeTime": 1682498975.0140295,
1700 "configuredSpeed": 30,
1701 "actualSpeed": 30,
1702 "speedHwOverride": False,
1703 "speedStable": True,
1704 "label": "4/1",
1705 }
1706 ],
1707 "speed": 30,
1708 "label": "4",
1709 },
1710 ],
1711 "minFanSpeed": 0,
1712 "currentZones": 1,
1713 "configuredZones": 0,
1714 "systemStatus": "CoolingKo",
1715 }
1716 ],
1717 "inputs": {"states": ["ok", "powerLoss"]},
1718 "expected": {
1719 "result": AntaTestStatus.FAILURE,
1720 "messages": ["Fan Tray: 1 Fan: 1/1 - Invalid state - Expected: ok, powerLoss Actual: unknownHwStatus"],
1721 "atomic_results": [
1722 {
1723 "description": "Power Slot: PowerSupply1 Fan: PowerSupply1/1",
1724 "result": AntaTestStatus.SUCCESS,
1725 },
1726 {
1727 "description": "Power Slot: PowerSupply2 Fan: PowerSupply2/1",
1728 "result": AntaTestStatus.SUCCESS,
1729 },
1730 {
1731 "description": "Fan Tray: 1 Fan: 1/1",
1732 "result": AntaTestStatus.FAILURE,
1733 "messages": ["Invalid state - Expected: ok, powerLoss Actual: unknownHwStatus"],
1734 },
1735 {
1736 "description": "Fan Tray: 2 Fan: 2/1",
1737 "result": AntaTestStatus.SUCCESS,
1738 },
1739 {
1740 "description": "Fan Tray: 3 Fan: 3/1",
1741 "result": AntaTestStatus.SUCCESS,
1742 },
1743 {
1744 "description": "Fan Tray: 4 Fan: 4/1",
1745 "result": AntaTestStatus.SUCCESS,
1746 },
1747 ],
1748 },
1749 },
1750 (VerifyEnvironmentCooling, "failure-power-supply"): {
1751 "eos_data": [
1752 {
1753 "defaultZones": False,
1754 "numCoolingZones": [],
1755 "coolingMode": "automatic",
1756 "ambientTemperature": 24.5,
1757 "shutdownOnInsufficientFans": True,
1758 "airflowDirection": "frontToBackAirflow",
1759 "overrideFanSpeed": 0,
1760 "powerSupplySlots": [
1761 {
1762 "status": "ok",
1763 "fans": [
1764 {
1765 "status": "unknownHwStatus",
1766 "uptime": 1682498937.0240965,
1767 "maxSpeed": 23000,
1768 "lastSpeedStableChangeTime": 1682499033.0403435,
1769 "configuredSpeed": 30,
1770 "actualSpeed": 33,
1771 "speedHwOverride": True,
1772 "speedStable": True,
1773 "label": "PowerSupply1/1",
1774 }
1775 ],
1776 "speed": 30,
1777 "label": "PowerSupply1",
1778 },
1779 {
1780 "status": "ok",
1781 "fans": [
1782 {
1783 "status": "ok",
1784 "uptime": 1682498935.9121106,
1785 "maxSpeed": 23000,
1786 "lastSpeedStableChangeTime": 1682499092.4665174,
1787 "configuredSpeed": 30,
1788 "actualSpeed": 33,
1789 "speedHwOverride": True,
1790 "speedStable": True,
1791 "label": "PowerSupply2/1",
1792 }
1793 ],
1794 "speed": 30,
1795 "label": "PowerSupply2",
1796 },
1797 ],
1798 "fanTraySlots": [
1799 {
1800 "status": "ok",
1801 "fans": [
1802 {
1803 "status": "ok",
1804 "uptime": 1682498923.9303148,
1805 "maxSpeed": 17500,
1806 "lastSpeedStableChangeTime": 1682498975.0139885,
1807 "configuredSpeed": 30,
1808 "actualSpeed": 29,
1809 "speedHwOverride": False,
1810 "speedStable": True,
1811 "label": "1/1",
1812 }
1813 ],
1814 "speed": 30,
1815 "label": "1",
1816 },
1817 {
1818 "status": "ok",
1819 "fans": [
1820 {
1821 "status": "ok",
1822 "uptime": 1682498923.9304729,
1823 "maxSpeed": 17500,
1824 "lastSpeedStableChangeTime": 1682498939.9329433,
1825 "configuredSpeed": 30,
1826 "actualSpeed": 30,
1827 "speedHwOverride": False,
1828 "speedStable": True,
1829 "label": "2/1",
1830 }
1831 ],
1832 "speed": 30,
1833 "label": "2",
1834 },
1835 {
1836 "status": "ok",
1837 "fans": [
1838 {
1839 "status": "powerLoss",
1840 "uptime": 1682498923.9383528,
1841 "maxSpeed": 17500,
1842 "lastSpeedStableChangeTime": 1682498975.0140095,
1843 "configuredSpeed": 30,
1844 "actualSpeed": 30,
1845 "speedHwOverride": False,
1846 "speedStable": True,
1847 "label": "3/1",
1848 }
1849 ],
1850 "speed": 30,
1851 "label": "3",
1852 },
1853 {
1854 "status": "ok",
1855 "fans": [
1856 {
1857 "status": "ok",
1858 "uptime": 1682498923.9303904,
1859 "maxSpeed": 17500,
1860 "lastSpeedStableChangeTime": 1682498975.0140295,
1861 "configuredSpeed": 30,
1862 "actualSpeed": 30,
1863 "speedHwOverride": False,
1864 "speedStable": True,
1865 "label": "4/1",
1866 }
1867 ],
1868 "speed": 30,
1869 "label": "4",
1870 },
1871 ],
1872 "minFanSpeed": 0,
1873 "currentZones": 1,
1874 "configuredZones": 0,
1875 "systemStatus": "CoolingKo",
1876 }
1877 ],
1878 "inputs": {"states": ["ok", "powerLoss"]},
1879 "expected": {
1880 "result": AntaTestStatus.FAILURE,
1881 "messages": ["Power Slot: PowerSupply1 Fan: PowerSupply1/1 - Invalid state - Expected: ok, powerLoss Actual: unknownHwStatus"],
1882 "atomic_results": [
1883 {
1884 "description": "Power Slot: PowerSupply1 Fan: PowerSupply1/1",
1885 "result": AntaTestStatus.FAILURE,
1886 "messages": ["Invalid state - Expected: ok, powerLoss Actual: unknownHwStatus"],
1887 },
1888 {
1889 "description": "Power Slot: PowerSupply2 Fan: PowerSupply2/1",
1890 "result": AntaTestStatus.SUCCESS,
1891 },
1892 {
1893 "description": "Fan Tray: 1 Fan: 1/1",
1894 "result": AntaTestStatus.SUCCESS,
1895 },
1896 {
1897 "description": "Fan Tray: 2 Fan: 2/1",
1898 "result": AntaTestStatus.SUCCESS,
1899 },
1900 {
1901 "description": "Fan Tray: 3 Fan: 3/1",
1902 "result": AntaTestStatus.SUCCESS,
1903 },
1904 {
1905 "description": "Fan Tray: 4 Fan: 4/1",
1906 "result": AntaTestStatus.SUCCESS,
1907 },
1908 ],
1909 },
1910 },
1911 (VerifyEnvironmentCooling, "failure-powe-supply-fan-configspeed"): {
1912 "eos_data": [
1913 {
1914 "defaultZones": False,
1915 "numCoolingZones": [],
1916 "coolingMode": "automatic",
1917 "ambientTemperature": 24.5,
1918 "shutdownOnInsufficientFans": True,
1919 "airflowDirection": "frontToBackAirflow",
1920 "overrideFanSpeed": 0,
1921 "powerSupplySlots": [
1922 {
1923 "status": "ok",
1924 "fans": [
1925 {
1926 "status": "ok",
1927 "uptime": 1682498937.0240965,
1928 "maxSpeed": 23000,
1929 "lastSpeedStableChangeTime": 1682499033.0403435,
1930 "configuredSpeed": 90,
1931 "actualSpeed": 33,
1932 "speedHwOverride": True,
1933 "speedStable": True,
1934 "label": "PowerSupply1/1",
1935 }
1936 ],
1937 "speed": 30,
1938 "label": "PowerSupply1",
1939 },
1940 {
1941 "status": "ok",
1942 "fans": [
1943 {
1944 "status": "ok",
1945 "uptime": 1682498935.9121106,
1946 "maxSpeed": 23000,
1947 "lastSpeedStableChangeTime": 1682499092.4665174,
1948 "configuredSpeed": 90,
1949 "actualSpeed": 33,
1950 "speedHwOverride": True,
1951 "speedStable": True,
1952 "label": "PowerSupply2/1",
1953 }
1954 ],
1955 "speed": 30,
1956 "label": "PowerSupply2",
1957 },
1958 ],
1959 "fanTraySlots": [
1960 {
1961 "status": "ok",
1962 "fans": [
1963 {
1964 "status": "ok",
1965 "uptime": 1682498923.9303148,
1966 "maxSpeed": 17500,
1967 "lastSpeedStableChangeTime": 1682498975.0139885,
1968 "configuredSpeed": 80,
1969 "actualSpeed": 29,
1970 "speedHwOverride": False,
1971 "speedStable": True,
1972 "label": "1/1",
1973 }
1974 ],
1975 "speed": 30,
1976 "label": "1",
1977 },
1978 {
1979 "status": "ok",
1980 "fans": [
1981 {
1982 "status": "ok",
1983 "uptime": 1682498923.9304729,
1984 "maxSpeed": 17500,
1985 "lastSpeedStableChangeTime": 1682498939.9329433,
1986 "configuredSpeed": 30,
1987 "actualSpeed": 30,
1988 "speedHwOverride": False,
1989 "speedStable": True,
1990 "label": "2/1",
1991 }
1992 ],
1993 "speed": 30,
1994 "label": "2",
1995 },
1996 {
1997 "status": "ok",
1998 "fans": [
1999 {
2000 "status": "ok",
2001 "uptime": 1682498923.9383528,
2002 "maxSpeed": 17500,
2003 "lastSpeedStableChangeTime": 1682498975.0140095,
2004 "configuredSpeed": 30,
2005 "actualSpeed": 30,
2006 "speedHwOverride": False,
2007 "speedStable": True,
2008 "label": "3/1",
2009 }
2010 ],
2011 "speed": 30,
2012 "label": "3",
2013 },
2014 {
2015 "status": "ok",
2016 "fans": [
2017 {
2018 "status": "ok",
2019 "uptime": 1682498923.9303904,
2020 "maxSpeed": 17500,
2021 "lastSpeedStableChangeTime": 1682498975.0140295,
2022 "configuredSpeed": 30,
2023 "actualSpeed": 30,
2024 "speedHwOverride": False,
2025 "speedStable": True,
2026 "label": "4/1",
2027 }
2028 ],
2029 "speed": 30,
2030 "label": "4",
2031 },
2032 ],
2033 "minFanSpeed": 0,
2034 "currentZones": 1,
2035 "configuredZones": 0,
2036 "systemStatus": "coolingOk",
2037 }
2038 ],
2039 "inputs": {"states": ["ok"], "configured_fan_speed_limit": 80},
2040 "expected": {
2041 "result": AntaTestStatus.FAILURE,
2042 "messages": [
2043 "Power Slot: PowerSupply1 Fan: PowerSupply1/1 - High fan speed - Expected: <= 80 Actual: 90",
2044 "Power Slot: PowerSupply2 Fan: PowerSupply2/1 - High fan speed - Expected: <= 80 Actual: 90",
2045 ],
2046 "atomic_results": [
2047 {
2048 "description": "Power Slot: PowerSupply1 Fan: PowerSupply1/1",
2049 "result": AntaTestStatus.FAILURE,
2050 "messages": ["High fan speed - Expected: <= 80 Actual: 90"],
2051 },
2052 {
2053 "description": "Power Slot: PowerSupply2 Fan: PowerSupply2/1",
2054 "result": AntaTestStatus.FAILURE,
2055 "messages": ["High fan speed - Expected: <= 80 Actual: 90"],
2056 },
2057 {
2058 "description": "Fan Tray: 1 Fan: 1/1",
2059 "result": AntaTestStatus.SUCCESS,
2060 },
2061 {
2062 "description": "Fan Tray: 2 Fan: 2/1",
2063 "result": AntaTestStatus.SUCCESS,
2064 },
2065 {
2066 "description": "Fan Tray: 3 Fan: 3/1",
2067 "result": AntaTestStatus.SUCCESS,
2068 },
2069 {
2070 "description": "Fan Tray: 4 Fan: 4/1",
2071 "result": AntaTestStatus.SUCCESS,
2072 },
2073 ],
2074 },
2075 },
2076 (VerifyEnvironmentCooling, "failure-fan-tray-fan-configspeed"): {
2077 "eos_data": [
2078 {
2079 "defaultZones": False,
2080 "numCoolingZones": [],
2081 "coolingMode": "automatic",
2082 "ambientTemperature": 24.5,
2083 "shutdownOnInsufficientFans": True,
2084 "airflowDirection": "frontToBackAirflow",
2085 "overrideFanSpeed": 0,
2086 "powerSupplySlots": [
2087 {
2088 "status": "ok",
2089 "fans": [
2090 {
2091 "status": "ok",
2092 "uptime": 1682498937.0240965,
2093 "maxSpeed": 23000,
2094 "lastSpeedStableChangeTime": 1682499033.0403435,
2095 "configuredSpeed": 30,
2096 "actualSpeed": 33,
2097 "speedHwOverride": True,
2098 "speedStable": True,
2099 "label": "PowerSupply1/1",
2100 }
2101 ],
2102 "speed": 30,
2103 "label": "PowerSupply1",
2104 },
2105 {
2106 "status": "ok",
2107 "fans": [
2108 {
2109 "status": "ok",
2110 "uptime": 1682498935.9121106,
2111 "maxSpeed": 23000,
2112 "lastSpeedStableChangeTime": 1682499092.4665174,
2113 "configuredSpeed": 34,
2114 "actualSpeed": 33,
2115 "speedHwOverride": True,
2116 "speedStable": True,
2117 "label": "PowerSupply2/1",
2118 }
2119 ],
2120 "speed": 30,
2121 "label": "PowerSupply2",
2122 },
2123 ],
2124 "fanTraySlots": [
2125 {
2126 "status": "ok",
2127 "fans": [
2128 {
2129 "status": "ok",
2130 "uptime": 1682498923.9303148,
2131 "maxSpeed": 17500,
2132 "lastSpeedStableChangeTime": 1682498975.0139885,
2133 "configuredSpeed": 85,
2134 "actualSpeed": 29,
2135 "speedHwOverride": False,
2136 "speedStable": True,
2137 "label": "1/1",
2138 }
2139 ],
2140 "speed": 30,
2141 "label": "1",
2142 },
2143 {
2144 "status": "ok",
2145 "fans": [
2146 {
2147 "status": "ok",
2148 "uptime": 1682498923.9304729,
2149 "maxSpeed": 17500,
2150 "lastSpeedStableChangeTime": 1682498939.9329433,
2151 "configuredSpeed": 90,
2152 "actualSpeed": 30,
2153 "speedHwOverride": False,
2154 "speedStable": True,
2155 "label": "2/1",
2156 }
2157 ],
2158 "speed": 30,
2159 "label": "2",
2160 },
2161 {
2162 "status": "ok",
2163 "fans": [
2164 {
2165 "status": "ok",
2166 "uptime": 1682498923.9383528,
2167 "maxSpeed": 17500,
2168 "lastSpeedStableChangeTime": 1682498975.0140095,
2169 "configuredSpeed": 100,
2170 "actualSpeed": 30,
2171 "speedHwOverride": False,
2172 "speedStable": True,
2173 "label": "3/1",
2174 }
2175 ],
2176 "speed": 30,
2177 "label": "3",
2178 },
2179 {
2180 "status": "ok",
2181 "fans": [
2182 {
2183 "status": "ok",
2184 "uptime": 1682498923.9303904,
2185 "maxSpeed": 17500,
2186 "lastSpeedStableChangeTime": 1682498975.0140295,
2187 "configuredSpeed": 30,
2188 "actualSpeed": 30,
2189 "speedHwOverride": False,
2190 "speedStable": True,
2191 "label": "4/1",
2192 }
2193 ],
2194 "speed": 30,
2195 "label": "4",
2196 },
2197 ],
2198 "minFanSpeed": 0,
2199 "currentZones": 1,
2200 "configuredZones": 0,
2201 "systemStatus": "coolingOk",
2202 }
2203 ],
2204 "inputs": {"states": ["ok"], "configured_fan_speed_limit": 80},
2205 "expected": {
2206 "result": AntaTestStatus.FAILURE,
2207 "messages": [
2208 "Fan Tray: 1 Fan: 1/1 - High fan speed - Expected: <= 80 Actual: 85",
2209 "Fan Tray: 2 Fan: 2/1 - High fan speed - Expected: <= 80 Actual: 90",
2210 "Fan Tray: 3 Fan: 3/1 - High fan speed - Expected: <= 80 Actual: 100",
2211 ],
2212 "atomic_results": [
2213 {
2214 "description": "Power Slot: PowerSupply1 Fan: PowerSupply1/1",
2215 "result": AntaTestStatus.SUCCESS,
2216 },
2217 {
2218 "description": "Power Slot: PowerSupply2 Fan: PowerSupply2/1",
2219 "result": AntaTestStatus.SUCCESS,
2220 },
2221 {
2222 "description": "Fan Tray: 1 Fan: 1/1",
2223 "result": AntaTestStatus.FAILURE,
2224 "messages": ["High fan speed - Expected: <= 80 Actual: 85"],
2225 },
2226 {
2227 "description": "Fan Tray: 2 Fan: 2/1",
2228 "result": AntaTestStatus.FAILURE,
2229 "messages": ["High fan speed - Expected: <= 80 Actual: 90"],
2230 },
2231 {
2232 "description": "Fan Tray: 3 Fan: 3/1",
2233 "result": AntaTestStatus.FAILURE,
2234 "messages": ["High fan speed - Expected: <= 80 Actual: 100"],
2235 },
2236 {
2237 "description": "Fan Tray: 4 Fan: 4/1",
2238 "result": AntaTestStatus.SUCCESS,
2239 },
2240 ],
2241 },
2242 },
2243 (VerifyEnvironmentCooling, "failure-mixed"): {
2244 "eos_data": [
2245 {
2246 "powerSupplySlots": [
2247 {
2248 "status": "ok",
2249 "fans": [
2250 {
2251 "status": "ok",
2252 "uptime": 1682498937.0240965,
2253 "maxSpeed": 23000,
2254 "lastSpeedStableChangeTime": 1682499033.0403435,
2255 "configuredSpeed": 90,
2256 "actualSpeed": 33,
2257 "speedHwOverride": True,
2258 "speedStable": True,
2259 "label": "PowerSupply1/1",
2260 },
2261 {
2262 "status": "ok",
2263 "uptime": 1682498937.0240965,
2264 "maxSpeed": 23000,
2265 "lastSpeedStableChangeTime": 1682499033.0403435,
2266 "configuredSpeed": 90,
2267 "actualSpeed": 33,
2268 "speedHwOverride": True,
2269 "speedStable": True,
2270 "label": "PowerSupply1/2",
2271 },
2272 ],
2273 "speed": 30,
2274 "label": "PowerSupply1",
2275 },
2276 ],
2277 "fanTraySlots": [
2278 {
2279 "status": "ok",
2280 "fans": [
2281 {
2282 "status": "ok",
2283 "uptime": 1682498923.9303148,
2284 "maxSpeed": 17500,
2285 "lastSpeedStableChangeTime": 1682498975.0139885,
2286 "configuredSpeed": 85,
2287 "actualSpeed": 29,
2288 "speedHwOverride": False,
2289 "speedStable": True,
2290 "label": "1/1",
2291 },
2292 {
2293 "status": "ok",
2294 "uptime": 1682498923.9303148,
2295 "maxSpeed": 17500,
2296 "lastSpeedStableChangeTime": 1682498975.0139885,
2297 "configuredSpeed": 85,
2298 "actualSpeed": 29,
2299 "speedHwOverride": False,
2300 "speedStable": True,
2301 "label": "1/2",
2302 },
2303 ],
2304 "speed": 30,
2305 "label": "1",
2306 },
2307 ],
2308 }
2309 ],
2310 "inputs": {"states": ["ok"], "configured_fan_speed_limit": 80},
2311 "expected": {
2312 "result": AntaTestStatus.FAILURE,
2313 "messages": [
2314 "Power Slot: PowerSupply1 Fan: PowerSupply1/1 - High fan speed - Expected: <= 80 Actual: 90",
2315 "Power Slot: PowerSupply1 Fan: PowerSupply1/2 - High fan speed - Expected: <= 80 Actual: 90",
2316 "Fan Tray: 1 Fan: 1/1 - High fan speed - Expected: <= 80 Actual: 85",
2317 "Fan Tray: 1 Fan: 1/2 - High fan speed - Expected: <= 80 Actual: 85",
2318 ],
2319 "atomic_results": [
2320 {
2321 "description": "Power Slot: PowerSupply1 Fan: PowerSupply1/1",
2322 "result": AntaTestStatus.FAILURE,
2323 "messages": ["High fan speed - Expected: <= 80 Actual: 90"],
2324 },
2325 {
2326 "description": "Power Slot: PowerSupply1 Fan: PowerSupply1/2",
2327 "result": AntaTestStatus.FAILURE,
2328 "messages": ["High fan speed - Expected: <= 80 Actual: 90"],
2329 },
2330 {
2331 "description": "Fan Tray: 1 Fan: 1/1",
2332 "result": AntaTestStatus.FAILURE,
2333 "messages": ["High fan speed - Expected: <= 80 Actual: 85"],
2334 },
2335 {
2336 "description": "Fan Tray: 1 Fan: 1/2",
2337 "result": AntaTestStatus.FAILURE,
2338 "messages": ["High fan speed - Expected: <= 80 Actual: 85"],
2339 },
2340 ],
2341 },
2342 },
2343 (VerifyEnvironmentPower, "success"): {
2344 "eos_data": [
2345 {
2346 "powerSupplies": {
2347 "1": {
2348 "outputPower": 0.0,
2349 "modelName": "PWR-500AC-F",
2350 "capacity": 500.0,
2351 "tempSensors": {
2352 "TempSensorP1/2": {"status": "ok", "temperature": 0.0},
2353 "TempSensorP1/3": {"status": "ok", "temperature": 0.0},
2354 "TempSensorP1/1": {"status": "ok", "temperature": 0.0},
2355 },
2356 "fans": {"FanP1/1": {"status": "ok", "speed": 33}},
2357 "state": "ok",
2358 "inputCurrent": 0.0,
2359 "dominant": False,
2360 "inputVoltage": 0.0,
2361 "outputCurrent": 0.0,
2362 "managed": True,
2363 },
2364 "2": {
2365 "outputPower": 117.375,
2366 "uptime": 1682498935.9121966,
2367 "modelName": "PWR-500AC-F",
2368 "capacity": 500.0,
2369 "tempSensors": {
2370 "TempSensorP2/1": {"status": "ok", "temperature": 39.0},
2371 "TempSensorP2/3": {"status": "ok", "temperature": 43.0},
2372 "TempSensorP2/2": {"status": "ok", "temperature": 31.0},
2373 },
2374 "fans": {"FanP2/1": {"status": "ok", "speed": 33}},
2375 "state": "ok",
2376 "inputCurrent": 0.572265625,
2377 "dominant": False,
2378 "inputVoltage": 232.5,
2379 "outputCurrent": 9.828125,
2380 "managed": True,
2381 },
2382 }
2383 }
2384 ],
2385 "inputs": {"states": ["ok"]},
2386 "expected": {
2387 "result": AntaTestStatus.SUCCESS,
2388 "atomic_results": [
2389 {
2390 "description": "Power Slot: 1",
2391 "result": AntaTestStatus.SUCCESS,
2392 },
2393 {
2394 "description": "Power Slot: 2",
2395 "result": AntaTestStatus.SUCCESS,
2396 },
2397 ],
2398 },
2399 },
2400 (VerifyEnvironmentPower, "success-min-count"): {
2401 "eos_data": [
2402 {
2403 "powerSupplies": {
2404 "1": {
2405 "modelName": "PWR-500AC-F",
2406 "state": "ok",
2407 "inputVoltage": 0.0,
2408 },
2409 "2": {
2410 "modelName": "PWR-500AC-F",
2411 "state": "notOk",
2412 "inputVoltage": 232.5,
2413 },
2414 }
2415 }
2416 ],
2417 "inputs": {"states": ["ok"], "min_count": 1},
2418 "expected": {"result": AntaTestStatus.SUCCESS},
2419 },
2420 (VerifyEnvironmentPower, "success-min_power-voltage"): {
2421 "eos_data": [
2422 {
2423 "powerSupplies": {
2424 "1": {
2425 "modelName": "PWR-747AC-RED",
2426 "capacity": 750.0,
2427 "dominant": False,
2428 "inputCurrent": 0.705078125,
2429 "outputCurrent": 9.921875,
2430 "inputVoltage": 206.25,
2431 "outputVoltage": 12.025390625,
2432 "outputPower": 119.375,
2433 "state": "ok",
2434 "uptime": 1730845612.5112484,
2435 "fans": {"FanP1/1": {"status": "ok", "speed": 33}},
2436 "tempSensors": {"TempSensorP1/2": {"status": "ok", "temperature": 50.0}, "TempSensorP1/1": {"status": "ok", "temperature": 61.0}},
2437 "managed": True,
2438 },
2439 "2": {
2440 "modelName": "PWR-747AC-RED",
2441 "capacity": 750.0,
2442 "dominant": False,
2443 "inputCurrent": 0.724609375,
2444 "outputCurrent": 10.765625,
2445 "inputVoltage": 204.75,
2446 "outputVoltage": 12.009765625,
2447 "outputPower": 128.0,
2448 "state": "ok",
2449 "uptime": 1730142355.4805274,
2450 "fans": {"FanP2/1": {"status": "ok", "speed": 33}},
2451 "tempSensors": {"TempSensorP2/2": {"status": "ok", "temperature": 53.0}, "TempSensorP2/1": {"status": "ok", "temperature": 63.0}},
2452 "managed": True,
2453 },
2454 }
2455 }
2456 ],
2457 "inputs": {"states": ["ok"], "min_input_voltage": 1},
2458 "expected": {
2459 "result": AntaTestStatus.SUCCESS,
2460 "atomic_results": [
2461 {
2462 "description": "Power Slot: 1",
2463 "result": AntaTestStatus.SUCCESS,
2464 },
2465 {
2466 "description": "Power Slot: 2",
2467 "result": AntaTestStatus.SUCCESS,
2468 },
2469 ],
2470 },
2471 },
2472 (VerifyEnvironmentPower, "success-min_power-voltage-min-count"): {
2473 "eos_data": [
2474 {
2475 "powerSupplies": {
2476 "1": {
2477 "modelName": "PWR-747AC-RED",
2478 "inputVoltage": 206.25,
2479 "state": "ok",
2480 },
2481 "2": {
2482 "modelName": "PWR-747AC-RED",
2483 "inputVoltage": 94.75,
2484 "state": "ok",
2485 },
2486 }
2487 }
2488 ],
2489 "inputs": {"states": ["ok"], "min_input_voltage": 100, "min_count": 1},
2490 "expected": {"result": AntaTestStatus.SUCCESS},
2491 },
2492 (VerifyEnvironmentPower, "failure-min_power-voltage"): {
2493 "eos_data": [
2494 {
2495 "powerSupplies": {
2496 "1": {
2497 "modelName": "PWR-747AC-RED",
2498 "capacity": 750.0,
2499 "dominant": False,
2500 "inputCurrent": 0.705078125,
2501 "outputCurrent": 9.921875,
2502 "inputVoltage": 0.25,
2503 "outputVoltage": 12.025390625,
2504 "outputPower": 119.375,
2505 "state": "ok",
2506 "uptime": 1730845612.5112484,
2507 "fans": {"FanP1/1": {"status": "ok", "speed": 33}},
2508 "tempSensors": {"TempSensorP1/2": {"status": "ok", "temperature": 50.0}, "TempSensorP1/1": {"status": "ok", "temperature": 61.0}},
2509 "managed": True,
2510 },
2511 "2": {
2512 "modelName": "PWR-747AC-RED",
2513 "capacity": 750.0,
2514 "dominant": False,
2515 "inputCurrent": 0.724609375,
2516 "outputCurrent": 10.765625,
2517 "inputVoltage": 0.75,
2518 "outputVoltage": 12.009765625,
2519 "outputPower": 128.0,
2520 "state": "ok",
2521 "uptime": 1730142355.4805274,
2522 "fans": {"FanP2/1": {"status": "ok", "speed": 33}},
2523 "tempSensors": {"TempSensorP2/2": {"status": "ok", "temperature": 53.0}, "TempSensorP2/1": {"status": "ok", "temperature": 63.0}},
2524 "managed": True,
2525 },
2526 }
2527 }
2528 ],
2529 "inputs": {"states": ["ok"], "min_input_voltage": 1},
2530 "expected": {
2531 "result": AntaTestStatus.FAILURE,
2532 "messages": [
2533 "Power Slot: 1 - Input voltage mismatch - Expected: >= 1 Actual: 0.25",
2534 "Power Slot: 2 - Input voltage mismatch - Expected: >= 1 Actual: 0.75",
2535 ],
2536 "atomic_results": [
2537 {"description": "Power Slot: 1", "result": AntaTestStatus.FAILURE, "messages": ["Input voltage mismatch - Expected: >= 1 Actual: 0.25"]},
2538 {"description": "Power Slot: 2", "result": AntaTestStatus.FAILURE, "messages": ["Input voltage mismatch - Expected: >= 1 Actual: 0.75"]},
2539 ],
2540 },
2541 },
2542 (VerifyEnvironmentPower, "success-additional-states"): {
2543 "eos_data": [
2544 {
2545 "powerSupplies": {
2546 "1": {
2547 "outputPower": 0.0,
2548 "modelName": "PWR-500AC-F",
2549 "capacity": 500.0,
2550 "tempSensors": {
2551 "TempSensorP1/2": {"status": "ok", "temperature": 0.0},
2552 "TempSensorP1/3": {"status": "ok", "temperature": 0.0},
2553 "TempSensorP1/1": {"status": "ok", "temperature": 0.0},
2554 },
2555 "fans": {"FanP1/1": {"status": "ok", "speed": 33}},
2556 "state": "powerLoss",
2557 "inputCurrent": 0.0,
2558 "dominant": False,
2559 "inputVoltage": 0.0,
2560 "outputCurrent": 0.0,
2561 "managed": True,
2562 },
2563 "2": {
2564 "outputPower": 117.375,
2565 "uptime": 1682498935.9121966,
2566 "modelName": "PWR-500AC-F",
2567 "capacity": 500.0,
2568 "tempSensors": {
2569 "TempSensorP2/1": {"status": "ok", "temperature": 39.0},
2570 "TempSensorP2/3": {"status": "ok", "temperature": 43.0},
2571 "TempSensorP2/2": {"status": "ok", "temperature": 31.0},
2572 },
2573 "fans": {"FanP2/1": {"status": "ok", "speed": 33}},
2574 "state": "ok",
2575 "inputCurrent": 0.572265625,
2576 "dominant": False,
2577 "inputVoltage": 232.5,
2578 "outputCurrent": 9.828125,
2579 "managed": True,
2580 },
2581 }
2582 }
2583 ],
2584 "inputs": {"states": ["ok", "powerLoss"]},
2585 "expected": {
2586 "result": AntaTestStatus.SUCCESS,
2587 "atomic_results": [
2588 {
2589 "description": "Power Slot: 1",
2590 "result": AntaTestStatus.SUCCESS,
2591 },
2592 {
2593 "description": "Power Slot: 2",
2594 "result": AntaTestStatus.SUCCESS,
2595 },
2596 ],
2597 },
2598 },
2599 (VerifyEnvironmentPower, "failure"): {
2600 "eos_data": [
2601 {
2602 "powerSupplies": {
2603 "1": {
2604 "outputPower": 0.0,
2605 "modelName": "PWR-500AC-F",
2606 "capacity": 500.0,
2607 "tempSensors": {
2608 "TempSensorP1/2": {"status": "ok", "temperature": 0.0},
2609 "TempSensorP1/3": {"status": "ok", "temperature": 0.0},
2610 "TempSensorP1/1": {"status": "ok", "temperature": 0.0},
2611 },
2612 "fans": {"FanP1/1": {"status": "ok", "speed": 33}},
2613 "state": "powerLoss",
2614 "inputCurrent": 0.0,
2615 "dominant": False,
2616 "inputVoltage": 0.0,
2617 "outputCurrent": 0.0,
2618 "managed": True,
2619 },
2620 "2": {
2621 "outputPower": 117.375,
2622 "uptime": 1682498935.9121966,
2623 "modelName": "PWR-500AC-F",
2624 "capacity": 500.0,
2625 "tempSensors": {
2626 "TempSensorP2/1": {"status": "ok", "temperature": 39.0},
2627 "TempSensorP2/3": {"status": "ok", "temperature": 43.0},
2628 "TempSensorP2/2": {"status": "ok", "temperature": 31.0},
2629 },
2630 "fans": {"FanP2/1": {"status": "ok", "speed": 33}},
2631 "state": "ok",
2632 "inputCurrent": 0.572265625,
2633 "dominant": False,
2634 "inputVoltage": 232.5,
2635 "outputCurrent": 9.828125,
2636 "managed": True,
2637 },
2638 }
2639 }
2640 ],
2641 "inputs": {"states": ["ok"]},
2642 "expected": {
2643 "result": AntaTestStatus.FAILURE,
2644 "messages": ["Power Slot: 1 - Invalid power supplies state - Expected: ok Actual: powerLoss"],
2645 "atomic_results": [
2646 {"description": "Power Slot: 1", "result": AntaTestStatus.FAILURE, "messages": ["Invalid power supplies state - Expected: ok Actual: powerLoss"]},
2647 {
2648 "description": "Power Slot: 2",
2649 "result": AntaTestStatus.SUCCESS,
2650 },
2651 ],
2652 },
2653 },
2654 (VerifyEnvironmentPower, "failure-min-count"): {
2655 "eos_data": [
2656 {
2657 "powerSupplies": {
2658 "1": {
2659 "modelName": "PWR-500AC-F",
2660 "state": "failed",
2661 "inputVoltage": 0.0,
2662 },
2663 "2": {
2664 "modelName": "PWR-500AC-F",
2665 "state": "notOk",
2666 "inputVoltage": 232.5,
2667 },
2668 }
2669 }
2670 ],
2671 "inputs": {"states": ["ok", "powerLoss"], "min_input_voltage": 1, "min_count": 1},
2672 "expected": {
2673 "result": AntaTestStatus.FAILURE,
2674 "messages": [
2675 "Expected >=1 power supplies with state ok/powerLoss and input voltage >=1V, but found 0",
2676 "Power Slot: 1 - Invalid power supplies state - Expected: ok, powerLoss Actual: failed",
2677 "Power Slot: 1 - Input voltage mismatch - Expected: >= 1 Actual: 0.0",
2678 "Power Slot: 2 - Invalid power supplies state - Expected: ok, powerLoss Actual: notOk",
2679 ],
2680 },
2681 },
2682 (VerifyEnvironmentPower, "failure-min-count-state-only"): {
2683 "eos_data": [
2684 {
2685 "powerSupplies": {
2686 "1": {
2687 "modelName": "PWR-500AC-F",
2688 "state": "failed",
2689 "inputVoltage": 232.5,
2690 },
2691 "2": {
2692 "modelName": "PWR-500AC-F",
2693 "state": "notOk",
2694 "inputVoltage": 232.5,
2695 },
2696 }
2697 }
2698 ],
2699 "inputs": {"states": ["ok"], "min_count": 1},
2700 "expected": {
2701 "result": AntaTestStatus.FAILURE,
2702 "messages": [
2703 "Expected >=1 power supplies with state ok, but found 0",
2704 "Power Slot: 1 - Invalid power supplies state - Expected: ok Actual: failed",
2705 "Power Slot: 2 - Invalid power supplies state - Expected: ok Actual: notOk",
2706 ],
2707 },
2708 },
2709 (VerifyEnvironmentPower, "failure-min-count-voltage-only"): {
2710 "eos_data": [
2711 {
2712 "powerSupplies": {
2713 "1": {
2714 "modelName": "PWR-500AC-F",
2715 "state": "ok",
2716 "inputVoltage": 0.0,
2717 },
2718 "2": {
2719 "modelName": "PWR-500AC-F",
2720 "state": "ok",
2721 "inputVoltage": 100.0,
2722 },
2723 }
2724 }
2725 ],
2726 "inputs": {"states": ["ok"], "min_input_voltage": 110, "min_count": 1},
2727 "expected": {
2728 "result": AntaTestStatus.FAILURE,
2729 "messages": [
2730 "Expected >=1 power supplies with state ok and input voltage >=110V, but found 0",
2731 "Power Slot: 1 - Input voltage mismatch - Expected: >= 110 Actual: 0.0",
2732 "Power Slot: 2 - Input voltage mismatch - Expected: >= 110 Actual: 100.0",
2733 ],
2734 },
2735 },
2736 (VerifyEnvironmentPower, "failure-min-count-insufficient"): {
2737 "eos_data": [
2738 {
2739 "powerSupplies": {
2740 "1": {
2741 "modelName": "PWR-500AC-F",
2742 "state": "ok",
2743 "inputVoltage": 232.5,
2744 },
2745 "2": {
2746 "modelName": "PWR-500AC-F",
2747 "state": "failed",
2748 "inputVoltage": 0.0,
2749 },
2750 }
2751 }
2752 ],
2753 "inputs": {"states": ["ok"], "min_input_voltage": 1, "min_count": 2},
2754 "expected": {
2755 "result": AntaTestStatus.FAILURE,
2756 "messages": [
2757 "Expected >=2 power supplies with state ok and input voltage >=1V, but found 1",
2758 "Power Slot: 2 - Invalid power supplies state - Expected: ok Actual: failed",
2759 "Power Slot: 2 - Input voltage mismatch - Expected: >= 1 Actual: 0.0",
2760 ],
2761 },
2762 },
2763 (VerifyEnvironmentPower, "failure-min-count-exceeds-installed"): {
2764 "eos_data": [
2765 {
2766 "powerSupplies": {
2767 "1": {
2768 "modelName": "PWR-500AC-F",
2769 "state": "ok",
2770 "inputVoltage": 232.5,
2771 },
2772 "2": {
2773 "modelName": "PWR-500AC-F",
2774 "state": "ok",
2775 "inputVoltage": 232.5,
2776 },
2777 }
2778 }
2779 ],
2780 "inputs": {"states": ["ok"], "min_count": 3},
2781 "expected": {
2782 "result": AntaTestStatus.FAILURE,
2783 "messages": [
2784 "Expected >=3 power supplies but found only 2 installed",
2785 ],
2786 },
2787 },
2788 (VerifyAdverseDrops, "success"): {
2789 "eos_data": [
2790 {
2791 "dropEvents": {
2792 "Fap0": {
2793 "dropEvent": [
2794 {
2795 "counterName": "EpniAlignerError",
2796 "counterType": "Adverse",
2797 "dropCount": 7,
2798 "dropInLastMinute": 0,
2799 "dropInLastTenMinute": 0,
2800 "dropInLastOneHour": 0,
2801 "dropInLastOneDay": 0,
2802 "dropInLastOneWeek": 0,
2803 },
2804 ]
2805 }
2806 }
2807 },
2808 {
2809 "aradMappings": [
2810 {
2811 "fapName": "Fap0",
2812 "portMappings": {
2813 "2": {
2814 "interface": "Ethernet1/1",
2815 },
2816 },
2817 }
2818 ]
2819 },
2820 {
2821 "interfaceErrorCounters": {
2822 "Ethernet1/1": {
2823 "fcsErrors": 0,
2824 },
2825 }
2826 },
2827 ],
2828 "expected": {"result": AntaTestStatus.SUCCESS},
2829 },
2830 (VerifyAdverseDrops, "success-drop-count-zero"): {
2831 "eos_data": [
2832 {
2833 "dropEvents": {
2834 "Fap0": {
2835 "dropEvent": [
2836 {
2837 "counterName": "EpniAlignerError",
2838 "counterType": "Adverse",
2839 "dropCount": 0,
2840 "dropInLastMinute": 0,
2841 "dropInLastTenMinute": 0,
2842 "dropInLastOneHour": 0,
2843 "dropInLastOneDay": 0,
2844 "dropInLastOneWeek": 0,
2845 },
2846 ]
2847 }
2848 }
2849 },
2850 {
2851 "aradMappings": [
2852 {
2853 "fapName": "Fap0",
2854 "portMappings": {
2855 "2": {
2856 "interface": "Ethernet1/1",
2857 },
2858 },
2859 }
2860 ]
2861 },
2862 {
2863 "interfaceErrorCounters": {
2864 "Ethernet1/1": {
2865 "fcsErrors": 0,
2866 },
2867 }
2868 },
2869 ],
2870 "expected": {"result": AntaTestStatus.SUCCESS},
2871 },
2872 (VerifyAdverseDrops, "success-with-thresholds"): {
2873 "eos_data": [
2874 {
2875 "dropEvents": {
2876 "Fap0": {
2877 "dropEvent": [
2878 {
2879 "counterName": "EpniAlignerError",
2880 "counterType": "Adverse",
2881 "dropCount": 10,
2882 "dropInLastMinute": 2,
2883 "dropInLastTenMinute": 2,
2884 "dropInLastOneHour": 2,
2885 "dropInLastOneDay": 2,
2886 "dropInLastOneWeek": 2,
2887 },
2888 ]
2889 }
2890 }
2891 },
2892 {
2893 "aradMappings": [
2894 {
2895 "fapName": "Fap0",
2896 "portMappings": {
2897 "2": {
2898 "interface": "Ethernet1/1",
2899 },
2900 },
2901 }
2902 ]
2903 },
2904 {
2905 "interfaceErrorCounters": {
2906 "Ethernet1/1": {
2907 "fcsErrors": 0,
2908 },
2909 }
2910 },
2911 ],
2912 "inputs": {"thresholds": {"minute": 10, "ten_minute": 10, "hour": 10, "day": 10, "week": 10}},
2913 "expected": {"result": AntaTestStatus.SUCCESS},
2914 },
2915 (VerifyAdverseDrops, "success-with-missing-thresholds-from-eapi"): {
2916 "eos_data": [
2917 {
2918 "dropEvents": {
2919 "Fap0": {
2920 "dropEvent": [
2921 {
2922 "counterName": "EpniAlignerError",
2923 "counterType": "Adverse",
2924 "dropCount": 10,
2925 "dropInLastMinute": 2,
2926 "dropInLastTenMinute": 2,
2927 },
2928 ]
2929 }
2930 }
2931 },
2932 {
2933 "aradMappings": [
2934 {
2935 "fapName": "Fap0",
2936 "portMappings": {
2937 "2": {
2938 "interface": "Ethernet1/1",
2939 },
2940 },
2941 }
2942 ]
2943 },
2944 {
2945 "interfaceErrorCounters": {
2946 "Ethernet1/1": {
2947 "fcsErrors": 0,
2948 },
2949 }
2950 },
2951 ],
2952 "inputs": {"thresholds": {"minute": 10, "ten_minute": 10, "hour": 10, "day": 10, "week": 10}},
2953 "expected": {"result": AntaTestStatus.SUCCESS},
2954 },
2955 (VerifyAdverseDrops, "success-not-adverse"): {
2956 "eos_data": [
2957 {
2958 "dropEvents": {
2959 "Fap0": {
2960 "dropEvent": [
2961 {
2962 "counterName": "EpniAlignerError",
2963 "counterType": "PacketProcessor",
2964 "dropCount": 7,
2965 "dropInLastMinute": 0,
2966 "dropInLastTenMinute": 0,
2967 "dropInLastOneHour": 0,
2968 "dropInLastOneDay": 0,
2969 "dropInLastOneWeek": 0,
2970 },
2971 ]
2972 }
2973 }
2974 },
2975 {
2976 "aradMappings": [
2977 {
2978 "fapName": "Fap0",
2979 "portMappings": {
2980 "2": {
2981 "interface": "Ethernet1/1",
2982 },
2983 },
2984 }
2985 ]
2986 },
2987 {
2988 "interfaceErrorCounters": {
2989 "Ethernet1/1": {
2990 "fcsErrors": 0,
2991 },
2992 }
2993 },
2994 ],
2995 "expected": {"result": AntaTestStatus.SUCCESS},
2996 },
2997 (VerifyAdverseDrops, "failure"): {
2998 "eos_data": [
2999 {
3000 "dropEvents": {
3001 "Fap0": {
3002 "dropEvent": [
3003 {
3004 "counterName": "EpniAlignerError",
3005 "counterType": "Adverse",
3006 "dropCount": 7,
3007 "dropInLastMinute": 1,
3008 "dropInLastTenMinute": 2,
3009 "dropInLastOneHour": 3,
3010 "dropInLastOneDay": 4,
3011 "dropInLastOneWeek": 5,
3012 },
3013 ]
3014 }
3015 }
3016 },
3017 {
3018 "aradMappings": [
3019 {
3020 "fapName": "Fap0",
3021 "portMappings": {
3022 "2": {
3023 "interface": "Ethernet1/1",
3024 },
3025 },
3026 }
3027 ]
3028 },
3029 {
3030 "interfaceErrorCounters": {
3031 "Ethernet1/1": {
3032 "fcsErrors": 2,
3033 },
3034 }
3035 },
3036 ],
3037 "expected": {
3038 "result": AntaTestStatus.FAILURE,
3039 "messages": [
3040 "FAP: Fap0 Counter: EpniAlignerError - Last minute rate above threshold - Expected: <= 0 Actual: 1",
3041 "FAP: Fap0 Counter: EpniAlignerError - Last 10 minutes rate above threshold - Expected: <= 0 Actual: 2",
3042 "FAP: Fap0 Counter: EpniAlignerError - Last hour rate above threshold - Expected: <= 0 Actual: 3",
3043 "FAP: Fap0 Counter: EpniAlignerError - Last day rate above threshold - Expected: <= 0 Actual: 4",
3044 "FAP: Fap0 Counter: EpniAlignerError - Last week rate above threshold - Expected: <= 0 Actual: 5",
3045 ],
3046 },
3047 },
3048 (VerifyAdverseDrops, "success-reassembly-errors"): {
3049 "eos_data": [
3050 {
3051 "dropEvents": {
3052 "Fap0": {
3053 "dropEvent": [
3054 {
3055 "counterName": "ReassemblyErrors",
3056 "counterType": "Adverse",
3057 "dropCount": 7,
3058 "dropInLastMinute": 1,
3059 "dropInLastTenMinute": 2,
3060 "dropInLastOneHour": 3,
3061 "dropInLastOneDay": 4,
3062 "dropInLastOneWeek": 5,
3063 },
3064 ]
3065 }
3066 }
3067 },
3068 {
3069 "aradMappings": [
3070 {
3071 "fapName": "Fap0",
3072 "portMappings": {
3073 "2": {
3074 "interface": "Ethernet1/1",
3075 },
3076 },
3077 }
3078 ]
3079 },
3080 {
3081 "interfaceErrorCounters": {
3082 "Ethernet1/1": {
3083 "fcsErrors": 2,
3084 },
3085 }
3086 },
3087 ],
3088 "inputs": {"always_fail_on_reassembly_errors": False},
3089 "expected": {"result": AntaTestStatus.SUCCESS},
3090 },
3091 (VerifyAdverseDrops, "failure-reassembly-errors"): {
3092 "eos_data": [
3093 {
3094 "dropEvents": {
3095 "Fap0": {
3096 "dropEvent": [
3097 {
3098 "counterName": "ReassemblyErrors",
3099 "counterType": "Adverse",
3100 "dropCount": 5,
3101 "dropInLastMinute": 0,
3102 "dropInLastTenMinute": 0,
3103 "dropInLastOneHour": 0,
3104 "dropInLastOneDay": 0,
3105 "dropInLastOneWeek": 5,
3106 },
3107 ]
3108 }
3109 }
3110 },
3111 {
3112 "aradMappings": [
3113 {
3114 "fapName": "Fap0",
3115 "portMappings": {
3116 "2": {
3117 "interface": "Ethernet1/1",
3118 },
3119 },
3120 }
3121 ]
3122 },
3123 {
3124 "interfaceErrorCounters": {
3125 "Ethernet1/1": {
3126 "fcsErrors": 2,
3127 },
3128 }
3129 },
3130 ],
3131 "inputs": {"always_fail_on_reassembly_errors": True},
3132 "expected": {
3133 "result": AntaTestStatus.FAILURE,
3134 "messages": [
3135 "FAP: Fap0 Counter: ReassemblyErrors - Last week rate above threshold - Expected: <= 0 Actual: 5",
3136 ],
3137 },
3138 },
3139 (VerifyAdverseDrops, "failure-with-thresholds"): {
3140 "eos_data": [
3141 {
3142 "dropEvents": {
3143 "Fap0": {
3144 "dropEvent": [
3145 {
3146 "counterName": "EpniAlignerError",
3147 "counterType": "Adverse",
3148 "dropCount": 10,
3149 "dropInLastMinute": 2,
3150 "dropInLastTenMinute": 2,
3151 "dropInLastOneHour": 2,
3152 "dropInLastOneDay": 2,
3153 "dropInLastOneWeek": 2,
3154 },
3155 ]
3156 }
3157 }
3158 },
3159 {
3160 "aradMappings": [
3161 {
3162 "fapName": "Fap0",
3163 "portMappings": {
3164 "2": {
3165 "interface": "Ethernet1/1",
3166 },
3167 },
3168 }
3169 ]
3170 },
3171 {
3172 "interfaceErrorCounters": {
3173 "Ethernet1/1": {
3174 "fcsErrors": 0,
3175 },
3176 }
3177 },
3178 ],
3179 "inputs": {"thresholds": {"minute": 0, "ten_minute": 10, "hour": 10, "day": 10, "week": 10}},
3180 "expected": {
3181 "result": AntaTestStatus.FAILURE,
3182 "messages": [
3183 "FAP: Fap0 Counter: EpniAlignerError - Last minute rate above threshold - Expected: <= 0 Actual: 2",
3184 ],
3185 },
3186 },
3187 (VerifySupervisorRedundancy, "success-redunduncy-status"): {
3188 "eos_data": [
3189 {
3190 "configuredProtocol": "sso",
3191 "operationalProtocol": "sso",
3192 "communicationDesc": "Up",
3193 "peerState": "unknownPeerState",
3194 "switchoverReady": True,
3195 }
3196 ],
3197 "expected": {"result": AntaTestStatus.SUCCESS},
3198 },
3199 (VerifySupervisorRedundancy, "success-redunduncy-status-simplex"): {
3200 "eos_data": [
3201 {
3202 "configuredProtocol": "simplex",
3203 "operationalProtocol": "simplex",
3204 "communicationDesc": "Up",
3205 "peerState": "unknownPeerState",
3206 "switchoverReady": True,
3207 }
3208 ],
3209 "inputs": {"redundancy_proto": "simplex"},
3210 "expected": {"result": AntaTestStatus.SUCCESS},
3211 },
3212 (VerifySupervisorRedundancy, "failure-no-redunduncy-status"): {
3213 "eos_data": [
3214 {
3215 "configuredProtocol": "simplex",
3216 "operationalProtocol": "simplex",
3217 "communicationDesc": "Up",
3218 "peerState": "unknownPeerState",
3219 "switchoverReady": True,
3220 }
3221 ],
3222 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Configured redundancy protocol mismatch - Expected sso Actual: simplex"]},
3223 },
3224 (VerifySupervisorRedundancy, "failure-no-redunduncy-operational"): {
3225 "eos_data": [
3226 {
3227 "configuredProtocol": "sso",
3228 "operationalProtocol": "simplex",
3229 "communicationDesc": "Up",
3230 "peerState": "unknownPeerState",
3231 "switchoverReady": False,
3232 }
3233 ],
3234 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Operational redundancy protocol mismatch - Expected sso Actual: simplex"]},
3235 },
3236 (VerifySupervisorRedundancy, "skip-card-not-inserted"): {
3237 "eos_data": [
3238 {
3239 "configuredProtocol": "sso",
3240 "operationalProtocol": "sso",
3241 "communicationDesc": "Up",
3242 "peerState": "notInserted",
3243 "switchoverReady": False,
3244 }
3245 ],
3246 "expected": {"result": AntaTestStatus.SKIPPED, "messages": ["Peer supervisor card not inserted"]},
3247 },
3248 (VerifySupervisorRedundancy, "failure-no-redunduncy-switchover-ready"): {
3249 "eos_data": [
3250 {
3251 "configuredProtocol": "sso",
3252 "operationalProtocol": "sso",
3253 "communicationDesc": "Up",
3254 "peerState": "unknownPeerState",
3255 "switchoverReady": False,
3256 }
3257 ],
3258 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Redundancy protocol switchover status mismatch - Expected: True Actual: False"]},
3259 },
3260 (VerifyPCIeErrors, "success"): {
3261 "eos_data": [
3262 {
3263 "pciIds": {
3264 "00:00.0": {"name": "DomainRoot0", "correctableErrors": 0, "nonFatalErrors": 0, "fatalErrors": 0, "linkSpeed": 0.0, "linkWidth": 0},
3265 "05:00.0": {
3266 "name": "Slot1:SwitchMicrosemiSwitch:BridgeBr0",
3267 "correctableErrors": 0,
3268 "nonFatalErrors": 0,
3269 "fatalErrors": 0,
3270 "linkSpeed": 8.0,
3271 "linkWidth": 16,
3272 },
3273 "06:00.0": {
3274 "name": "Slot1:SwitchMicrosemiSwitch:BridgeBr1",
3275 "correctableErrors": 0,
3276 "nonFatalErrors": 0,
3277 "fatalErrors": 0,
3278 "linkSpeed": 8.0,
3279 "linkWidth": 1,
3280 },
3281 }
3282 }
3283 ],
3284 "expected": {"result": AntaTestStatus.SUCCESS},
3285 },
3286 (VerifyPCIeErrors, "failure-correctable-errors"): {
3287 "eos_data": [
3288 {
3289 "pciIds": {
3290 "00:00.0": {"name": "DomainRoot0", "correctableErrors": 300000, "nonFatalErrors": 0, "fatalErrors": 0, "linkSpeed": 0.0, "linkWidth": 0},
3291 "05:00.0": {
3292 "name": "Slot1:SwitchMicrosemiSwitch:BridgeBr0",
3293 "correctableErrors": 140000,
3294 "nonFatalErrors": 0,
3295 "fatalErrors": 0,
3296 "linkSpeed": 8.0,
3297 "linkWidth": 16,
3298 },
3299 "06:00.0": {
3300 "name": "Slot1:SwitchMicrosemiSwitch:BridgeBr1",
3301 "correctableErrors": 20000,
3302 "nonFatalErrors": 0,
3303 "fatalErrors": 0,
3304 "linkSpeed": 8.0,
3305 "linkWidth": 1,
3306 },
3307 }
3308 }
3309 ],
3310 "inputs": {"thresholds": {"correctable_errors": 20000}},
3311 "expected": {
3312 "result": AntaTestStatus.FAILURE,
3313 "messages": [
3314 "PCI Name: DomainRoot0 PCI ID: 00:00.0 - Correctable errors above threshold - Expected: <= 20000 Actual: 300000",
3315 "PCI Name: Slot1:SwitchMicrosemiSwitch:BridgeBr0 PCI ID: 05:00.0 - Correctable errors above threshold - Expected: <= 20000 Actual: 140000",
3316 ],
3317 },
3318 },
3319 (VerifyPCIeErrors, "failure-non-fatal-errors"): {
3320 "eos_data": [
3321 {
3322 "pciIds": {
3323 "00:00.0": {"name": "DomainRoot0", "correctableErrors": 0, "nonFatalErrors": 550, "fatalErrors": 0, "linkSpeed": 0.0, "linkWidth": 0},
3324 "05:00.0": {
3325 "name": "Slot1:SwitchMicrosemiSwitch:BridgeBr0",
3326 "correctableErrors": 0,
3327 "nonFatalErrors": 260,
3328 "fatalErrors": 0,
3329 "linkSpeed": 8.0,
3330 "linkWidth": 16,
3331 },
3332 "06:00.0": {
3333 "name": "Slot1:SwitchMicrosemiSwitch:BridgeBr1",
3334 "correctableErrors": 0,
3335 "nonFatalErrors": 270,
3336 "fatalErrors": 0,
3337 "linkSpeed": 8.0,
3338 "linkWidth": 1,
3339 },
3340 }
3341 }
3342 ],
3343 "inputs": {"thresholds": {"non_fatal_errors": 260}},
3344 "expected": {
3345 "result": AntaTestStatus.FAILURE,
3346 "messages": [
3347 "PCI Name: DomainRoot0 PCI ID: 00:00.0 - Non-fatal errors above threshold - Expected: <= 260 Actual: 550",
3348 "PCI Name: Slot1:SwitchMicrosemiSwitch:BridgeBr1 PCI ID: 06:00.0 - Non-fatal errors above threshold - Expected: <= 260 Actual: 270",
3349 ],
3350 },
3351 },
3352 (VerifyPCIeErrors, "failure-fatal-errors"): {
3353 "eos_data": [
3354 {
3355 "pciIds": {
3356 "00:00.0": {"name": "DomainRoot0", "correctableErrors": 0, "nonFatalErrors": 0, "fatalErrors": 0, "linkSpeed": 0.0, "linkWidth": 0},
3357 "05:00.0": {
3358 "name": "Slot1:SwitchMicrosemiSwitch:BridgeBr0",
3359 "correctableErrors": 0,
3360 "nonFatalErrors": 0,
3361 "fatalErrors": 260,
3362 "linkSpeed": 8.0,
3363 "linkWidth": 16,
3364 },
3365 "06:00.0": {
3366 "name": "Slot1:SwitchMicrosemiSwitch:BridgeBr1",
3367 "correctableErrors": 0,
3368 "nonFatalErrors": 0,
3369 "fatalErrors": 280,
3370 "linkSpeed": 8.0,
3371 "linkWidth": 1,
3372 },
3373 }
3374 }
3375 ],
3376 "expected": {
3377 "result": AntaTestStatus.FAILURE,
3378 "messages": [
3379 "PCI Name: Slot1:SwitchMicrosemiSwitch:BridgeBr0 PCI ID: 05:00.0 - Fatal errors above threshold - Expected: <= 0 Actual: 260",
3380 "PCI Name: Slot1:SwitchMicrosemiSwitch:BridgeBr1 PCI ID: 06:00.0 - Fatal errors above threshold - Expected: <= 0 Actual: 280",
3381 ],
3382 },
3383 },
3384 (VerifyPCIeErrors, "failure-all-errors"): {
3385 "eos_data": [
3386 {
3387 "pciIds": {
3388 "00:00.0": {"name": "DomainRoot0", "correctableErrors": 500, "nonFatalErrors": 80, "fatalErrors": 90, "linkSpeed": 0.0, "linkWidth": 0},
3389 "05:00.0": {
3390 "name": "Slot1:SwitchMicrosemiSwitch:BridgeBr0",
3391 "correctableErrors": 990,
3392 "nonFatalErrors": 50,
3393 "fatalErrors": 260,
3394 "linkSpeed": 8.0,
3395 "linkWidth": 16,
3396 },
3397 "06:00.0": {
3398 "name": "Slot1:SwitchMicrosemiSwitch:BridgeBr1",
3399 "correctableErrors": 0,
3400 "nonFatalErrors": 0,
3401 "fatalErrors": 280,
3402 "linkSpeed": 8.0,
3403 "linkWidth": 1,
3404 },
3405 }
3406 }
3407 ],
3408 "inputs": {"thresholds": {"correctable_errors": 300, "non_fatal_errors": 60, "fatal_errors": 60}},
3409 "expected": {
3410 "result": AntaTestStatus.FAILURE,
3411 "messages": [
3412 "PCI Name: DomainRoot0 PCI ID: 00:00.0 - Correctable errors above threshold - Expected: <= 300 Actual: 500",
3413 "PCI Name: DomainRoot0 PCI ID: 00:00.0 - Non-fatal errors above threshold - Expected: <= 60 Actual: 80",
3414 "PCI Name: DomainRoot0 PCI ID: 00:00.0 - Fatal errors above threshold - Expected: <= 60 Actual: 90",
3415 "PCI Name: Slot1:SwitchMicrosemiSwitch:BridgeBr0 PCI ID: 05:00.0 - Correctable errors above threshold - Expected: <= 300 Actual: 990",
3416 "PCI Name: Slot1:SwitchMicrosemiSwitch:BridgeBr0 PCI ID: 05:00.0 - Fatal errors above threshold - Expected: <= 60 Actual: 260",
3417 "PCI Name: Slot1:SwitchMicrosemiSwitch:BridgeBr1 PCI ID: 06:00.0 - Fatal errors above threshold - Expected: <= 60 Actual: 280",
3418 ],
3419 },
3420 },
3421 (VerifyAbsenceOfLinecards, "success"): {
3422 "eos_data": [
3423 {
3424 "cardSlots": {
3425 "Fabric1": {
3426 "modelName": "7812R3-FM",
3427 "serialNum": "VITTHAL0104A",
3428 },
3429 "Fabric2": {
3430 "modelName": "7812R3-FM",
3431 "serialNum": "VITTHAL0104B",
3432 },
3433 "Supervisor1": {
3434 "modelName": "DCS-7816-SUP",
3435 "serialNum": "VITTHAL0104C",
3436 },
3437 "Supervisor2": {
3438 "modelName": "DCS-7816-SUP",
3439 "serialNum": "VITTHAL0104D",
3440 },
3441 "Linecard3": {
3442 "modelName": "7800R3A-36D-LC",
3443 "serialNum": "VITTHAL0104E",
3444 },
3445 "Linecard4": {
3446 "modelName": "7800R3A-36D-LC",
3447 "serialNum": "VITTHAL0104F",
3448 },
3449 "Linecard5": {
3450 "modelName": "7800R3A-36D-LC",
3451 "serialNum": "VITTHAL0104G",
3452 },
3453 },
3454 }
3455 ],
3456 "inputs": {"serial_numbers": ["FGN23450CW1"]},
3457 "expected": {"result": AntaTestStatus.SUCCESS},
3458 },
3459 (VerifyAbsenceOfLinecards, "failure"): {
3460 "eos_data": [
3461 {
3462 "cardSlots": {
3463 "Fabric1": {
3464 "modelName": "7812R3-FM",
3465 "serialNum": "VITTHAL0104A",
3466 },
3467 "Fabric2": {
3468 "modelName": "7812R3-FM",
3469 "serialNum": "VITTHAL0104B",
3470 },
3471 "Supervisor1": {
3472 "modelName": "DCS-7816-SUP",
3473 "serialNum": "VITTHAL0104C",
3474 },
3475 "Supervisor2": {
3476 "modelName": "DCS-7816-SUP",
3477 "serialNum": "VITTHAL0104D",
3478 },
3479 "Linecard3": {
3480 "modelName": "7800R3A-36D-LC",
3481 "serialNum": "VITTHAL0104E",
3482 },
3483 "Linecard4": {
3484 "modelName": "7800R3A-36D-LC",
3485 "serialNum": "VITTHAL0104F",
3486 },
3487 "Linecard5": {
3488 "modelName": "7800R3A-36D-LC",
3489 "serialNum": "VITTHAL0104G",
3490 },
3491 },
3492 }
3493 ],
3494 "inputs": {"serial_numbers": ["VITTHAL0104E", "VITTHAL0104C", "VITTHAL0104A"]},
3495 "expected": {
3496 "result": AntaTestStatus.FAILURE,
3497 "messages": ["Decommissioned linecards found in inventory: VITTHAL0104A, VITTHAL0104C, VITTHAL0104E"],
3498 },
3499 },
3500 (VerifyChassisHealth, "success"): {
3501 "eos_data": [
3502 {
3503 "numLinecards": 12,
3504 "linecardsNotInitialized": {},
3505 "numFabricCards": 6,
3506 "fabricCardsNotInitialized": {},
3507 "fabricInterruptOccurrences": {
3508 "Fabric6": {"count": 0},
3509 "Fabric1": {"count": 0},
3510 "Fabric2": {"count": 0},
3511 "Fabric3": {"count": 0},
3512 "Fabric5": {"count": 0},
3513 "Fabric4": {"count": 0},
3514 },
3515 }
3516 ],
3517 "expected": {"result": AntaTestStatus.SUCCESS},
3518 },
3519 (VerifyChassisHealth, "failure-no-linecard-initialized"): {
3520 "eos_data": [
3521 {
3522 "numLinecards": 12,
3523 "linecardsNotInitialized": {"line_card1": "not initialized", "line_card2": "not initialized"},
3524 "numFabricCards": 6,
3525 "fabricCardsNotInitialized": {},
3526 "fabricInterruptOccurrences": {
3527 "Fabric6": {"count": 0},
3528 "Fabric1": {"count": 0},
3529 "Fabric2": {"count": 0},
3530 "Fabric3": {"count": 0},
3531 "Fabric5": {"count": 0},
3532 "Fabric4": {"count": 0},
3533 },
3534 }
3535 ],
3536 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Linecard: line_card1 - Not initialized", "Linecard: line_card2 - Not initialized"]},
3537 },
3538 (VerifyChassisHealth, "failure-no-fabric-card-initialized"): {
3539 "eos_data": [
3540 {
3541 "numLinecards": 12,
3542 "linecardsNotInitialized": {},
3543 "numFabricCards": 6,
3544 "fabricCardsNotInitialized": {"FixedSystem": "hwStateUninitialized"},
3545 "fabricInterruptOccurrences": {
3546 "Fabric6": {"count": 0},
3547 "Fabric1": {"count": 0},
3548 "Fabric2": {"count": 0},
3549 "Fabric3": {"count": 0},
3550 "Fabric5": {"count": 0},
3551 "Fabric4": {"count": 0},
3552 },
3553 }
3554 ],
3555 "expected": {"result": AntaTestStatus.FAILURE, "messages": ["Fabric card: FixedSystem - Not initialized"]},
3556 },
3557 (VerifyChassisHealth, "failure-fabric-interrupts"): {
3558 "eos_data": [
3559 {
3560 "numLinecards": 12,
3561 "linecardsNotInitialized": {},
3562 "numFabricCards": 6,
3563 "fabricCardsNotInitialized": {},
3564 "fabricInterruptOccurrences": {
3565 "Fabric6": {"count": 10},
3566 "Fabric1": {"count": 0},
3567 "Fabric2": {"count": 0},
3568 "Fabric3": {"count": 20},
3569 "Fabric5": {"count": 0},
3570 "Fabric4": {"count": 40},
3571 },
3572 }
3573 ],
3574 "expected": {
3575 "result": AntaTestStatus.FAILURE,
3576 "messages": [
3577 "Fabric: Fabric6 - Fabric interrupts above threshold - Expected: <= 0 Actual: 10",
3578 "Fabric: Fabric3 - Fabric interrupts above threshold - Expected: <= 0 Actual: 20",
3579 "Fabric: Fabric4 - Fabric interrupts above threshold - Expected: <= 0 Actual: 40",
3580 ],
3581 },
3582 },
3583 (VerifyChassisHealth, "failure-all"): {
3584 "eos_data": [
3585 {
3586 "numLinecards": 12,
3587 "linecardsNotInitialized": {"line_card1": "not initialized", "line_card2": "not initialized"},
3588 "numFabricCards": 6,
3589 "fabricCardsNotInitialized": {"fabric_card1": "not initialized", "fabric_card2": "not initialized"},
3590 "fabricInterruptOccurrences": {
3591 "Fabric6": {"count": 0},
3592 "Fabric1": {"count": 0},
3593 "Fabric2": {"count": 0},
3594 "Fabric3": {"count": 20},
3595 "Fabric5": {"count": 0},
3596 "Fabric4": {"count": 0},
3597 },
3598 }
3599 ],
3600 "expected": {
3601 "result": AntaTestStatus.FAILURE,
3602 "messages": [
3603 "Linecard: line_card1 - Not initialized",
3604 "Linecard: line_card2 - Not initialized",
3605 "Fabric card: fabric_card1 - Not initialized",
3606 "Fabric card: fabric_card2 - Not initialized",
3607 "Fabric: Fabric3 - Fabric interrupts above threshold - Expected: <= 0 Actual: 20",
3608 ],
3609 },
3610 },
3611 (VerifyInventory, "success"): {
3612 "eos_data": [
3613 {
3614 "powerSupplySlots": {
3615 "1": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104A"},
3616 "2": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104B"},
3617 "3": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104C"},
3618 "4": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104D"},
3619 "5": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104E"},
3620 "6": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104F"},
3621 },
3622 "fanTraySlots": {
3623 "1": {
3624 "numFans": 12,
3625 "name": "7812R3-FM",
3626 },
3627 "2": {
3628 "numFans": 12,
3629 "name": "7812R3-FM",
3630 },
3631 "3": {
3632 "numFans": 12,
3633 "name": "7812R3-FM",
3634 },
3635 },
3636 "cardSlots": {
3637 "Fabric1": {
3638 "modelName": "7812R3-FM",
3639 "serialNum": "VITTHAL0104E",
3640 },
3641 "Fabric2": {
3642 "modelName": "7812R3-FM",
3643 "serialNum": "VITTHAL0104G",
3644 },
3645 "Supervisor1": {
3646 "modelName": "DCS-7816-SUP",
3647 "serialNum": "VITTHAL0104H",
3648 },
3649 "Supervisor2": {
3650 "modelName": "DCS-7816-SUP",
3651 "serialNum": "VITTHAL0104I",
3652 },
3653 "Linecard3": {
3654 "modelName": "7800R3A-36D-LC",
3655 "serialNum": "VITTHAL0104J",
3656 },
3657 "Linecard4": {
3658 "modelName": "7800R3A-36D-LC",
3659 "serialNum": "VITTHAL0104K",
3660 },
3661 "Linecard5": {
3662 "modelName": "7800R3A-36D-LC",
3663 "serialNum": "VITTHAL0104L",
3664 },
3665 },
3666 }
3667 ],
3668 "expected": {
3669 "result": AntaTestStatus.SUCCESS,
3670 "atomic_results": [
3671 {
3672 "description": "Power Supplies",
3673 "result": AntaTestStatus.SUCCESS,
3674 },
3675 {"description": "Fan Trays", "result": AntaTestStatus.SUCCESS},
3676 {"description": "Fabric Cards", "result": AntaTestStatus.SUCCESS},
3677 {"description": "Supervisors", "result": AntaTestStatus.SUCCESS},
3678 {"description": "Line Cards", "result": AntaTestStatus.SUCCESS},
3679 ],
3680 },
3681 },
3682 (VerifyInventory, "success-unsupported-component"): {
3683 "eos_data": [
3684 {
3685 "powerSupplySlots": {
3686 "1": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104A"},
3687 "2": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104B"},
3688 "3": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104C"},
3689 "4": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104D"},
3690 "5": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104E"},
3691 "6": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104F"},
3692 },
3693 "fanTraySlots": {
3694 "1": {
3695 "numFans": 12,
3696 "name": "7812R3-FM",
3697 },
3698 "2": {
3699 "numFans": 12,
3700 "name": "7812R3-FM",
3701 },
3702 "3": {
3703 "numFans": 12,
3704 "name": "7812R3-FM",
3705 },
3706 },
3707 "cardSlots": {
3708 "Fabric1": {
3709 "modelName": "7812R3-FM",
3710 "serialNum": "VITTHAL0104E",
3711 },
3712 "Fabric2": {
3713 "modelName": "7812R3-FM",
3714 "serialNum": "VITTHAL0104G",
3715 },
3716 "Supervisor1": {
3717 "modelName": "DCS-7816-SUP",
3718 "serialNum": "VITTHAL0104H",
3719 },
3720 "Supervisor2": {
3721 "modelName": "DCS-7816-SUP",
3722 "serialNum": "VITTHAL0104I",
3723 },
3724 "Linecard3": {
3725 "modelName": "7800R3A-36D-LC",
3726 "serialNum": "VITTHAL0104J",
3727 },
3728 "Linecard4": {
3729 "modelName": "7800R3A-36D-LC",
3730 "serialNum": "VITTHAL0104K",
3731 },
3732 "Linecard5": {
3733 "modelName": "7800R3A-36D-LC",
3734 "serialNum": "VITTHAL0104L",
3735 },
3736 "Superdupercard1": {
3737 "modelName": "7800R3A-36D-SDC",
3738 "serialNum": "VITTHAL0104M",
3739 },
3740 },
3741 }
3742 ],
3743 "expected": {
3744 "result": AntaTestStatus.SUCCESS,
3745 "atomic_results": [
3746 {
3747 "description": "Power Supplies",
3748 "result": AntaTestStatus.SUCCESS,
3749 },
3750 {"description": "Fan Trays", "result": AntaTestStatus.SUCCESS},
3751 {"description": "Fabric Cards", "result": AntaTestStatus.SUCCESS},
3752 {"description": "Supervisors", "result": AntaTestStatus.SUCCESS},
3753 {"description": "Line Cards", "result": AntaTestStatus.SUCCESS},
3754 ],
3755 },
3756 },
3757 (VerifyInventory, "success-specific-components"): {
3758 "eos_data": [
3759 {
3760 "powerSupplySlots": {
3761 "1": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104A"},
3762 "2": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104B"},
3763 },
3764 "fanTraySlots": {
3765 "1": {
3766 "numFans": 12,
3767 "name": "7812R3-FM",
3768 },
3769 "2": {
3770 "numFans": 12,
3771 "name": "7812R3-FM",
3772 },
3773 },
3774 "cardSlots": {
3775 "Fabric1": {
3776 "modelName": "7812R3-FM",
3777 "serialNum": "VITTHAL0104E",
3778 },
3779 "Fabric2": {
3780 "modelName": "7812R3-FM",
3781 "serialNum": "VITTHAL0104G",
3782 },
3783 "Supervisor1": {
3784 "modelName": "DCS-7816-SUP",
3785 "serialNum": "VITTHAL0104H",
3786 },
3787 "Supervisor2": {
3788 "modelName": "DCS-7816-SUP",
3789 "serialNum": "VITTHAL0104I",
3790 },
3791 "Linecard3": {
3792 "modelName": "7800R3A-36D-LC",
3793 "serialNum": "VITTHAL0104J",
3794 },
3795 "Linecard4": {
3796 "modelName": "7800R3A-36D-LC",
3797 "serialNum": "VITTHAL0104K",
3798 },
3799 },
3800 }
3801 ],
3802 "inputs": {"requirements": {"power_supplies": 2, "fan_trays": 2, "fabric_cards": 2, "line_cards": 2, "supervisors": 2}},
3803 "expected": {
3804 "result": AntaTestStatus.SUCCESS,
3805 "atomic_results": [
3806 {
3807 "description": "Power Supplies",
3808 "result": AntaTestStatus.SUCCESS,
3809 },
3810 {"description": "Fan Trays", "result": AntaTestStatus.SUCCESS},
3811 {"description": "Fabric Cards", "result": AntaTestStatus.SUCCESS},
3812 {"description": "Supervisors", "result": AntaTestStatus.SUCCESS},
3813 {"description": "Line Cards", "result": AntaTestStatus.SUCCESS},
3814 ],
3815 },
3816 },
3817 (VerifyInventory, "success-specific-components-skipped-when-not-provided"): {
3818 "eos_data": [
3819 {
3820 "powerSupplySlots": {
3821 "1": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104A"},
3822 "2": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104B"},
3823 },
3824 "fanTraySlots": {},
3825 "cardSlots": {
3826 "Fabric1": {
3827 "modelName": "7812R3-FM",
3828 "serialNum": "VITTHAL0104E",
3829 },
3830 "Fabric2": {
3831 "modelName": "7812R3-FM",
3832 "serialNum": "VITTHAL0104G",
3833 },
3834 "Fabric3": {
3835 "modelName": "Not Inserted",
3836 "serialNum": "VITTHAL0104G",
3837 },
3838 "Linecard3": {
3839 "modelName": "7800R3A-36D-LC",
3840 "serialNum": "VITTHAL0104J",
3841 },
3842 "Linecard4": {
3843 "modelName": "7800R3A-36D-LC",
3844 "serialNum": "VITTHAL0104K",
3845 },
3846 "Linecard5": {
3847 "modelName": "Not Inserted",
3848 "serialNum": "VITTHAL0104K",
3849 },
3850 },
3851 }
3852 ],
3853 "inputs": {"requirements": {"power_supplies": 2, "fabric_cards": 2, "line_cards": 2}},
3854 "expected": {
3855 "result": AntaTestStatus.SUCCESS,
3856 "atomic_results": [
3857 {
3858 "description": "Power Supplies",
3859 "result": AntaTestStatus.SUCCESS,
3860 },
3861 {"description": "Fabric Cards", "result": AntaTestStatus.SUCCESS},
3862 {"description": "Line Cards", "result": AntaTestStatus.SUCCESS},
3863 ],
3864 },
3865 },
3866 (VerifyInventory, "success-when-particular-component-strict-check"): {
3867 "eos_data": [
3868 {
3869 "powerSupplySlots": {
3870 "1": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104A"},
3871 "2": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104B"},
3872 },
3873 "fanTraySlots": {
3874 "1": {
3875 "numFans": 12,
3876 "name": "7812R3-FM",
3877 },
3878 "2": {
3879 "numFans": 12,
3880 "name": "7812R3-FM",
3881 },
3882 },
3883 "cardSlots": {
3884 "Fabric1": {
3885 "modelName": "7812R3-FM",
3886 "serialNum": "VITTHAL0104E",
3887 },
3888 "Fabric2": {
3889 "modelName": "7812R3-FM",
3890 "serialNum": "VITTHAL0104G",
3891 },
3892 "Supervisor1": {
3893 "modelName": "DCS-7816-SUP",
3894 "serialNum": "VITTHAL0104H",
3895 },
3896 "Supervisor2": {
3897 "modelName": "DCS-7816-SUP",
3898 "serialNum": "VITTHAL0104I",
3899 },
3900 "Linecard3": {
3901 "modelName": "7800R3A-36D-LC",
3902 "serialNum": "VITTHAL0104J",
3903 },
3904 "Linecard4": {
3905 "modelName": "7800R3A-36D-LC",
3906 "serialNum": "VITTHAL0104K",
3907 },
3908 },
3909 }
3910 ],
3911 "inputs": {"requirements": {"power_supplies": 2, "fan_trays": "all", "fabric_cards": 2, "line_cards": 2, "supervisors": "all"}},
3912 "expected": {
3913 "result": AntaTestStatus.SUCCESS,
3914 "atomic_results": [
3915 {
3916 "description": "Power Supplies",
3917 "result": AntaTestStatus.SUCCESS,
3918 },
3919 {"description": "Fan Trays", "result": AntaTestStatus.SUCCESS},
3920 {"description": "Fabric Cards", "result": AntaTestStatus.SUCCESS},
3921 {"description": "Supervisors", "result": AntaTestStatus.SUCCESS},
3922 {"description": "Line Cards", "result": AntaTestStatus.SUCCESS},
3923 ],
3924 },
3925 },
3926 (VerifyInventory, "failure"): {
3927 "eos_data": [
3928 {
3929 "powerSupplySlots": {
3930 "1": {"name": "Not Inserted", "serialNum": "VITTHAL0104A"},
3931 "2": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104B"},
3932 },
3933 "fanTraySlots": {
3934 "1": {
3935 "numFans": 12,
3936 "name": "Not Inserted",
3937 },
3938 "2": {
3939 "numFans": 12,
3940 "name": "7812R3-FM",
3941 },
3942 },
3943 "cardSlots": {
3944 "Fabric1": {
3945 "modelName": "Not Inserted",
3946 "serialNum": "VITTHAL0104E",
3947 },
3948 "Fabric2": {
3949 "modelName": "7812R3-FM",
3950 "serialNum": "VITTHAL0104G",
3951 },
3952 "Supervisor1": {
3953 "modelName": "Not Inserted",
3954 "serialNum": "VITTHAL0104H",
3955 },
3956 "Supervisor2": {
3957 "modelName": "DCS-7816-SUP",
3958 "serialNum": "VITTHAL0104I",
3959 },
3960 "Linecard3": {
3961 "modelName": "Not Inserted",
3962 "serialNum": "VITTHAL0104J",
3963 },
3964 "Linecard4": {
3965 "modelName": "7800R3A-36D-LC",
3966 "serialNum": "VITTHAL0104K",
3967 },
3968 "Linecard5": {
3969 "modelName": "7800R3A-36D-LC",
3970 "serialNum": "VITTHAL0104L",
3971 },
3972 },
3973 }
3974 ],
3975 "expected": {
3976 "result": AntaTestStatus.FAILURE,
3977 "messages": [
3978 "Power Supplies - Slot1 not inserted",
3979 "Fan Trays - Slot1 not inserted",
3980 "Fabric Cards - Fabric1 not inserted",
3981 "Supervisors - Supervisor1 not inserted",
3982 "Line Cards - Linecard3 not inserted",
3983 ],
3984 "atomic_results": [
3985 {"description": "Power Supplies", "result": AntaTestStatus.FAILURE, "messages": ["Slot1 not inserted"]},
3986 {"description": "Fan Trays", "result": AntaTestStatus.FAILURE, "messages": ["Slot1 not inserted"]},
3987 {"description": "Fabric Cards", "result": AntaTestStatus.FAILURE, "messages": ["Fabric1 not inserted"]},
3988 {"description": "Supervisors", "result": AntaTestStatus.FAILURE, "messages": ["Supervisor1 not inserted"]},
3989 {"description": "Line Cards", "result": AntaTestStatus.FAILURE, "messages": ["Linecard3 not inserted"]},
3990 ],
3991 },
3992 },
3993 (VerifyInventory, "failure-user-provided"): {
3994 "eos_data": [
3995 {
3996 "powerSupplySlots": {
3997 "1": {"name": "Not Inserted", "serialNum": "VITTHAL0104A"},
3998 "2": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104B"},
3999 },
4000 "fanTraySlots": {
4001 "1": {
4002 "numFans": 12,
4003 "name": "Not Inserted",
4004 },
4005 "2": {
4006 "numFans": 12,
4007 "name": "7812R3-FM",
4008 },
4009 },
4010 "cardSlots": {
4011 "Fabric1": {
4012 "modelName": "Not Inserted",
4013 "serialNum": "VITTHAL0104E",
4014 },
4015 "Fabric2": {
4016 "modelName": "7812R3-FM",
4017 "serialNum": "VITTHAL0104G",
4018 },
4019 "Supervisor1": {
4020 "modelName": "Not Inserted",
4021 "serialNum": "VITTHAL0104H",
4022 },
4023 "Supervisor2": {
4024 "modelName": "DCS-7816-SUP",
4025 "serialNum": "VITTHAL0104I",
4026 },
4027 "Linecard3": {
4028 "modelName": "Not Inserted",
4029 "serialNum": "VITTHAL0104J",
4030 },
4031 "Linecard4": {
4032 "modelName": "7800R3A-36D-LC",
4033 "serialNum": "VITTHAL0104K",
4034 },
4035 },
4036 }
4037 ],
4038 "inputs": {"requirements": {"power_supplies": 2, "fan_trays": 2, "fabric_cards": 2, "line_cards": 2, "supervisors": 2}},
4039 "expected": {
4040 "result": AntaTestStatus.FAILURE,
4041 "messages": [
4042 "Power Supplies - Count mismatch - Expected: >= 2 Actual: 1",
4043 "Fan Trays - Count mismatch - Expected: >= 2 Actual: 1",
4044 "Fabric Cards - Count mismatch - Expected: >= 2 Actual: 1",
4045 "Supervisors - Count mismatch - Expected: >= 2 Actual: 1",
4046 "Line Cards - Count mismatch - Expected: >= 2 Actual: 1",
4047 ],
4048 "atomic_results": [
4049 {"description": "Power Supplies", "result": AntaTestStatus.FAILURE, "messages": ["Count mismatch - Expected: >= 2 Actual: 1"]},
4050 {"description": "Fan Trays", "result": AntaTestStatus.FAILURE, "messages": ["Count mismatch - Expected: >= 2 Actual: 1"]},
4051 {"description": "Fabric Cards", "result": AntaTestStatus.FAILURE, "messages": ["Count mismatch - Expected: >= 2 Actual: 1"]},
4052 {"description": "Supervisors", "result": AntaTestStatus.FAILURE, "messages": ["Count mismatch - Expected: >= 2 Actual: 1"]},
4053 {"description": "Line Cards", "result": AntaTestStatus.FAILURE, "messages": ["Count mismatch - Expected: >= 2 Actual: 1"]},
4054 ],
4055 },
4056 },
4057 (VerifyInventory, "failure-specific-component"): {
4058 "eos_data": [
4059 {
4060 "powerSupplySlots": {
4061 "1": {"name": "Not Inserted", "serialNum": "VITTHAL0104A"},
4062 "2": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104B"},
4063 },
4064 "fanTraySlots": {
4065 "1": {
4066 "numFans": 12,
4067 "name": "Not Inserted",
4068 },
4069 "2": {
4070 "numFans": 12,
4071 "name": "7812R3-FM",
4072 },
4073 },
4074 "cardSlots": {
4075 "Fabric1": {
4076 "modelName": "Not Inserted",
4077 "serialNum": "VITTHAL0104E",
4078 },
4079 "Fabric2": {
4080 "modelName": "7812R3-FM",
4081 "serialNum": "VITTHAL0104G",
4082 },
4083 "Supervisor1": {
4084 "modelName": "Not Inserted",
4085 "serialNum": "VITTHAL0104H",
4086 },
4087 "Supervisor2": {
4088 "modelName": "DCS-7816-SUP",
4089 "serialNum": "VITTHAL0104I",
4090 },
4091 "Linecard3": {
4092 "modelName": "Not Inserted",
4093 "serialNum": "VITTHAL0104J",
4094 },
4095 "Linecard4": {
4096 "modelName": "7800R3A-36D-LC",
4097 "serialNum": "VITTHAL0104K",
4098 },
4099 },
4100 }
4101 ],
4102 "inputs": {"requirements": {"power_supplies": 2, "fan_trays": 2}},
4103 "expected": {
4104 "result": AntaTestStatus.FAILURE,
4105 "messages": [
4106 "Power Supplies - Count mismatch - Expected: >= 2 Actual: 1",
4107 "Fan Trays - Count mismatch - Expected: >= 2 Actual: 1",
4108 ],
4109 "atomic_results": [
4110 {"description": "Power Supplies", "result": AntaTestStatus.FAILURE, "messages": ["Count mismatch - Expected: >= 2 Actual: 1"]},
4111 {"description": "Fan Trays", "result": AntaTestStatus.FAILURE, "messages": ["Count mismatch - Expected: >= 2 Actual: 1"]},
4112 ],
4113 },
4114 },
4115 (VerifyInventory, "failure-specific-skipped"): {
4116 "eos_data": [
4117 {
4118 "powerSupplySlots": {
4119 "1": {"name": "Not Inserted", "serialNum": "VITTHAL0104A"},
4120 "2": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104B"},
4121 },
4122 "fanTraySlots": {
4123 "1": {
4124 "numFans": 12,
4125 "name": "Not Inserted",
4126 },
4127 "2": {
4128 "numFans": 12,
4129 "name": "7812R3-FM",
4130 },
4131 },
4132 "cardSlots": {
4133 "Fabric1": {
4134 "modelName": "Not Inserted",
4135 "serialNum": "VITTHAL0104E",
4136 },
4137 "Fabric2": {
4138 "modelName": "7812R3-FM",
4139 "serialNum": "VITTHAL0104G",
4140 },
4141 "Supervisor1": {
4142 "modelName": "Not Inserted",
4143 "serialNum": "VITTHAL0104H",
4144 },
4145 "Supervisor2": {
4146 "modelName": "DCS-7816-SUP",
4147 "serialNum": "VITTHAL0104I",
4148 },
4149 "Linecard3": {
4150 "modelName": "Not Inserted",
4151 "serialNum": "VITTHAL0104J",
4152 },
4153 "Linecard4": {
4154 "modelName": "7800R3A-36D-LC",
4155 "serialNum": "VITTHAL0104K",
4156 },
4157 },
4158 }
4159 ],
4160 "inputs": {"requirements": {"fan_trays": 2, "fabric_cards": "all", "line_cards": "all", "supervisors": "all"}},
4161 "expected": {
4162 "result": AntaTestStatus.FAILURE,
4163 "messages": [
4164 "Fan Trays - Count mismatch - Expected: >= 2 Actual: 1",
4165 "Fabric Cards - Fabric1 not inserted",
4166 "Supervisors - Supervisor1 not inserted",
4167 "Line Cards - Linecard3 not inserted",
4168 ],
4169 "atomic_results": [
4170 {"description": "Fan Trays", "result": AntaTestStatus.FAILURE, "messages": ["Count mismatch - Expected: >= 2 Actual: 1"]},
4171 {"description": "Fabric Cards", "result": AntaTestStatus.FAILURE, "messages": ["Fabric1 not inserted"]},
4172 {"description": "Supervisors", "result": AntaTestStatus.FAILURE, "messages": ["Supervisor1 not inserted"]},
4173 {"description": "Line Cards", "result": AntaTestStatus.FAILURE, "messages": ["Linecard3 not inserted"]},
4174 ],
4175 },
4176 },
4177 (VerifyInventory, "failure-unidentified"): {
4178 "eos_data": [
4179 {
4180 "powerSupplySlots": {
4181 "1": {"name": "Not Inserted", "serialNum": "VITTHAL0104A"},
4182 "2": {"name": "PWR-D1-3041-AC-BLUE", "serialNum": "VITTHAL0104B"},
4183 },
4184 "fanTraySlots": {
4185 "1": {
4186 "numFans": 12,
4187 "name": "Not Inserted",
4188 },
4189 "2": {
4190 "numFans": 12,
4191 "name": "7812R3-FM",
4192 },
4193 },
4194 "cardSlots": {
4195 "Fabric1": {
4196 "modelName": "Not Inserted",
4197 "serialNum": "VITTHAL0104E",
4198 },
4199 "Fabric2": {
4200 "modelName": "7812R3-FM",
4201 "serialNum": "VITTHAL0104G",
4202 },
4203 "Supervisor1": {
4204 "modelName": "Not Inserted",
4205 "serialNum": "VITTHAL0104H",
4206 },
4207 "Supervisor2": {
4208 "modelName": "DCS-7816-SUP",
4209 "serialNum": "VITTHAL0104I",
4210 },
4211 "Linecard3": {
4212 "modelName": "",
4213 "serialNum": "",
4214 },
4215 "Linecard4": {
4216 "modelName": "7800R3A-36D-LC",
4217 "serialNum": "VITTHAL0104K",
4218 },
4219 "Linecard5": {
4220 "modelName": "7800R3A-36D-LC",
4221 "serialNum": "VITTHAL0104L",
4222 },
4223 },
4224 }
4225 ],
4226 "expected": {
4227 "result": AntaTestStatus.FAILURE,
4228 "messages": [
4229 "Power Supplies - Slot1 not inserted",
4230 "Fan Trays - Slot1 not inserted",
4231 "Fabric Cards - Fabric1 not inserted",
4232 "Supervisors - Supervisor1 not inserted",
4233 "Line Cards - Linecard3 unidentified component",
4234 ],
4235 "atomic_results": [
4236 {"description": "Power Supplies", "result": AntaTestStatus.FAILURE, "messages": ["Slot1 not inserted"]},
4237 {"description": "Fan Trays", "result": AntaTestStatus.FAILURE, "messages": ["Slot1 not inserted"]},
4238 {"description": "Fabric Cards", "result": AntaTestStatus.FAILURE, "messages": ["Fabric1 not inserted"]},
4239 {"description": "Supervisors", "result": AntaTestStatus.FAILURE, "messages": ["Supervisor1 not inserted"]},
4240 {"description": "Line Cards", "result": AntaTestStatus.FAILURE, "messages": ["Linecard3 unidentified component"]},
4241 ],
4242 },
4243 },
4244 (VerifyInventory, "failure-multiple"): {
4245 "eos_data": [
4246 {
4247 "powerSupplySlots": {
4248 "1": {"name": "Not Inserted", "serialNum": "VITTHAL0104A"},
4249 "2": {"name": "Not Inserted", "serialNum": "VITTHAL0104B"},
4250 },
4251 "fanTraySlots": {
4252 "1": {
4253 "numFans": 12,
4254 "name": "7812R3-FM1",
4255 },
4256 "2": {
4257 "numFans": 12,
4258 "name": "7812R3-FM",
4259 },
4260 },
4261 "cardSlots": {
4262 "Fabric1": {
4263 "modelName": "Not Inserted",
4264 "serialNum": "VITTHAL0104E",
4265 },
4266 "Fabric2": {
4267 "modelName": "Not Inserted",
4268 "serialNum": "VITTHAL0104G",
4269 },
4270 "Supervisor1": {
4271 "modelName": "DCS-7816-SUP1",
4272 "serialNum": "VITTHAL0104H",
4273 },
4274 "Supervisor2": {
4275 "modelName": "DCS-7816-SUP",
4276 "serialNum": "VITTHAL0104I",
4277 },
4278 "Linecard3": {
4279 "modelName": "7800R3A-36E-LC",
4280 "serialNum": "VITTHAL0104M",
4281 },
4282 "Linecard4": {
4283 "modelName": "7800R3A-36D-LC",
4284 "serialNum": "VITTHAL0104K",
4285 },
4286 "Linecard5": {
4287 "modelName": "7800R3A-36D-LC",
4288 "serialNum": "VITTHAL0104L",
4289 },
4290 },
4291 }
4292 ],
4293 "expected": {
4294 "result": AntaTestStatus.FAILURE,
4295 "messages": [
4296 "Power Supplies - Slot1 not inserted",
4297 "Power Supplies - Slot2 not inserted",
4298 "Fabric Cards - Fabric1 not inserted",
4299 "Fabric Cards - Fabric2 not inserted",
4300 ],
4301 "atomic_results": [
4302 {"description": "Power Supplies", "result": AntaTestStatus.FAILURE, "messages": ["Slot1 not inserted", "Slot2 not inserted"]},
4303 {"description": "Fan Trays", "result": AntaTestStatus.SUCCESS},
4304 {"description": "Fabric Cards", "result": AntaTestStatus.FAILURE, "messages": ["Fabric1 not inserted", "Fabric2 not inserted"]},
4305 {"description": "Supervisors", "result": AntaTestStatus.SUCCESS},
4306 {"description": "Line Cards", "result": AntaTestStatus.SUCCESS},
4307 ],
4308 },
4309 },
4310 (VerifyHardwareCapacityUtilization, "success-strict-mode-true"): {
4311 "eos_data": [
4312 {
4313 "thresholds": {
4314 "ISEM3": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4315 "ESEM": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4316 "ISEM2": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4317 }
4318 },
4319 {"tables": []},
4320 ],
4321 "inputs": {"strict_mode": True},
4322 "expected": {"result": AntaTestStatus.SUCCESS},
4323 },
4324 (VerifyHardwareCapacityUtilization, "success-strict-mode-false"): {
4325 "eos_data": [
4326 {
4327 "thresholds": {
4328 "ISEM3": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4329 "ESEM": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4330 "ISEM2": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4331 }
4332 },
4333 {
4334 "tables": [
4335 {
4336 "table": "EcnProtocol",
4337 "feature": "StrataQosV2",
4338 "chip": "Linecard0/0",
4339 "used": 4,
4340 "usedPercent": 100,
4341 "free": 0,
4342 "committed": 0,
4343 "maxLimit": 4,
4344 "highWatermark": 0,
4345 "sharedFeatures": [],
4346 }
4347 ]
4348 },
4349 ],
4350 "inputs": {"strict_mode": False},
4351 "expected": {"result": AntaTestStatus.SUCCESS},
4352 },
4353 (VerifyHardwareCapacityUtilization, "success-input-param"): {
4354 "eos_data": [
4355 {
4356 "thresholds": {
4357 "ISEM3": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4358 "ESEM": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4359 "ISEM2": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4360 }
4361 },
4362 {"tables": []},
4363 ],
4364 "inputs": {"capacity_utilization_threshold": 80},
4365 "expected": {"result": AntaTestStatus.SUCCESS},
4366 },
4367 (VerifyHardwareCapacityUtilization, "failure"): {
4368 "eos_data": [
4369 {
4370 "thresholds": {
4371 "InLIF-PortDefault": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4372 "InLIF": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4373 "ISEM2": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4374 "InLIF-TunnelTermination": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4375 }
4376 },
4377 {
4378 "tables": [
4379 {
4380 "table": "InLIF",
4381 "feature": "PortDefault",
4382 "chip": "Fap14/0",
4383 "used": 4,
4384 "usedPercent": 94,
4385 "free": 244,
4386 "committed": 90,
4387 "maxLimit": 256,
4388 "highWatermark": 12,
4389 "sharedFeatures": [],
4390 },
4391 {
4392 "table": "ISEM2",
4393 "feature": "",
4394 "chip": "Fap14/0",
4395 "used": 434,
4396 "usedPercent": 85,
4397 "free": 21153,
4398 "committed": 0,
4399 "maxLimit": 21587,
4400 "highWatermark": 435,
4401 "sharedFeatures": [],
4402 },
4403 {
4404 "table": "InLIF",
4405 "feature": "",
4406 "chip": "",
4407 "used": 30,
4408 "usedPercent": 81,
4409 "free": 226,
4410 "committed": 0,
4411 "maxLimit": 256,
4412 "highWatermark": 30,
4413 "sharedFeatures": [],
4414 },
4415 {
4416 "table": "InLIF",
4417 "feature": "TunnelTermination",
4418 "chip": "",
4419 "used": 30,
4420 "usedPercent": 81,
4421 "free": 226,
4422 "committed": 0,
4423 "maxLimit": 256,
4424 "highWatermark": 30,
4425 "sharedFeatures": [],
4426 },
4427 ]
4428 },
4429 ],
4430 "inputs": {"capacity_utilization_threshold": 80},
4431 "expected": {
4432 "result": AntaTestStatus.FAILURE,
4433 "messages": [
4434 "Table: InLIF Chip: Fap14/0 Feature: PortDefault - Capacity above threshold - Expected: < 80.0% Actual: 94%",
4435 "Table: ISEM2 Chip: Fap14/0 - Capacity above threshold - Expected: < 80.0% Actual: 85%",
4436 "Table: InLIF - Capacity above threshold - Expected: < 80.0% Actual: 81%",
4437 "Table: InLIF Feature: TunnelTermination - Capacity above threshold - Expected: < 80.0% Actual: 81%",
4438 ],
4439 },
4440 },
4441 (VerifyHardwareCapacityUtilization, "failure-strict-mode-true"): {
4442 "eos_data": [
4443 {
4444 "thresholds": {
4445 "InLIF-PortDefault": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4446 "InLIF": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4447 "ISEM2": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4448 "InLIF-TunnelTermination": {"configThreshold": 90, "configClearThreshold": 90, "defaultThreshold": 90},
4449 }
4450 },
4451 {
4452 "tables": [
4453 {
4454 "table": "InLIF",
4455 "feature": "PortDefault",
4456 "chip": "Fap14/0",
4457 "used": 4,
4458 "usedPercent": 94,
4459 "free": 244,
4460 "committed": 90,
4461 "maxLimit": 256,
4462 "highWatermark": 12,
4463 "sharedFeatures": [],
4464 },
4465 {
4466 "table": "ISEM2",
4467 "feature": "",
4468 "chip": "Fap14/0",
4469 "used": 434,
4470 "usedPercent": 85,
4471 "free": 21153,
4472 "committed": 0,
4473 "maxLimit": 21587,
4474 "highWatermark": 435,
4475 "sharedFeatures": [],
4476 },
4477 {
4478 "table": "InLIF",
4479 "feature": "",
4480 "chip": "",
4481 "used": 30,
4482 "usedPercent": 81,
4483 "free": 226,
4484 "committed": 0,
4485 "maxLimit": 256,
4486 "highWatermark": 30,
4487 "sharedFeatures": [],
4488 },
4489 {
4490 "table": "InLIF",
4491 "feature": "TunnelTermination",
4492 "chip": "",
4493 "used": 30,
4494 "usedPercent": 81,
4495 "free": 226,
4496 "committed": 0,
4497 "maxLimit": 256,
4498 "highWatermark": 30,
4499 "sharedFeatures": [],
4500 },
4501 {
4502 "table": "EcnProtocol",
4503 "feature": "StrataQosV2",
4504 "chip": "Linecard0/0",
4505 "used": 4,
4506 "usedPercent": 100,
4507 "free": 0,
4508 "committed": 0,
4509 "maxLimit": 4,
4510 "highWatermark": 0,
4511 "sharedFeatures": [],
4512 },
4513 ]
4514 },
4515 ],
4516 "inputs": {"capacity_utilization_threshold": 80, "strict_mode": True},
4517 "expected": {
4518 "result": AntaTestStatus.FAILURE,
4519 "messages": [
4520 "Table: InLIF Chip: Fap14/0 Feature: PortDefault - Capacity above threshold - Expected: < 80.0% Actual: 94%",
4521 "Table: ISEM2 Chip: Fap14/0 - Capacity above threshold - Expected: < 80.0% Actual: 85%",
4522 "Table: InLIF - Capacity above threshold - Expected: < 80.0% Actual: 81%",
4523 "Table: InLIF Feature: TunnelTermination - Capacity above threshold - Expected: < 80.0% Actual: 81%",
4524 "Table: EcnProtocol Chip: Linecard0/0 Feature: StrataQosV2 - Capacity above threshold - Expected: < 80.0% Actual: 100%",
4525 ],
4526 },
4527 },
4528 (VerifyModuleStatus, "success-dual-supervisor-active-standby"): {
4529 "eos_data": [
4530 {
4531 "modules": {
4532 "1": {"status": "active", "modelName": "SUP"},
4533 "2": {"status": "standby", "modelName": "SUP"},
4534 "3": {"status": "ok", "modelName": "LC"},
4535 }
4536 },
4537 {
4538 "modules": {
4539 "Linecard3": {"risers": {"13": {"powerGood": True}}},
4540 }
4541 },
4542 ],
4543 "expected": {"result": AntaTestStatus.SUCCESS},
4544 },
4545 (VerifyModuleStatus, "success-single-supervisor-system"): {
4546 "inputs": {"supervisor_mode": "single"},
4547 "eos_data": [
4548 {
4549 "modules": {
4550 "1": {"status": "active", "modelName": "SUP"},
4551 "2": {"status": "ok", "modelName": "LC"},
4552 }
4553 },
4554 {
4555 "modules": {
4556 "Linecard3": {"risers": {"6": {"powerGood": True}}},
4557 }
4558 },
4559 ],
4560 "expected": {"result": AntaTestStatus.SUCCESS},
4561 },
4562 (VerifyModuleStatus, "failure-dual-supervisor-primary-sup-not-found"): {
4563 "eos_data": [
4564 {"modules": {"2": {"status": "standby", "modelName": "SUP"}}},
4565 {"modules": {}},
4566 ],
4567 "expected": {
4568 "result": AntaTestStatus.FAILURE,
4569 "messages": ["Dual-Supervisor Mode - Standby supervisor is missing"],
4570 },
4571 },
4572 (VerifyModuleStatus, "failure-peer-supervisor-not-standby"): {
4573 "eos_data": [
4574 {
4575 "modules": {
4576 "1": {"status": "active", "modelName": "SUP"},
4577 "2": {"status": "poweredOff", "modelName": "SUP"},
4578 }
4579 },
4580 {"modules": {}},
4581 ],
4582 "expected": {
4583 "result": AntaTestStatus.FAILURE,
4584 "messages": ["Dual-Supervisor Mode - Incorrect statuses - Expected: active/standby Actual: active/poweredOff"],
4585 },
4586 },
4587 (VerifyModuleStatus, "failure-single-supervisor-missing"): {
4588 "inputs": {"supervisor_mode": "single"},
4589 "eos_data": [
4590 {"modules": {}},
4591 {"modules": {}},
4592 ],
4593 "expected": {
4594 "result": AntaTestStatus.FAILURE,
4595 "messages": ["Single-Supervisor Mode - Active supervisor is missing"],
4596 },
4597 },
4598 (VerifyModuleStatus, "failure-single-supervisor-state-mismatch"): {
4599 "inputs": {"supervisor_mode": "single"},
4600 "eos_data": [
4601 {"modules": {"1": {"status": "poweredOff", "modelName": "SUP"}}},
4602 {"modules": {}},
4603 ],
4604 "expected": {
4605 "result": AntaTestStatus.FAILURE,
4606 "messages": ["Single-Supervisor Mode - Incorrect status - Expected: active Actual: poweredOff"],
4607 },
4608 },
4609 (VerifyModuleStatus, "failure-single-supervisor-invalid-cardslots-state"): {
4610 "inputs": {"supervisor_mode": "single"},
4611 "eos_data": [
4612 {
4613 "modules": {
4614 "1": {"status": "active", "modelName": "SUP"},
4615 "2": {"status": "failed", "modelName": "LC-2"},
4616 "3": {"status": "poweredOff", "modelName": "LC-3"},
4617 "4": {"status": "failed", "modelName": "LC-4"},
4618 }
4619 },
4620 {"modules": {}},
4621 ],
4622 "expected": {
4623 "result": AntaTestStatus.FAILURE,
4624 "messages": [
4625 "Single-Supervisor Mode - Module: 2 Model: LC-2 - Invalid status - Expected: ok Actual: failed",
4626 "Single-Supervisor Mode - Module: 3 Model: LC-3 - Invalid status - Expected: ok Actual: poweredOff",
4627 "Single-Supervisor Mode - Module: 4 Model: LC-4 - Invalid status - Expected: ok Actual: failed",
4628 ],
4629 },
4630 },
4631 (VerifyModuleStatus, "failure-dual-supervisor-power-unstable"): {
4632 "eos_data": [
4633 {
4634 "modules": {
4635 "1": {"status": "standby", "modelName": "SUP"},
4636 "2": {"status": "active", "modelName": "SUP"},
4637 }
4638 },
4639 {
4640 "modules": {
4641 "Linecard10": {"risers": {"3": {"powerGood": False}}},
4642 "Linecard3": {"risers": {"6": {"powerGood": False}, "13": {"powerGood": False}}},
4643 "Linecard14": {"risers": {"2": {"powerGood": False}}},
4644 }
4645 },
4646 ],
4647 "expected": {
4648 "result": AntaTestStatus.FAILURE,
4649 "messages": [
4650 "Dual-Supervisor Mode - Module: Linecard10 Riser 3 - Power is not stable",
4651 "Dual-Supervisor Mode - Module: Linecard3 Riser 6 - Power is not stable",
4652 "Dual-Supervisor Mode - Module: Linecard3 Riser 13 - Power is not stable",
4653 "Dual-Supervisor Mode - Module: Linecard14 Riser 2 - Power is not stable",
4654 ],
4655 },
4656 },
4657 (VerifyModuleStatus, "failure-dual-supervisor-all"): {
4658 "inputs": {"module_statuses": ["ok", "disabled"]},
4659 "eos_data": [
4660 {
4661 "modules": {
4662 "1": {"status": "standby", "modelName": "SUP"},
4663 "2": {"status": "active", "modelName": "SUP"},
4664 "4": {"status": "disabled", "modelName": "LC-OK"},
4665 "Fabric1": {"status": "notok", "modelName": "FAB-BAD-1"},
4666 "Fabric2": {"status": "failed", "modelName": "FAB-BAD-2"},
4667 "Fabric3": {"status": "poweredOff", "modelName": "FAB-BAD-3"},
4668 }
4669 },
4670 {
4671 "modules": {
4672 "Linecard3": {"risers": {"6": {"powerGood": False}}},
4673 }
4674 },
4675 ],
4676 "expected": {
4677 "result": AntaTestStatus.FAILURE,
4678 "messages": [
4679 "Dual-Supervisor Mode - Module: Fabric1 Model: FAB-BAD-1 - Invalid status - Expected: ok, disabled Actual: notok",
4680 "Dual-Supervisor Mode - Module: Fabric2 Model: FAB-BAD-2 - Invalid status - Expected: ok, disabled Actual: failed",
4681 "Dual-Supervisor Mode - Module: Fabric3 Model: FAB-BAD-3 - Invalid status - Expected: ok, disabled Actual: poweredOff",
4682 "Dual-Supervisor Mode - Module: Linecard3 Riser 6 - Power is not stable",
4683 ],
4684 },
4685 },
4686 }