Honda: test all FW is in correct format (#27078)
* test honda FW is expected * fix staticpull/27081/head
parent
01fa0ca69d
commit
845a63d884
1 changed files with 20 additions and 0 deletions
@ -0,0 +1,20 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
import re |
||||||
|
import unittest |
||||||
|
|
||||||
|
from selfdrive.car.honda.values import FW_VERSIONS |
||||||
|
|
||||||
|
HONDA_FW_VERSION_RE = br"\d{5}-[A-Z0-9]{3}(-|,)[A-Z0-9]{4}(\x00){2}$" |
||||||
|
|
||||||
|
|
||||||
|
class TestHondaFingerprint(unittest.TestCase): |
||||||
|
def test_fw_version_format(self): |
||||||
|
# Asserts all FW versions follow an expected format |
||||||
|
for fw_by_ecu in FW_VERSIONS.values(): |
||||||
|
for fws in fw_by_ecu.values(): |
||||||
|
for fw in fws: |
||||||
|
self.assertTrue(re.match(HONDA_FW_VERSION_RE, fw) is not None, fw) |
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__": |
||||||
|
unittest.main() |
Loading…
Reference in new issue