Skip to content

Commit

Permalink
mutation experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyhaibin committed Nov 23, 2024
1 parent bdbb674 commit 51640b6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/safety/test_ford.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,21 @@ def _acc_button_msg(self, button: int, bus: int):
}
return self.packer.make_can_msg_panda("Steering_Data_FD1", bus, values)

def _acc_state_msg(self, main_on):
brake = self.safety.get_brake_pressed_prev()
values = {
"BpedDrvAppl_D_Actl": 2 if brake else 1,
"CcStat_D_Actl": 3 if main_on else 0,
}
return self.packer.make_can_msg_panda("EngBrakeData", 0, values)

def test_disengage_on_main(self):
self.safety.set_controls_allowed(True)
self._rx(self._acc_state_msg(True))
self.assertTrue(self.safety.get_controls_allowed())
self._rx(self._acc_state_msg(False))
self.assertFalse(self.safety.get_controls_allowed())

def test_rx_hook(self):
# checksum, counter, and quality flag checks
for quality_flag in [True, False]:
Expand Down

0 comments on commit 51640b6

Please sign in to comment.