diff --git a/openpilot/starpilot/aol/tests/test_honda_recovery_lifecycle.py b/openpilot/starpilot/aol/tests/test_honda_recovery_lifecycle.py index 80e9410592..be4d8ab44f 100644 --- a/openpilot/starpilot/aol/tests/test_honda_recovery_lifecycle.py +++ b/openpilot/starpilot/aol/tests/test_honda_recovery_lifecycle.py @@ -373,9 +373,9 @@ class TestHondaCurrentCaller(unittest.TestCase): if not previous.latActive: self.assertEqual((tx['torque'], tx['request']), (0, False), row) else: - if (alpha and address == 0x1DF or pedal and address == 0x200) and tick == 50: + if (alpha and address in (0x1DF, 0x1C8) or pedal and address == 0x200) and tick == 50: # Card applies the prior Controls envelope. Physical brake has - # already revoked LONG; the native hook must reject this one + # already revoked LONG; the native hook must reject this # in-flight positive command before the new envelope arrives. self.assertFalse(accepted, row) self.assertTrue(previous.longActive, row) @@ -387,6 +387,8 @@ class TestHondaCurrentCaller(unittest.TestCase): accel = (data[3] << 3) | (data[4] >> 5) accel = accel - 0x800 if accel & 0x400 else accel self.assertEqual((gas, accel), (-30000, 0), row) + if alpha and address == 0x1C8 and tick >= 52 and not reengage: + self.assertEqual(int.from_bytes(data[:2], 'big') >> 4, 0, row) row['TX'].append(tx) row['events'] = [str(e.name) for e in driven['onroadEvents'].onroadEvents] row['fault_reason'] = str(driven['aolAxisState'].aolAxisState.faultReason) diff --git a/openpilot/starpilot/galaxy/tests/test_laboratory_http.py b/openpilot/starpilot/galaxy/tests/test_laboratory_http.py index 0cfa143d44..c7def9fa88 100644 --- a/openpilot/starpilot/galaxy/tests/test_laboratory_http.py +++ b/openpilot/starpilot/galaxy/tests/test_laboratory_http.py @@ -6,6 +6,7 @@ from pathlib import Path import tempfile import threading import unittest +from unittest.mock import patch from openpilot.starpilot.galaxy.access import GalaxyAccessOwner from openpilot.starpilot.galaxy.remote import RemotePairing @@ -16,6 +17,9 @@ from openpilot.starpilot.models.manager import ModelManager, atomic_json class LaboratoryHttpTest(unittest.TestCase): def setUp(self): + unsupported = patch('openpilot.starpilot.models.laboratory.RUNTIME_QUALIFIED', False) + unsupported.start() + self.addCleanup(unsupported.stop) temporary = tempfile.TemporaryDirectory() self.addCleanup(temporary.cleanup) root = Path(temporary.name) @@ -70,11 +74,13 @@ class LaboratoryHttpTest(unittest.TestCase): for remote in (False, True): cookie = self.remote_cookie if remote else self.local_cookie status, view, _ = self.request('/api/models/laboratory', remote=remote, cookie=cookie) - self.assertEqual(status, 200) + self.assertEqual(status, 200, view) self.assertEqual({r['value'] for r in view['models']}, {r['id'] for r in self.manifest['models']}) self.assertFalse(view['runtimeSupported']) self.assertFalse(view['runtime']['active']) - self.assertTrue(any(r['modelLabStatus'] == 'unsupported' and not r['small'] for r in view['models'])) + big = [row for row in view['models'] if not row['small']] + self.assertTrue(big) + self.assertTrue(all(row['modelLabEligible'] and row['modelLabChestnut'] for row in big)) views.append(view) payload = {'enabled': True, 'lateralModel': 'gwm8223', 'longitudinalModel': 'sc23'} self.assertNotEqual(self.request('/api/models/laboratory', payload=payload, remote=remote, cookie=cookie)[0], 200) @@ -82,3 +88,11 @@ class LaboratoryHttpTest(unittest.TestCase): self.assertNotEqual(self.request('/api/models/laboratory', payload=payload, remote=remote, cookie=cookie, origin='https://untrusted.invalid')[0], 200) self.assertEqual(views[0], views[1]) + + def test_runtime_capability_is_separate_from_connected_gpu_and_activation(self): + with patch('openpilot.starpilot.models.laboratory.RUNTIME_QUALIFIED', True): + status, view, _ = self.request('/api/models/laboratory', cookie=self.local_cookie) + self.assertEqual(status, 200, view) + self.assertTrue(view['runtimeSupported']) + self.assertFalse(view['chestnutReady']) + self.assertFalse(view['runtime']['active']) diff --git a/openpilot/starpilot/models/tests/test_loader_cpu_affinity.py b/openpilot/starpilot/models/tests/test_loader_cpu_affinity.py index 55bba6c7ea..5692f20e1e 100644 --- a/openpilot/starpilot/models/tests/test_loader_cpu_affinity.py +++ b/openpilot/starpilot/models/tests/test_loader_cpu_affinity.py @@ -25,7 +25,7 @@ def loader(source, *, demo=False, bundled=False, failure=None): return run model = SimpleNamespace(warmup=record('warmup')) - namespace = {'demo': demo, 'CP': object(), 'BIG_MODEL_TIMEOUT': 120, 'wait_for_chestnut': record('usb'), + namespace = {'laboratory_request': None, 'demo': demo, 'CP': object(), 'BIG_MODEL_TIMEOUT': 120, 'wait_for_chestnut': record('usb'), 'wait_for_chestnut_power': record('power'), 'set_core_affinity': record('affinity'), 'selection': SimpleNamespace(big_path=None if bundled else Path('/verified.pkl'), big_version='v16', big_id='mountaindewv3', big_sha256='a' * 64), diff --git a/prebuilt.json b/prebuilt.json index 0e2a5616b2..d8742d14dc 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "b5c4808e99cbe09936d17a902d08c523dbc7acd8df9cb5de226b4207d095f661", "schema_version": 1} +{"protected_inventory_sha256": "388ca644c98b0c10d27bf009a39b15a2fd7581a42c82ef5e05cce72fde3c5a83", "schema_version": 1}