mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-08-23 09:13:47 +08:00
dragonpilot beta3
date: 2023-10-09T10:55:55 commit: 91b6e3aecd7170f24bccacb10c515ec281c30295
This commit is contained in:
@@ -5,17 +5,18 @@ import time
|
||||
import unittest
|
||||
|
||||
from cereal import car
|
||||
from common.params import Params
|
||||
import selfdrive.manager.manager as manager
|
||||
from selfdrive.manager.process import ensure_running
|
||||
from selfdrive.manager.process_config import managed_processes
|
||||
from system.hardware import HARDWARE
|
||||
from openpilot.common.params import Params
|
||||
import openpilot.selfdrive.manager.manager as manager
|
||||
from openpilot.selfdrive.manager.process import ensure_running
|
||||
from openpilot.selfdrive.manager.process_config import managed_processes
|
||||
from openpilot.system.hardware import HARDWARE
|
||||
|
||||
os.environ['FAKEUPLOAD'] = "1"
|
||||
|
||||
MAX_STARTUP_TIME = 3
|
||||
BLACKLIST_PROCS = ['manage_athenad', 'pandad', 'pigeond']
|
||||
|
||||
|
||||
class TestManager(unittest.TestCase):
|
||||
def setUp(self):
|
||||
os.environ['PASSIVE'] = '0'
|
||||
@@ -32,6 +33,10 @@ class TestManager(unittest.TestCase):
|
||||
os.environ['PREPAREONLY'] = '1'
|
||||
manager.main()
|
||||
|
||||
def test_blacklisted_procs(self):
|
||||
# TODO: ensure there are blacklisted procs until we have a dedicated test
|
||||
self.assertTrue(len(BLACKLIST_PROCS), "No blacklisted procs to test not_run")
|
||||
|
||||
def test_startup_time(self):
|
||||
for _ in range(10):
|
||||
start = time.monotonic()
|
||||
@@ -59,6 +64,8 @@ class TestManager(unittest.TestCase):
|
||||
self.assertTrue(state.running, f"{p.name} not running")
|
||||
exit_code = p.stop(retry=False)
|
||||
|
||||
self.assertNotIn(p.name, BLACKLIST_PROCS, f"{p.name} was started")
|
||||
|
||||
# TODO: mapsd should exit cleanly
|
||||
if p.name == "mapsd":
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user