diff --git a/opendbc_repo/opendbc/car/gm/tests/test_sierra_cc_layout.py b/opendbc_repo/opendbc/car/gm/tests/test_sierra_cc_layout.py index 8b0b2c62e4..9369b91ee8 100644 --- a/opendbc_repo/opendbc/car/gm/tests/test_sierra_cc_layout.py +++ b/opendbc_repo/opendbc/car/gm/tests/test_sierra_cc_layout.py @@ -6,7 +6,8 @@ from opendbc.can import CANPacker from opendbc.car import Bus, gen_empty_fingerprint, structs from opendbc.car.gm.interface import CarInterface from opendbc.car.gm.aol import qualified_gm -from opendbc.car.gm.values import CAR, DBC, GMFlags, SILVERADO_CC_STOCK_SOURCES, is_ordinary_cc_profile +from opendbc.car.gm.values import (CAR, DBC, GMFlags, GMSafetyFlags, SILVERADO_CC_STOCK_SOURCES, + is_ordinary_cc_profile, is_silverado_cc_stock_profile) from opendbc.car.gm.startup_preferences import prepare_disable_longitudinal from opendbc.car.gm.tests.test_bolt_cc import native from opendbc.car.gm.tests.test_cc_gateway_stock import silverado_stock_params @@ -37,13 +38,16 @@ def params(*, alpha=False, release=False, disabled=False): def test_sierra_layout_finalizes_existing_cc_owner_and_preserves_stock_variant(release, alpha, disabled): cp = params(alpha=alpha, release=release, disabled=disabled) assert not cp.dashcamOnly and not cp.passive - assert cp.openpilotLongitudinalControl == (not disabled) and not cp.pcmCruise + assert cp.openpilotLongitudinalControl == (not disabled) and cp.pcmCruise == disabled assert cp.safetyConfigs[0].safetyModel == structs.CarParams.SafetyModel.gm - assert cp.safetyConfigs[0].safetyParam == 0xC160 and cp.networkLocation == structs.CarParams.NetworkLocation.gateway - assert cp.flags == int(GMFlags.CC_LONG | GMFlags.HAS_BSM) - assert is_ordinary_cc_profile(cp) and qualified_gm(cp) + assert cp.safetyConfigs[0].safetyParam == (GMSafetyFlags.NO_ACC if disabled else 0xC160) + assert cp.networkLocation == structs.CarParams.NetworkLocation.gateway + assert cp.flags == int(GMFlags.HAS_BSM | (0 if disabled else GMFlags.CC_LONG)) + assert (is_silverado_cc_stock_profile if disabled else is_ordinary_cc_profile)(cp) and qualified_gm(cp) assert cp.minSteerSpeed == pytest.approx(7 * .44704) - assert cp.minEnableSpeed == pytest.approx(24 * .44704) + assert cp.minEnableSpeed == pytest.approx(-1. if disabled else 24 * .44704) + if disabled: + assert not cp.autoResumeSng old = silverado_stock_params() assert old.safetyConfigs[0].safetyParam == 16 and old.pcmCruise and not old.openpilotLongitudinalControl assert not old.dashcamOnly and not is_ordinary_cc_profile(old) diff --git a/prebuilt.json b/prebuilt.json index 5243e4b87f..603c7d4a26 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "80eb3bcfecfa88504d3dfcea06687041c1aeb6d24738aca2e8f4b3f28c47116c", "schema_version": 1} +{"protected_inventory_sha256": "ffec8e3e97eb5eecaa872cda7425a14d435282e6a1623a47addec0ac845c8371", "schema_version": 1}