athena: move to system/ (#32488)

* athena: move to system/

* slash
This commit is contained in:
Adeeb Shihadeh
2024-05-20 14:59:43 -07:00
committed by GitHub
parent f3f22a5698
commit 3279dbeff7
14 changed files with 21 additions and 21 deletions

View File

@@ -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",

View File

@@ -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

View File

@@ -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

View File

@@ -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),

View File

@@ -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

View File

@@ -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)

View File

@@ -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():

View File

@@ -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)

View File

@@ -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