mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-04 01:13:40 +08:00
Cover Outback release safety configuration rejection
This commit is contained in:
@@ -34,3 +34,15 @@ class TestOutbackPreglobalStockAcc(unittest.TestCase):
|
||||
for _ in range(16):
|
||||
self.safety.safety_rx_hook(throttle)
|
||||
self.assertFalse(self.safety.get_controls_allowed())
|
||||
|
||||
|
||||
def test_release_rejects_unsupported_preglobal_parameters():
|
||||
safety = libsafety_py.ffi.dlopen(libsafety_py._build_libsafety(release=True))
|
||||
steering = libsafety_py.make_CANPacket(0x164, 0, bytes(8))
|
||||
stock_acc = SubaruSafetyFlags.PREGLOBAL_OUTBACK_STOCK_ACC
|
||||
for unsupported in (0, SubaruSafetyFlags.PREGLOBAL_REVERSED_DRIVER_TORQUE,
|
||||
stock_acc | SubaruSafetyFlags.PREGLOBAL_REVERSED_DRIVER_TORQUE):
|
||||
assert safety.set_safety_hooks(CarParams.SafetyModel.subaruPreglobal, stock_acc) == 0
|
||||
assert safety.safety_tx_hook(steering)
|
||||
assert safety.set_safety_hooks(CarParams.SafetyModel.subaruPreglobal, unsupported) != 0
|
||||
assert not safety.safety_tx_hook(steering)
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "26321174828233e3136aa75c881c6365761dc3f00d457fa44dcb24aaecc8ab05", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "6a1a46b71f891c5117d8b6c7965af2a539154a1a9d3e183c25419f5d7503d696", "schema_version": 1}
|
||||
|
||||
Reference in New Issue
Block a user