From 9649b65d4591b276f2f648cae244250528370bef Mon Sep 17 00:00:00 2001 From: Shengming Yuan <11619780+ssysm@users.noreply.github.com> Date: Tue, 29 Jul 2025 12:31:59 -0400 Subject: [PATCH] Test: ELM327 GM camera diagnostic address with malformed length (#2583) test GM camera diagnostic address with malformed length --- opendbc/safety/tests/test_elm327.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opendbc/safety/tests/test_elm327.py b/opendbc/safety/tests/test_elm327.py index a499a051..eb703e16 100755 --- a/opendbc/safety/tests/test_elm327.py +++ b/opendbc/safety/tests/test_elm327.py @@ -40,6 +40,9 @@ class TestElm327(TestDefaultRxHookBase): should_tx = (byte >> 4) <= 3 self.assertEqual(should_tx, self._tx(common.make_msg(0, GM_CAMERA_DIAG_ADDR, dat=bytes([byte] * 8)))) + # test GM camera diagnostic address with malformed length + self.assertEqual(False, self._tx(common.make_msg(0, GM_CAMERA_DIAG_ADDR, dat=bytes([0x00] * 7)))) + def test_tx_hook_on_wrong_safety_mode(self): # No point, since we allow many diagnostic addresses pass