mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-20 05:05:14 +02:00
Merge pull request #3062 from yueguobin/feat/docker-image-upload
Allow uploading, deleting and pulling Docker images on computes
This commit is contained in:
16 files changed
+1312
-206
No files matched your search
@@ -119,6 +119,34 @@ async def test_dispatch_node_updated(controller, node, project):
|
||||
assert event["properties"]["startup_config"] == "ip 192"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_dispatch_docker_image_routed_to_controller_stream(controller, project):
|
||||
"""
|
||||
docker.image.* events are scoped to a compute, not to a project: they must
|
||||
reach the controller stream even when no project is open, and not the
|
||||
project stream.
|
||||
"""
|
||||
|
||||
notif = controller.notification
|
||||
with notif.controller_queue() as controller_q, notif.project_queue(project.id) as project_q:
|
||||
await controller_q.get(0.1) # ping
|
||||
await project_q.get(0.1) # ping
|
||||
|
||||
await notif.dispatch(
|
||||
"docker.image.pull", {"image": "debian", "state": "started"}, project_id=None, compute_id="local"
|
||||
)
|
||||
|
||||
msg = await controller_q.get(5)
|
||||
assert msg == (
|
||||
"docker.image.pull",
|
||||
{"image": "debian", "state": "started", "compute_id": "local"},
|
||||
{},
|
||||
)
|
||||
# the project stream only carries its periodic ping
|
||||
msg = await project_q.get(0.2)
|
||||
assert msg[0] == "ping"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_dispatch_marker_routed_to_marker_channel(controller, project):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user