mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-12 19:38:57 +00:00
Avoid crash during tests if VNC server run on host PC
This commit is contained in:
parent
19d184e04c
commit
00fc2fa007
@ -109,7 +109,7 @@ def test_create(loop, project, manager):
|
||||
"container=docker",
|
||||
"GNS3_MAX_ETHERNET=eth0",
|
||||
"GNS3_VOLUMES=/etc/network"
|
||||
],
|
||||
],
|
||||
"Entrypoint": ["/gns3/init.sh"],
|
||||
"Cmd": ["/bin/sh"]
|
||||
})
|
||||
@ -148,7 +148,7 @@ def test_create_with_tag(loop, project, manager):
|
||||
"container=docker",
|
||||
"GNS3_MAX_ETHERNET=eth0",
|
||||
"GNS3_VOLUMES=/etc/network"
|
||||
],
|
||||
],
|
||||
"Entrypoint": ["/gns3/init.sh"],
|
||||
"Cmd": ["/bin/sh"]
|
||||
})
|
||||
@ -193,7 +193,7 @@ def test_create_vnc(loop, project, manager):
|
||||
"GNS3_VOLUMES=/etc/network",
|
||||
"QT_GRAPHICSSYSTEM=native",
|
||||
"DISPLAY=:42"
|
||||
],
|
||||
],
|
||||
"Entrypoint": ["/gns3/init.sh"],
|
||||
"Cmd": ["/bin/sh"]
|
||||
})
|
||||
@ -237,7 +237,7 @@ def test_create_start_cmd(loop, project, manager):
|
||||
"container=docker",
|
||||
"GNS3_MAX_ETHERNET=eth0",
|
||||
"GNS3_VOLUMES=/etc/network"
|
||||
]
|
||||
]
|
||||
})
|
||||
assert vm._cid == "e90e34656806"
|
||||
|
||||
@ -272,7 +272,7 @@ def test_create_environment(loop, project, manager):
|
||||
"GNS3_VOLUMES=/etc/network",
|
||||
"YES=1",
|
||||
"NO=0"
|
||||
],
|
||||
],
|
||||
"Volumes": {},
|
||||
"NetworkDisabled": True,
|
||||
"Name": "test",
|
||||
@ -330,7 +330,7 @@ def test_create_image_not_available(loop, project, manager):
|
||||
"container=docker",
|
||||
"GNS3_MAX_ETHERNET=eth0",
|
||||
"GNS3_VOLUMES=/etc/network"
|
||||
],
|
||||
],
|
||||
"Entrypoint": ["/gns3/init.sh"],
|
||||
"Cmd": ["/bin/sh"]
|
||||
})
|
||||
@ -566,8 +566,8 @@ def test_update_vnc(loop, vm):
|
||||
"Warnings": []
|
||||
}
|
||||
|
||||
vm.console_type = "vnc"
|
||||
vm.console = 5900
|
||||
vm._console_type = "vnc"
|
||||
vm._console = 5900
|
||||
vm._display = "display"
|
||||
original_console = vm.console
|
||||
original_aux = vm.aux
|
||||
@ -872,6 +872,7 @@ def test_get_image_informations(project, manager, loop):
|
||||
loop.run_until_complete(asyncio.async(vm._get_image_information()))
|
||||
mock.assert_called_with("GET", "images/ubuntu:latest/json")
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not supported on Windows")
|
||||
def test_mount_binds(vm, tmpdir):
|
||||
image_infos = {
|
||||
@ -930,6 +931,7 @@ def test_create_network_interfaces(vm):
|
||||
assert "eth4" in content
|
||||
assert "eth5" not in content
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not supported on Windows")
|
||||
def test_fix_permission(vm, loop):
|
||||
vm._volumes = ["/etc"]
|
||||
|
@ -68,7 +68,7 @@ def test_change_console_port(node, port_manager):
|
||||
|
||||
def test_console_vnc_invalid(project, manager):
|
||||
node = VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager)
|
||||
node.console_type = "vnc"
|
||||
node._console_type = "vnc"
|
||||
with pytest.raises(NodeError):
|
||||
node.console = 2012
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user