@@ -221,12 +221,10 @@ def test_a_healthy_pair_is_operational(mocker, task):
221221 ("change" , "reason" ),
222222 [
223223 ({"peer" : ("S2" , "down" )}, "HA peer connection not up" ),
224- ({"peer" : ("S9" , "up" )}, "HA peer serial mismatch" ),
225224 ({"mate_peer" : ("S9" , "up" )}, "Mate peer serial mismatch" ),
226225 ({"mate_peer" : ("S1" , "down" )}, "Mate peer connection not up" ),
227- ({"mate_switch" : "leaf-1" }, "same switch" ),
228226 ],
229- ids = ["peer-down" , "wrong-peer" , " mate-sees-other" , "mate-down" , "same-switch " ],
227+ ids = ["peer-down" , "mate-sees-other" , "mate-down" ],
230228)
231229def test_an_unhealthy_pair_is_not_operational (mocker , task , change , reason ):
232230 device = _ha_pair (mocker , task , ** change )
@@ -237,6 +235,25 @@ def test_an_unhealthy_pair_is_not_operational(mocker, task, change, reason):
237235 assert reason in node .last_error
238236
239237
238+ @pytest .mark .parametrize (
239+ ("change" , "reason" ),
240+ [
241+ ({"peer" : ("S9" , "up" )}, "HA peer serial mismatch" ),
242+ ({"mate_switch" : "leaf-1" }, "same switch" ),
243+ ],
244+ ids = ["wrong-peer" , "same-switch" ],
245+ )
246+ def test_a_cabling_fault_fails_inspection (mocker , task , change , reason ):
247+ device = _ha_pair (mocker , task , ** change )
248+
249+ with pytest .raises (exception .HardwareInspectionFailure , match = reason ):
250+ _validate_ha (task , device )
251+
252+ assert task .node .extra ["ha_operational" ] is False
253+ assert reason in task .node .last_error
254+ task .node .save .assert_called_once ()
255+
256+
240257def test_a_local_link_down_never_contacts_the_mate (mocker , task ):
241258 device = _ha_pair (mocker , task , hsci = "down" )
242259
0 commit comments