Toyota: check FW valid (#31898)

* basic check

* basic check

* fix
pull/31897/head
Shane Smiskol 1 year ago committed by GitHub
parent 93c06eaf43
commit 9d5c70fbc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      selfdrive/car/toyota/tests/test_toyota.py

@ -13,6 +13,10 @@ Ecu = car.CarParams.Ecu
ECU_NAME = {v: k for k, v in Ecu.schema.enumerants.items()}
def check_fw_version(fw_version: bytes) -> bool:
return b'?' not in fw_version
class TestToyotaInterfaces(unittest.TestCase):
def test_car_sets(self):
self.assertTrue(len(ANGLE_CONTROL_CAR - TSS2_CAR) == 0)
@ -59,6 +63,14 @@ class TestToyotaFingerprint(unittest.TestCase):
car_model in FW_QUERY_CONFIG.non_essential_ecus[Ecu.engine],
f"Car model unexpectedly {'not ' if len(engine_ecus) > 1 else ''}in non-essential list")
def test_valid_fw_versions(self):
# Asserts all FW versions are valid
for car_model, ecus in FW_VERSIONS.items():
with self.subTest(car_model=car_model.value):
for fws in ecus.values():
for fw in fws:
self.assertTrue(check_fw_version(fw), fw)
# Tests for part numbers, platform codes, and sub-versions which Toyota will use to fuzzy
# fingerprint in the absence of full FW matches:
@settings(max_examples=100)

Loading…
Cancel
Save