From 482033518cf0d797df5a1db1651736cfd9d8d302 Mon Sep 17 00:00:00 2001 From: Dom <168790843+firestar5683@users.noreply.github.com> Date: Mon, 16 Nov 2026 23:13:15 -0600 Subject: [PATCH] Align vehicle fixtures and avoid reserved unittest loader name Test an unsupported two-count Polestar replica lag while preserving RX/TX rejection. Match current GM stock-owner flags without removing any parser-validity assertion. Rename the imported laboratory fixture so unittest does not invoke a module as load_tests. 125 combined focused checks pass;7 unittest checks independently pass; Ruff passes. Production and native artifacts unchanged; canonical inventory refreshed. --- .../opendbc/car/gm/tests/test_gm_auto_identity.py | 11 +++++++---- .../opendbc/car/volvo/tests/test_cma_integrity.py | 3 ++- .../models/tests/test_laboratory_coherent.py | 6 +++--- prebuilt.json | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/opendbc_repo/opendbc/car/gm/tests/test_gm_auto_identity.py b/opendbc_repo/opendbc/car/gm/tests/test_gm_auto_identity.py index 69bf082c67..69bdf0f0ab 100644 --- a/opendbc_repo/opendbc/car/gm/tests/test_gm_auto_identity.py +++ b/opendbc_repo/opendbc/car/gm/tests/test_gm_auto_identity.py @@ -62,7 +62,8 @@ class TestGMAutoIdentity(unittest.TestCase): from opendbc.car.gm.fingerprints import FINGERPRINTS from opendbc.car.gm.interface import CarInterface from opendbc.car.gm.values import (CAR, DBC, GMFlags, ORDINARY_CC_WORD, MALIBU_CC_F1_WORD, - MALIBU_CC_F1_STOCK_WORD, is_ordinary_cc_profile, control_flags) + MALIBU_CC_F1_STOCK_WORD, GMSafetyFlags, is_ordinary_cc_profile, + is_ordinary_cc_stock_profile, control_flags) from opendbc.car import structs from openpilot.starpilot.vehicle_preferences import VehicleStartupPreferences from opendbc.car.gm.tests.test_cc_gateway_stock import pt_frames @@ -93,10 +94,12 @@ class TestGMAutoIdentity(unittest.TestCase): preferences = VehicleStartupPreferences(disable_bolt_long=True) preferences.prepare(disabled, fingerprints=fp) preferences.finalize(disabled) - self.assertTrue(is_ordinary_cc_profile(disabled), identity) + self.assertTrue((is_ordinary_cc_profile if f1 else is_ordinary_cc_stock_profile)(disabled), identity) self.assertFalse(disabled.openpilotLongitudinalControl) - self.assertEqual(disabled.pcmCruise, f1) - self.assertEqual(disabled.safetyConfigs[0].safetyParam, MALIBU_CC_F1_STOCK_WORD if f1 else expected_word) + self.assertTrue(disabled.pcmCruise) + self.assertFalse(disabled.autoResumeSng) + self.assertEqual(control_flags(disabled), expected_flags if f1 else 0) + self.assertEqual(disabled.safetyConfigs[0].safetyParam, MALIBU_CC_F1_STOCK_WORD if f1 else GMSafetyFlags.NO_ACC) ci = CarInterface(cp) packer = CANPacker(DBC[car][Bus.pt]) for tick in range(40): diff --git a/opendbc_repo/opendbc/car/volvo/tests/test_cma_integrity.py b/opendbc_repo/opendbc/car/volvo/tests/test_cma_integrity.py index f193dca175..4e3b162b65 100644 --- a/opendbc_repo/opendbc/car/volvo/tests/test_cma_integrity.py +++ b/opendbc_repo/opendbc/car/volvo/tests/test_cma_integrity.py @@ -51,7 +51,8 @@ def test_recomputed_crc_cannot_validate_unknown_pscm_counter_domain(identity, ki address, data, bus = next(msg for msg in incoming if msg[0] == 0x17) changed = bytearray(data) if kind == 'unreplicated': - changed[1] ^= 0x10 + # A one-count replica lag is supported on Polestar; two counts is not. + changed[1] ^= 0x20 elif kind == 'reserved_counter': changed[1] = 0xF0 changed[2] = 0x8F diff --git a/openpilot/starpilot/models/tests/test_laboratory_coherent.py b/openpilot/starpilot/models/tests/test_laboratory_coherent.py index 63d7cc2577..4e791fb859 100644 --- a/openpilot/starpilot/models/tests/test_laboratory_coherent.py +++ b/openpilot/starpilot/models/tests/test_laboratory_coherent.py @@ -9,7 +9,7 @@ from tinygrad import Tensor from openpilot.starpilot.models import laboratory, laboratory_runner from openpilot.starpilot.models.runner import CatalogModelState, SUPPORTED_VERSIONS -from openpilot.starpilot.models.tests import test_laboratory_runner as load_tests +from openpilot.starpilot.models.tests import test_laboratory_runner as load_fixture class TestCoherentOutput(unittest.TestCase): @@ -76,8 +76,8 @@ class TestCoherentOutput(unittest.TestCase): class TestCoherentFactory(unittest.TestCase): - setUp = load_tests.TestLaboratoryLoad.setUp - factory = load_tests.TestLaboratoryLoad.factory + setUp = load_fixture.TestLaboratoryLoad.setUp + factory = load_fixture.TestLaboratoryLoad.factory def test_all_supported_versions_apply_after_verification_before_warmup(self): original = laboratory.freeze_request(self.root) diff --git a/prebuilt.json b/prebuilt.json index 1062a19e26..6c31c119a9 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "e33ff02a03fc31130454d06e42da660a1a0b38ecf6565330b83f0725e53a4f7e", "schema_version": 1} +{"protected_inventory_sha256": "e4de8d02977a73dfa45fca44505a69260a8a68073be23c1a90e919f2276588f6", "schema_version": 1}