|
15 | 15 | eqptSupC = "eqptSupC.json" |
16 | 16 |
|
17 | 17 | @pytest.mark.parametrize( |
18 | | - "icurl_outputs, tversion, fabric_nodes, expected_result, expected_data", |
| 18 | + "icurl_outputs, tversion, fabric_nodes, expected_result, expected_data, expected_unformatted_data", |
19 | 19 | [ |
20 | 20 | # FAIL - unsupported Gen1 and 6.1(1)+ deprecated hardware found |
21 | 21 | ( |
|
34 | 34 | ["6.1(1f)", "101", "N2K-C2232PP-10GE", "FEX", "Deprecated from 6.1(1)+"], |
35 | 35 | ["6.1(1f)", "1001", "N9K-SUP-B", "Supervisor", "Deprecated from 6.1(1)+"], |
36 | 36 | ], |
| 37 | + [], |
37 | 38 | ), |
38 | 39 | # PASS - no unsupported hardware found |
39 | 40 | ( |
|
46 | 47 | read_data(dir, "fabricNode_supported_only.json"), |
47 | 48 | script.PASS, |
48 | 49 | [], |
| 50 | + [], |
49 | 51 | ), |
50 | 52 | # FAIL - pre 6.1(1f): only Gen1 hit should be reported |
51 | 53 | ( |
|
56 | 58 | read_data(dir, "fabricNode_with_unsupported_hardware.json"), |
57 | 59 | script.FAIL_UF, |
58 | 60 | [["6.1(1a)", "101", "N9K-C9372TX-E", "Switch", "Not supported on 5.x+"]], |
| 61 | + [], |
59 | 62 | ), |
60 | 63 | # PASS - pre 5.x: unsupported hardware checks should not trigger |
61 | 64 | ( |
|
68 | 71 | read_data(dir, "fabricNode_with_unsupported_hardware.json"), |
69 | 72 | script.PASS, |
70 | 73 | [], |
| 74 | + [], |
71 | 75 | ), |
72 | 76 | # FAIL - 6.0(1)+ unsupported switch model |
73 | 77 | ( |
|
87 | 91 | ], |
88 | 92 | script.FAIL_UF, |
89 | 93 | [["6.0(1a)", "201", "N9K-C93120TX", "Switch", "Deprecated from 6.0(1)+"]], |
| 94 | + [], |
90 | 95 | ), |
91 | 96 | # PASS - empty fabric nodes and supported inventory |
92 | 97 | ( |
|
99 | 104 | [], |
100 | 105 | script.PASS, |
101 | 106 | [], |
| 107 | + [], |
| 108 | + ), |
| 109 | + # FAIL - expansion module with unformatted DN (no topology/pod-X/node-Y prefix); |
| 110 | + # the entry should appear in unformatted_data with the raw DN, not in data |
| 111 | + ( |
| 112 | + { |
| 113 | + eqptLC: read_data(dir, "eqptLC_with_unformatted_dn.json"), |
| 114 | + }, |
| 115 | + "5.0(1a)", |
| 116 | + [], |
| 117 | + script.FAIL_UF, |
| 118 | + [], |
| 119 | + [["5.0(1a)", "sys/ch/lcslot-1/lc", "N9K-M6PQ", "Expansion Module", "Not supported on 5.x+"]], |
102 | 120 | ), |
103 | 121 | ], |
104 | 122 | ) |
105 | | -def test_logic(run_check, mock_icurl, tversion, fabric_nodes, expected_result, expected_data): |
| 123 | +def test_logic(run_check, mock_icurl, tversion, fabric_nodes, expected_result, expected_data, expected_unformatted_data): |
106 | 124 | result = run_check( |
107 | 125 | tversion=script.AciVersion(tversion) if tversion else None, |
108 | 126 | fabric_nodes=fabric_nodes, |
109 | 127 | ) |
110 | 128 |
|
111 | 129 | assert result.result == expected_result |
112 | 130 | assert result.data == expected_data |
| 131 | + assert result.unformatted_data == expected_unformatted_data |
0 commit comments