mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-04 15:56:08 +08:00
test_models: no CAN invalid tolerance (#25501)
* don't use end of route segment * no can invalid cnt tolerance * start checking can valid immediately once available * we check counter violations
This commit is contained in:
@@ -83,7 +83,7 @@ routes = [
|
||||
TestRoute("4dbd55df87507948|2022-03-01--09-45-38", HYUNDAI.SANTA_FE),
|
||||
TestRoute("bf43d9df2b660eb0|2021-09-23--14-16-37", HYUNDAI.SANTA_FE_2022),
|
||||
TestRoute("37398f32561a23ad|2021-11-18--00-11-35", HYUNDAI.SANTA_FE_HEV_2022),
|
||||
TestRoute("656ac0d830792fcc|2021-12-28--14-45-56", HYUNDAI.SANTA_FE_PHEV_2022),
|
||||
TestRoute("656ac0d830792fcc|2021-12-28--14-45-56", HYUNDAI.SANTA_FE_PHEV_2022, segment=1),
|
||||
TestRoute("e0e98335f3ebc58f|2021-03-07--16-38-29", HYUNDAI.KIA_CEED),
|
||||
TestRoute("7653b2bce7bcfdaa|2020-03-04--15-34-32", HYUNDAI.KIA_OPTIMA),
|
||||
TestRoute("c75a59efa0ecd502|2021-03-11--20-52-55", HYUNDAI.KIA_SELTOS),
|
||||
|
||||
@@ -138,19 +138,23 @@ class TestCarModelBase(unittest.TestCase):
|
||||
raise Exception("unkown tuning")
|
||||
|
||||
def test_car_interface(self):
|
||||
# TODO: also check for checkusm and counter violations from can parser
|
||||
# TODO: also check for checksum violations from can parser
|
||||
can_invalid_cnt = 0
|
||||
can_valid = False
|
||||
CC = car.CarControl.new_message()
|
||||
|
||||
for i, msg in enumerate(self.can_msgs):
|
||||
CS = self.CI.update(CC, (msg.as_builder().to_bytes(),))
|
||||
self.CI.apply(CC)
|
||||
|
||||
# wait 2s for low frequency msgs to be seen
|
||||
if i > 200:
|
||||
if CS.canValid:
|
||||
can_valid = True
|
||||
|
||||
# wait max of 2s for low frequency msgs to be seen
|
||||
if i > 200 or can_valid:
|
||||
can_invalid_cnt += not CS.canValid
|
||||
|
||||
self.assertLess(can_invalid_cnt, 50)
|
||||
self.assertEqual(can_invalid_cnt, 0)
|
||||
|
||||
def test_radar_interface(self):
|
||||
os.environ['NO_RADAR_SLEEP'] = "1"
|
||||
|
||||
Reference in New Issue
Block a user