FPv2 tests: consider extra ECUs in brand ECUs (#26149)

* Hyundai: add corner radar FW query

* add extra ecus to brand ecus

* add comment

* rev

* bumpo

* cmt

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
pull/26151/head
Shane Smiskol 3 years ago committed by GitHub
parent 1548db8962
commit 1bd9632156
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      selfdrive/car/tests/test_fw_fingerprint.py

@ -45,6 +45,7 @@ class TestFwFingerprint(unittest.TestCase):
self.assertFalse(len(duplicates), f"{car_model}: Duplicate FW versions: Ecu.{ECU_NAME[ecu[0]]}, {duplicates}")
def test_data_collection_ecus(self):
# Asserts no extra ECUs are in the fingerprinting database
for brand, config in FW_QUERY_CONFIGS.items():
for car_model, ecus in VERSIONS[brand].items():
bad_ecus = set(ecus).intersection(config.extra_ecus)
@ -80,10 +81,11 @@ class TestFwFingerprint(unittest.TestCase):
def test_fw_request_ecu_whitelist(self):
for brand, config in FW_QUERY_CONFIGS.items():
with self.subTest(brand=brand):
whitelisted_ecus = set([ecu for r in config.requests for ecu in r.whitelist_ecus])
brand_ecus = set([fw[0] for car_fw in VERSIONS[brand].values() for fw in car_fw])
whitelisted_ecus = {ecu for r in config.requests for ecu in r.whitelist_ecus}
brand_ecus = {fw[0] for car_fw in VERSIONS[brand].values() for fw in car_fw}
brand_ecus |= {ecu[0] for ecu in config.extra_ecus}
# each ecu in brand's fw versions needs to be whitelisted at least once
# each ecu in brand's fw versions + extra ecus needs to be whitelisted at least once
ecus_not_whitelisted = brand_ecus - whitelisted_ecus
ecu_strings = ", ".join([f'Ecu.{ECU_NAME[ecu]}' for ecu in ecus_not_whitelisted])

Loading…
Cancel
Save