athena: move to system/ (#32488)

* athena: move to system/

* slash
old-commit-hash: 3279dbeff7
pull/32103/head
Adeeb Shihadeh 11 months ago committed by GitHub
parent acd61af9fc
commit 18970afb0e
  1. 2
      pyproject.toml
  2. 8
      release/files_common
  3. 2
      selfdrive/manager/manager.py
  4. 2
      selfdrive/manager/process_config.py
  5. 2
      selfdrive/sentry.py
  6. 0
      system/athena/__init__.py
  7. 0
      system/athena/athenad.py
  8. 2
      system/athena/manage_athenad.py
  9. 0
      system/athena/registration.py
  10. 0
      system/athena/tests/__init__.py
  11. 0
      system/athena/tests/helpers.py
  12. 8
      system/athena/tests/test_athenad.py
  13. 4
      system/athena/tests/test_athenad_ping.py
  14. 12
      system/athena/tests/test_registration.py

@ -20,7 +20,6 @@ markers = [
] ]
testpaths = [ testpaths = [
"common", "common",
"selfdrive/athena",
"selfdrive/boardd", "selfdrive/boardd",
"selfdrive/car", "selfdrive/car",
"selfdrive/controls", "selfdrive/controls",
@ -31,6 +30,7 @@ testpaths = [
"selfdrive/test/longitudinal_maneuvers", "selfdrive/test/longitudinal_maneuvers",
"selfdrive/test/process_replay/test_fuzzy.py", "selfdrive/test/process_replay/test_fuzzy.py",
"selfdrive/updated", "selfdrive/updated",
"system/athena",
"system/camerad", "system/camerad",
"system/hardware/tici", "system/hardware/tici",
"system/loggerd", "system/loggerd",

@ -65,10 +65,10 @@ system/version.py
selfdrive/SConscript selfdrive/SConscript
selfdrive/athena/__init__.py system/athena/__init__.py
selfdrive/athena/athenad.py system/athena/athenad.py
selfdrive/athena/manage_athenad.py system/athena/manage_athenad.py
selfdrive/athena/registration.py system/athena/registration.py
selfdrive/boardd/.gitignore selfdrive/boardd/.gitignore
selfdrive/boardd/SConscript selfdrive/boardd/SConscript

@ -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.helpers import unblock_stdout, write_onroad_params, save_bootlog
from openpilot.selfdrive.manager.process import ensure_running from openpilot.selfdrive.manager.process import ensure_running
from openpilot.selfdrive.manager.process_config import managed_processes 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.common.swaglog import cloudlog, add_file_handler
from openpilot.system.version import get_build_metadata, terms_version, training_version from openpilot.system.version import get_build_metadata, terms_version, training_version

@ -42,7 +42,7 @@ def only_offroad(started, params, CP: car.CarParams) -> bool:
return not started return not started
procs = [ procs = [
DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"), DaemonProcess("manage_athenad", "system.athena.manage_athenad", "AthenadPid"),
NativeProcess("camerad", "system/camerad", ["./camerad"], driverview), NativeProcess("camerad", "system/camerad", ["./camerad"], driverview),
NativeProcess("logcatd", "system/logcatd", ["./logcatd"], only_onroad), NativeProcess("logcatd", "system/logcatd", ["./logcatd"], only_onroad),

@ -4,7 +4,7 @@ from enum import Enum
from sentry_sdk.integrations.threading import ThreadingIntegration from sentry_sdk.integrations.threading import ThreadingIntegration
from openpilot.common.params import Params 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.system.hardware import HARDWARE, PC
from openpilot.common.swaglog import cloudlog from openpilot.common.swaglog import cloudlog
from openpilot.system.version import get_build_metadata, get_version from openpilot.system.version import get_build_metadata, get_version

@ -28,7 +28,7 @@ def main():
try: try:
while 1: while 1:
cloudlog.info("starting athena daemon") 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.start()
proc.join() proc.join()
cloudlog.event("athenad exited", exitcode=proc.exitcode) cloudlog.event("athenad exited", exitcode=proc.exitcode)

@ -19,9 +19,9 @@ from cereal import messaging
from openpilot.common.params import Params from openpilot.common.params import Params
from openpilot.common.timeout import Timeout from openpilot.common.timeout import Timeout
from openpilot.selfdrive.athena import athenad from openpilot.system.athena import athenad
from openpilot.selfdrive.athena.athenad import MAX_RETRY_COUNT, dispatcher from openpilot.system.athena.athenad import MAX_RETRY_COUNT, dispatcher
from openpilot.selfdrive.athena.tests.helpers import HTTPRequestHandler, MockWebsocket, MockApi, EchoSocket from openpilot.system.athena.tests.helpers import HTTPRequestHandler, MockWebsocket, MockApi, EchoSocket
from openpilot.selfdrive.test.helpers import http_server_context from openpilot.selfdrive.test.helpers import http_server_context
from openpilot.system.hardware.hw import Paths from openpilot.system.hardware.hw import Paths
@ -50,7 +50,7 @@ def with_upload_handler(func):
@pytest.fixture @pytest.fixture
def mock_create_connection(mocker): 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 @pytest.fixture
def host(): def host():

@ -7,7 +7,7 @@ from typing import cast
from openpilot.common.params import Params from openpilot.common.params import Params
from openpilot.common.timeout import Timeout 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.selfdrive.manager.helpers import write_onroad_params
from openpilot.system.hardware import TICI from openpilot.system.hardware import TICI
@ -59,7 +59,7 @@ class TestAthenadPing:
def assertTimeout(self, reconnect_time: float, subtests, mocker) -> None: def assertTimeout(self, reconnect_time: float, subtests, mocker) -> None:
self.athenad.start() 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)) new_callable=lambda: mocker.MagicMock(wraps=athenad.create_connection))
time.sleep(1) time.sleep(1)

@ -4,8 +4,8 @@ from Crypto.PublicKey import RSA
from pathlib import Path from pathlib import Path
from openpilot.common.params import Params from openpilot.common.params import Params
from openpilot.selfdrive.athena.registration import register, UNREGISTERED_DONGLE_ID from openpilot.system.athena.registration import register, UNREGISTERED_DONGLE_ID
from openpilot.selfdrive.athena.tests.helpers import MockResponse from openpilot.system.athena.tests.helpers import MockResponse
from openpilot.system.hardware.hw import Paths from openpilot.system.hardware.hw import Paths
@ -36,7 +36,7 @@ class TestRegistration:
self.params.put("HardwareSerial", "serial") self.params.put("HardwareSerial", "serial")
self._generate_keys() 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" dongle = "DONGLE_ID_123"
self.params.put("DongleId", dongle) self.params.put("DongleId", dongle)
assert register() == dongle assert register() == dongle
@ -44,7 +44,7 @@ class TestRegistration:
def test_no_keys(self, mocker): def test_no_keys(self, mocker):
# missing pubkey # 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() dongle = register()
assert m.call_count == 0 assert m.call_count == 0
assert dongle == UNREGISTERED_DONGLE_ID assert dongle == UNREGISTERED_DONGLE_ID
@ -53,7 +53,7 @@ class TestRegistration:
def test_missing_cache(self, mocker): def test_missing_cache(self, mocker):
# keys exist but no dongle id # keys exist but no dongle id
self._generate_keys() 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" dongle = "DONGLE_ID_123"
m.return_value = MockResponse(json.dumps({'dongle_id': dongle}), 200) m.return_value = MockResponse(json.dumps({'dongle_id': dongle}), 200)
assert register() == dongle assert register() == dongle
@ -67,7 +67,7 @@ class TestRegistration:
def test_unregistered(self, mocker): def test_unregistered(self, mocker):
# keys exist, but unregistered # keys exist, but unregistered
self._generate_keys() 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) m.return_value = MockResponse(None, 402)
dongle = register() dongle = register()
assert m.call_count == 1 assert m.call_count == 1
Loading…
Cancel
Save