diff --git a/pyproject.toml b/pyproject.toml index 544f9ee18c..2578d0a853 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,6 @@ markers = [ ] testpaths = [ "common", - "selfdrive/athena", "selfdrive/boardd", "selfdrive/car", "selfdrive/controls", @@ -31,6 +30,7 @@ testpaths = [ "selfdrive/test/longitudinal_maneuvers", "selfdrive/test/process_replay/test_fuzzy.py", "selfdrive/updated", + "system/athena", "system/camerad", "system/hardware/tici", "system/loggerd", diff --git a/release/files_common b/release/files_common index 34d8f00973..7dfccceb82 100644 --- a/release/files_common +++ b/release/files_common @@ -65,10 +65,10 @@ system/version.py selfdrive/SConscript -selfdrive/athena/__init__.py -selfdrive/athena/athenad.py -selfdrive/athena/manage_athenad.py -selfdrive/athena/registration.py +system/athena/__init__.py +system/athena/athenad.py +system/athena/manage_athenad.py +system/athena/registration.py selfdrive/boardd/.gitignore selfdrive/boardd/SConscript diff --git a/selfdrive/manager/manager.py b/selfdrive/manager/manager.py index 512320a8db..33c9ce9f5b 100755 --- a/selfdrive/manager/manager.py +++ b/selfdrive/manager/manager.py @@ -14,7 +14,7 @@ from openpilot.system.hardware import HARDWARE, PC from openpilot.selfdrive.manager.helpers import unblock_stdout, write_onroad_params, save_bootlog from openpilot.selfdrive.manager.process import ensure_running from openpilot.selfdrive.manager.process_config import managed_processes -from openpilot.selfdrive.athena.registration import register, UNREGISTERED_DONGLE_ID +from openpilot.system.athena.registration import register, UNREGISTERED_DONGLE_ID from openpilot.common.swaglog import cloudlog, add_file_handler from openpilot.system.version import get_build_metadata, terms_version, training_version diff --git a/selfdrive/manager/process_config.py b/selfdrive/manager/process_config.py index 4c34e7339e..5a501c2160 100644 --- a/selfdrive/manager/process_config.py +++ b/selfdrive/manager/process_config.py @@ -42,7 +42,7 @@ def only_offroad(started, params, CP: car.CarParams) -> bool: return not started procs = [ - DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"), + DaemonProcess("manage_athenad", "system.athena.manage_athenad", "AthenadPid"), NativeProcess("camerad", "system/camerad", ["./camerad"], driverview), NativeProcess("logcatd", "system/logcatd", ["./logcatd"], only_onroad), diff --git a/selfdrive/sentry.py b/selfdrive/sentry.py index 204d9cab09..5f4772fa71 100644 --- a/selfdrive/sentry.py +++ b/selfdrive/sentry.py @@ -4,7 +4,7 @@ from enum import Enum from sentry_sdk.integrations.threading import ThreadingIntegration from openpilot.common.params import Params -from openpilot.selfdrive.athena.registration import is_registered_device +from openpilot.system.athena.registration import is_registered_device from openpilot.system.hardware import HARDWARE, PC from openpilot.common.swaglog import cloudlog from openpilot.system.version import get_build_metadata, get_version diff --git a/selfdrive/athena/__init__.py b/system/athena/__init__.py similarity index 100% rename from selfdrive/athena/__init__.py rename to system/athena/__init__.py diff --git a/selfdrive/athena/athenad.py b/system/athena/athenad.py similarity index 100% rename from selfdrive/athena/athenad.py rename to system/athena/athenad.py diff --git a/selfdrive/athena/manage_athenad.py b/system/athena/manage_athenad.py similarity index 92% rename from selfdrive/athena/manage_athenad.py rename to system/athena/manage_athenad.py index 2ec92cc3e0..853a7cd953 100755 --- a/selfdrive/athena/manage_athenad.py +++ b/system/athena/manage_athenad.py @@ -28,7 +28,7 @@ def main(): try: while 1: cloudlog.info("starting athena daemon") - proc = Process(name='athenad', target=launcher, args=('selfdrive.athena.athenad', 'athenad')) + proc = Process(name='athenad', target=launcher, args=('system.athena.athenad', 'athenad')) proc.start() proc.join() cloudlog.event("athenad exited", exitcode=proc.exitcode) diff --git a/selfdrive/athena/registration.py b/system/athena/registration.py similarity index 100% rename from selfdrive/athena/registration.py rename to system/athena/registration.py diff --git a/selfdrive/athena/tests/__init__.py b/system/athena/tests/__init__.py similarity index 100% rename from selfdrive/athena/tests/__init__.py rename to system/athena/tests/__init__.py diff --git a/selfdrive/athena/tests/helpers.py b/system/athena/tests/helpers.py similarity index 100% rename from selfdrive/athena/tests/helpers.py rename to system/athena/tests/helpers.py diff --git a/selfdrive/athena/tests/test_athenad.py b/system/athena/tests/test_athenad.py similarity index 97% rename from selfdrive/athena/tests/test_athenad.py rename to system/athena/tests/test_athenad.py index bdce3dccef..895cd8eb56 100755 --- a/selfdrive/athena/tests/test_athenad.py +++ b/system/athena/tests/test_athenad.py @@ -19,9 +19,9 @@ from cereal import messaging from openpilot.common.params import Params from openpilot.common.timeout import Timeout -from openpilot.selfdrive.athena import athenad -from openpilot.selfdrive.athena.athenad import MAX_RETRY_COUNT, dispatcher -from openpilot.selfdrive.athena.tests.helpers import HTTPRequestHandler, MockWebsocket, MockApi, EchoSocket +from openpilot.system.athena import athenad +from openpilot.system.athena.athenad import MAX_RETRY_COUNT, dispatcher +from openpilot.system.athena.tests.helpers import HTTPRequestHandler, MockWebsocket, MockApi, EchoSocket from openpilot.selfdrive.test.helpers import http_server_context from openpilot.system.hardware.hw import Paths @@ -50,7 +50,7 @@ def with_upload_handler(func): @pytest.fixture def mock_create_connection(mocker): - return mocker.patch('openpilot.selfdrive.athena.athenad.create_connection') + return mocker.patch('openpilot.system.athena.athenad.create_connection') @pytest.fixture def host(): diff --git a/selfdrive/athena/tests/test_athenad_ping.py b/system/athena/tests/test_athenad_ping.py similarity index 95% rename from selfdrive/athena/tests/test_athenad_ping.py rename to system/athena/tests/test_athenad_ping.py index 44fa0b8481..3152ca4271 100755 --- a/selfdrive/athena/tests/test_athenad_ping.py +++ b/system/athena/tests/test_athenad_ping.py @@ -7,7 +7,7 @@ from typing import cast from openpilot.common.params import Params from openpilot.common.timeout import Timeout -from openpilot.selfdrive.athena import athenad +from openpilot.system.athena import athenad from openpilot.selfdrive.manager.helpers import write_onroad_params from openpilot.system.hardware import TICI @@ -59,7 +59,7 @@ class TestAthenadPing: def assertTimeout(self, reconnect_time: float, subtests, mocker) -> None: self.athenad.start() - mock_create_connection = mocker.patch('openpilot.selfdrive.athena.athenad.create_connection', + mock_create_connection = mocker.patch('openpilot.system.athena.athenad.create_connection', new_callable=lambda: mocker.MagicMock(wraps=athenad.create_connection)) time.sleep(1) diff --git a/selfdrive/athena/tests/test_registration.py b/system/athena/tests/test_registration.py similarity index 80% rename from selfdrive/athena/tests/test_registration.py rename to system/athena/tests/test_registration.py index a808dd5668..85c065c1bf 100755 --- a/selfdrive/athena/tests/test_registration.py +++ b/system/athena/tests/test_registration.py @@ -4,8 +4,8 @@ from Crypto.PublicKey import RSA from pathlib import Path from openpilot.common.params import Params -from openpilot.selfdrive.athena.registration import register, UNREGISTERED_DONGLE_ID -from openpilot.selfdrive.athena.tests.helpers import MockResponse +from openpilot.system.athena.registration import register, UNREGISTERED_DONGLE_ID +from openpilot.system.athena.tests.helpers import MockResponse from openpilot.system.hardware.hw import Paths @@ -36,7 +36,7 @@ class TestRegistration: self.params.put("HardwareSerial", "serial") self._generate_keys() - m = mocker.patch("openpilot.selfdrive.athena.registration.api_get", autospec=True) + m = mocker.patch("openpilot.system.athena.registration.api_get", autospec=True) dongle = "DONGLE_ID_123" self.params.put("DongleId", dongle) assert register() == dongle @@ -44,7 +44,7 @@ class TestRegistration: def test_no_keys(self, mocker): # missing pubkey - m = mocker.patch("openpilot.selfdrive.athena.registration.api_get", autospec=True) + m = mocker.patch("openpilot.system.athena.registration.api_get", autospec=True) dongle = register() assert m.call_count == 0 assert dongle == UNREGISTERED_DONGLE_ID @@ -53,7 +53,7 @@ class TestRegistration: def test_missing_cache(self, mocker): # keys exist but no dongle id self._generate_keys() - m = mocker.patch("openpilot.selfdrive.athena.registration.api_get", autospec=True) + m = mocker.patch("openpilot.system.athena.registration.api_get", autospec=True) dongle = "DONGLE_ID_123" m.return_value = MockResponse(json.dumps({'dongle_id': dongle}), 200) assert register() == dongle @@ -67,7 +67,7 @@ class TestRegistration: def test_unregistered(self, mocker): # keys exist, but unregistered self._generate_keys() - m = mocker.patch("openpilot.selfdrive.athena.registration.api_get", autospec=True) + m = mocker.patch("openpilot.system.athena.registration.api_get", autospec=True) m.return_value = MockResponse(None, 402) dongle = register() assert m.call_count == 1