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 20b990a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/safety/test_ford.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,20 @@ 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._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 20b990a

Please sign in to comment.