mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 03:03:41 +08:00
Exercise PQ native callers in instrumented safety coverage
This commit is contained in:
@@ -251,3 +251,41 @@ def test_brake_held_standstill_set_waits_for_release_and_new_brake_withdraws_lon
|
||||
assert n.feed(speed=0) == 2
|
||||
assert n.feed(speed=0, brake=True) == 0
|
||||
assert n.feed(speed=0) == 0
|
||||
|
||||
|
||||
def test_zero_host_request_releases_both_accepted_forwarding_leases():
|
||||
n = Native()
|
||||
assert n.prime() == 1
|
||||
assert n.s.safety_tx_hook(n.steer())
|
||||
assert n.s.safety_tx_hook(n.msg('LDW_Status'))
|
||||
assert n.s.safety_fwd_hook(2, 0xD2) == -1
|
||||
assert n.s.safety_fwd_hook(2, 0x5BE) == -1
|
||||
n.s.aol_set_host_request(0)
|
||||
assert n.s.aol_get_permission_mask() == 0
|
||||
assert n.s.safety_fwd_hook(2, 0xD2) == 0
|
||||
assert n.s.safety_fwd_hook(2, 0x5BE) == 0
|
||||
assert not n.s.safety_tx_hook(n.steer())
|
||||
|
||||
|
||||
def test_permanent_eps_fault_needs_fresh_stock_cruise_edge():
|
||||
n = Native()
|
||||
assert n.prime() == 1
|
||||
assert n.feed(eps=2) == 0
|
||||
assert n.feed() == 0
|
||||
assert n.feed(cruise=True) == 1
|
||||
assert not n.s.safety_tx_hook(n.msg('ACC_System', {'ACS_Sollbeschl': 0.5}))
|
||||
|
||||
|
||||
def test_neutral_main_without_heartbeat_expires_without_latent_grant():
|
||||
n = Native()
|
||||
n.s.set_aol_test_heartbeat(False)
|
||||
assert n.prime() == 0
|
||||
assert n.feed(main=False) == 0
|
||||
for _ in range(31):
|
||||
assert n.feed() == 0
|
||||
assert not n.s.safety_tx_hook(n.steer())
|
||||
n.s.set_aol_test_heartbeat(True)
|
||||
assert n.feed() == 0
|
||||
assert not n.s.safety_tx_hook(n.steer())
|
||||
assert n.feed(main=False) == 0
|
||||
assert n.feed() == 1
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "eeab4a5014c1099cb9bc29dd38816409503c6d37125ca179c5f5ae811f8ac4d8", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "22d9ebd9b5c80f58f463761df0a07d8b087ee96879b8fc2e6d9e20a5bd675325", "schema_version": 1}
|
||||
|
||||
@@ -32,7 +32,8 @@ def targets_for_coverage(root=ROOT):
|
||||
# These existing end-to-end callers bind the supplied library. Other vehicle suites
|
||||
# deliberately compile distinct DEBUG/RELEASE artifacts and retain their own gates.
|
||||
for relative in ('openpilot/starpilot/car/nissan/tests/test_aol.py',
|
||||
'openpilot/starpilot/car/rivian/tests/test_aol_native.py'):
|
||||
'openpilot/starpilot/car/rivian/tests/test_aol_native.py',
|
||||
'openpilot/starpilot/aol/tests/test_pq_aol.py'):
|
||||
if (root / relative).is_file():
|
||||
selected.add(relative)
|
||||
return sorted(selected - RELEASE_ONLY)
|
||||
|
||||
@@ -97,7 +97,8 @@ class TestSafetyQualificationRunner(TestCase):
|
||||
selected = coverage.targets_for_coverage(qualification.ROOT)
|
||||
for name in ('opendbc_repo/opendbc/safety/tests/test_tesla_preap_pedal.py::test_actual_registered_priming_rate_absolute_bus_and_counter_bounds',
|
||||
'openpilot/starpilot/car/nissan/tests/test_aol.py',
|
||||
'openpilot/starpilot/car/rivian/tests/test_aol_native.py'):
|
||||
'openpilot/starpilot/car/rivian/tests/test_aol_native.py',
|
||||
'openpilot/starpilot/aol/tests/test_pq_aol.py'):
|
||||
self.assertIn(name, selected)
|
||||
import ast
|
||||
plan = ast.parse((qualification.ROOT / 'tools/ci/run_vehicle_tests.py').read_text())
|
||||
|
||||
Reference in New Issue
Block a user