From b4ee17e6b619877ead6607f6519d02a481cd4ab4 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Mon, 30 Sep 2024 21:27:43 -0700 Subject: [PATCH 1/3] test --- tests/safety/test_honda.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/safety/test_honda.py b/tests/safety/test_honda.py index 082199c02b..e7d07ad5e3 100755 --- a/tests/safety/test_honda.py +++ b/tests/safety/test_honda.py @@ -447,6 +447,17 @@ def setUp(self): self.safety.set_safety_hooks(Panda.SAFETY_HONDA_BOSCH, 0) self.safety.init_tests() + def _bosh_supplemental_cmd_msg(self): + values = {"SET_ME_X04": 0x04, "SET_ME_X80": 0x80, "SET_ME_X10": 0x10} + return self.packer.make_can_msg_panda("BOSCH_SUPPLEMENTAL_1", 0, values) + + def test_supplemental_control_check(self): + msg = self._bosh_supplemental_cmd_msg() + self.assertTrue(self._tx(msg)) + + msg[0].data[0] = 42; + self.assertFalse(self._tx(msg)) + class TestHondaBoschAltBrakeSafety(HondaPcmEnableBase, TestHondaBoschAltBrakeSafetyBase): """ From 13e34430ec4a62a1f8830949ad4426304584a644 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Mon, 30 Sep 2024 21:45:21 -0700 Subject: [PATCH 2/3] all cases --- tests/safety/test_honda.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/safety/test_honda.py b/tests/safety/test_honda.py index e7d07ad5e3..d0a16b1fd1 100755 --- a/tests/safety/test_honda.py +++ b/tests/safety/test_honda.py @@ -455,9 +455,19 @@ def test_supplemental_control_check(self): msg = self._bosh_supplemental_cmd_msg() self.assertTrue(self._tx(msg)) + msg = self._bosh_supplemental_cmd_msg() msg[0].data[0] = 42; self.assertFalse(self._tx(msg)) + msg = self._bosh_supplemental_cmd_msg() + msg[0].data[4] = 42; + self.assertFalse(self._tx(msg)) + + msg = self._bosh_supplemental_cmd_msg() + msg[0].data[4] = 0; + msg[0].data[7] = 42; + self.assertTrue(self._tx(msg)) + class TestHondaBoschAltBrakeSafety(HondaPcmEnableBase, TestHondaBoschAltBrakeSafetyBase): """ From 22af923ec2b51aab05fbf31644bdd54f936fefc0 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Tue, 1 Oct 2024 10:20:32 -0700 Subject: [PATCH 3/3] this is not c --- tests/safety/test_honda.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/safety/test_honda.py b/tests/safety/test_honda.py index d0a16b1fd1..592c24b64a 100755 --- a/tests/safety/test_honda.py +++ b/tests/safety/test_honda.py @@ -456,16 +456,16 @@ def test_supplemental_control_check(self): self.assertTrue(self._tx(msg)) msg = self._bosh_supplemental_cmd_msg() - msg[0].data[0] = 42; + msg[0].data[0] = 42 self.assertFalse(self._tx(msg)) msg = self._bosh_supplemental_cmd_msg() - msg[0].data[4] = 42; + msg[0].data[4] = 42 self.assertFalse(self._tx(msg)) msg = self._bosh_supplemental_cmd_msg() - msg[0].data[4] = 0; - msg[0].data[7] = 42; + msg[0].data[4] = 0 + msg[0].data[7] = 42 self.assertTrue(self._tx(msg))