Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions contrib/drivers/can/jumpstarter_driver_can/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class RemoteCyclicSendTask(can.broadcastmanager.CyclicSendTaskABC):
client: CanClient
uuid: UUID

def start(self) -> None:
self.client.call("_start_task", self.uuid)

def stop(self) -> None:
self.client.call("_stop_task", self.uuid)

Expand Down Expand Up @@ -89,13 +92,16 @@ def _send_periodic_internal(
msgs: Sequence[can.Message],
period: float,
duration: Optional[float] = None,
autostart: bool = True,
modifier_callback: Optional[Callable[[can.Message], None]] = None,
) -> can.broadcastmanager.CyclicSendTaskABC:
if modifier_callback:
return super()._send_periodic_internal(msgs, period, duration, modifier_callback)
return super()._send_periodic_internal(msgs, period, duration, autostart, modifier_callback)
else:
msgs = [CanMessage.construct(msg) for msg in msgs]
return RemoteCyclicSendTask(client=self, uuid=self.call("_send_periodic_internal", msgs, period, duration))
return RemoteCyclicSendTask(
client=self, uuid=self.call("_send_periodic_internal", msgs, period, duration, autostart)
)

# python-can bug
# https://docs.pydantic.dev/2.8/errors/usage_errors/#typed-dict-version
Expand Down
5 changes: 4 additions & 1 deletion contrib/drivers/can/jumpstarter_driver_can/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,16 @@ def test_client_can_send_periodic_remote(request, msgs, expected):
client1,
client2,
):
client1.send_periodic(
task = client1.send_periodic(
msgs=msgs,
period=0.1,
duration=1,
autostart=False,
store_task=True,
)

task.start()

assert [(msg.arbitration_id, msg.data) for msg in islice(client2, 4)] == expected


Expand Down
10 changes: 8 additions & 2 deletions contrib/drivers/can/jumpstarter_driver_can/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,23 @@ def _send_periodic_internal(
msgs: Union[Sequence[CanMessage], CanMessage],
period: float,
duration: Optional[float] = None,
autostart: bool = True,
modifier_callback: Optional[Callable[[can.Message], None]] = None,
) -> UUID:
assert modifier_callback is None
task = self.bus._send_periodic_internal(msgs, period, duration, modifier_callback)
task = self.bus._send_periodic_internal(msgs, period, duration, autostart, modifier_callback)
uuid = uuid4()
self.__tasks[uuid] = task
return uuid

@export
@validate_call(validate_return=True)
def _stop_task(self, uuid: UUID):
def _start_task(self, uuid: UUID) -> None:
self.__tasks[uuid].start()

@export
@validate_call(validate_return=True)
def _stop_task(self, uuid: UUID) -> None:
self.__tasks.pop(uuid).stop()

@export
Expand Down
927 changes: 0 additions & 927 deletions contrib/drivers/http/uv.lock

This file was deleted.

1 change: 1 addition & 0 deletions contrib/drivers/tftp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ build-backend = "hatchling.build"
dev = [
"pytest-cov>=6.0.0",
"pytest>=8.3.3",
"pytest-asyncio>=0.0.0",
"ruff>=0.7.1",

]
921 changes: 0 additions & 921 deletions contrib/drivers/tftp/uv.lock

This file was deleted.

21 changes: 16 additions & 5 deletions tests/test_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from jumpstarter.common import MetadataFilter
from jumpstarter.common.grpc import aio_secure_channel, ssl_channel_credentials
from jumpstarter.common.streams import connect_router_stream
from jumpstarter.config.tls import TLSConfigV1Alpha1
from jumpstarter.drivers.power.driver import MockPower
from jumpstarter.exporter import Exporter, Session

Expand All @@ -23,7 +24,7 @@ async def test_router(mock_controller, monkeypatch):
uuid = uuid4()

async def handle_async(stream):
async with connect_router_stream(mock_controller, str(uuid), stream):
async with connect_router_stream(mock_controller, str(uuid), stream, TLSConfigV1Alpha1(insecure=True)):
pass

with Session(
Expand All @@ -33,7 +34,9 @@ async def handle_async(stream):
) as session:
async with session.serve_unix_async() as path:
async with create_task_group() as tg:
tg.start_soon(Exporter._Exporter__handle, None, path, mock_controller, str(uuid))
tg.start_soon(
Exporter._Exporter__handle, None, path, mock_controller, str(uuid), TLSConfigV1Alpha1(insecure=True)
)
with start_blocking_portal() as portal:
lease = Lease(
channel=grpc.aio.insecure_channel("grpc.invalid"),
Expand All @@ -55,7 +58,10 @@ async def test_unsatisfiable(mock_controller):
with start_blocking_portal() as portal:
with pytest.raises(ValueError):
async with Lease(
channel=aio_secure_channel(mock_controller, ssl_channel_credentials(mock_controller)),
channel=aio_secure_channel(
mock_controller,
ssl_channel_credentials(mock_controller, tls_config=TLSConfigV1Alpha1(insecure=True)),
),
metadata_filter=MetadataFilter(labels={"unsatisfiable": "true"}),
portal=portal,
allow=[],
Expand All @@ -69,7 +75,9 @@ async def test_controller(mock_controller):
uuid = uuid4()

async with Exporter(
channel_factory=lambda: aio_secure_channel(mock_controller, ssl_channel_credentials(mock_controller)),
channel_factory=lambda: aio_secure_channel(
mock_controller, ssl_channel_credentials(mock_controller, tls_config=TLSConfigV1Alpha1(insecure=True))
),
uuid=uuid,
labels={},
device_factory=lambda: MockPower(),
Expand All @@ -79,7 +87,10 @@ async def test_controller(mock_controller):

with start_blocking_portal() as portal:
async with Lease(
channel=aio_secure_channel(mock_controller, ssl_channel_credentials(mock_controller)),
channel=aio_secure_channel(
mock_controller,
ssl_channel_credentials(mock_controller, tls_config=TLSConfigV1Alpha1(insecure=True)),
),
metadata_filter=MetadataFilter(),
portal=portal,
allow=[],
Expand Down
Loading