Cover Honda callback bounds and RDX gas limits

This commit is contained in:
firestar5683
2026-11-19 21:50:55 -06:00
parent e5ea759719
commit 1cd4feed89
3 changed files with 12 additions and 5 deletions
@@ -62,7 +62,7 @@ class TestHondaInterceptor(unittest.TestCase):
data[5] = pedal_crc(data)
return message[0], bytes(data), message[2]
def _assert_callbacks_finish(self, words):
def _assert_callbacks_finish(self, words, experience=0):
try:
mutant = libsafety_py.libsafety.mutation_get_active_mutant()
except AttributeError:
@@ -82,6 +82,10 @@ if safety.set_safety_hooks(structs.CarParams.SafetyModel.hondaNidec, word) != 0:
print('NATIVE_SETUP_ASSERTION', flush=True)
raise SystemExit(1)
safety.init_tests()
safety.set_alternative_experience(int(sys.argv[4]))
if safety.set_safety_hooks(structs.CarParams.SafetyModel.hondaNidec, word) != 0:
print('NATIVE_SETUP_ASSERTION', flush=True)
raise SystemExit(1)
packer = CANPacker('acura_ilx_2016_can_generated' if word in (4, 36) else 'honda_civic_touring_2016_can_generated')
message = packer.make_can_msg('POWERTRAIN_DATA', 0, {'ACC_STATUS': 0}) if word in (0, 4) else create_command(packer, 0.0, 0)
packet = libsafety_py.make_CANPacket(message[0], message[2], message[1])
@@ -93,7 +97,7 @@ raise SystemExit(0 if accepted else 1)
for word in words:
with self.subTest(word=word):
try:
result = subprocess.run([sys.executable, '-c', script, libsafety_py.libpath, str(mutant), str(word)],
result = subprocess.run([sys.executable, '-c', script, libsafety_py.libpath, str(mutant), str(word), str(experience)],
cwd=Path(__file__).resolve().parents[3], capture_output=True, text=True, timeout=10)
except subprocess.TimeoutExpired as exc:
output = exc.stdout or b''
@@ -116,6 +120,9 @@ raise SystemExit(0 if accepted else 1)
def test_all_stock_honda_rx_callbacks_finish_without_native_memory_faults(self):
self._assert_callbacks_finish((0, 4))
def test_stock_aol_rx_callbacks_finish_without_native_memory_faults(self):
self._assert_callbacks_finish((0, 4), experience=32)
def test_both_tracks_enable_reserved_bits_and_crc_are_required(self):
for word in (32, 36):
self.engage(word)
@@ -9,7 +9,7 @@ class TestHondaRdxGasCap(unittest.TestCase):
def test_exact_rdx_words_2200_other_words_2000(self):
safety = libsafety_py.libsafety
debug = safety.set_safety_hooks(structs.CarParams.SafetyModel.allOutput, 0) == 0
for word in (3, 35, 131, 163):
for word in (3, 35, 131, 163, 2082, 2083, 2210, 2211):
with self.subTest(word=word):
safety.init_tests()
safety.set_alternative_experience(0)
@@ -31,7 +31,7 @@ class TestHondaRdxGasCap(unittest.TestCase):
safety.set_aol_test_heartbeat(True)
safety.aol_set_host_request(2)
self.assertEqual(bool(safety.aol_get_permission_mask() & 2), debug)
maximum = 2200 if word in (131, 163) else 2000
maximum = 2200 if word in (131, 163, 2211) else 2000
for gas in (2000, 2001, 2200, 2201):
frame = packer.make_can_msg_safety("ACC_CONTROL", 1,
{"GAS_COMMAND": gas, "ACCEL_COMMAND": 0, "BRAKE_REQUEST": 0})
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "9b542a5eaf10d5a0a5bb94304cd3334a63ad1fcc39e225f6014be4b69c8660eb", "schema_version": 1}
{"protected_inventory_sha256": "28a6328e255b908c189c30dbdce6e3b61366d977faef49e81f03152a456a4889", "schema_version": 1}