mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Delete VPCS
This commit is contained in:
1 parent
545a3d2b58
commit
e12e6044dc
5 files changed
+53
-1
No files matched your search
@@ -126,6 +126,13 @@ def test_vpcs_reload(server, vm):
|
||||
assert response.status == 204
|
||||
|
||||
|
||||
def test_vpcs_delete(server, vm):
|
||||
with asyncio_patch("gns3server.modules.vpcs.VPCS.delete_vm", return_value=True) as mock:
|
||||
response = server.delete("/vpcs/{}".format(vm["uuid"]))
|
||||
assert mock.called
|
||||
assert response.status == 204
|
||||
|
||||
|
||||
def test_vpcs_update(server, vm, tmpdir, free_console_port):
|
||||
path = os.path.join(str(tmpdir), 'startup2.vpcs')
|
||||
with open(path, 'w+') as f:
|
||||
|
||||
@@ -177,3 +177,14 @@ def test_change_script_file(vm, tmpdir):
|
||||
path = os.path.join(str(tmpdir), 'startup2.vpcs')
|
||||
vm.script_file = path
|
||||
assert vm.script_file == path
|
||||
|
||||
|
||||
def test_destroy(vm, port_manager):
|
||||
with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM._check_requirements", return_value=True):
|
||||
with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()):
|
||||
vm.start()
|
||||
port = vm.console
|
||||
vm.destroy()
|
||||
# Raise an exception if the port is not free
|
||||
port_manager.reserve_console_port(port)
|
||||
assert vm.is_running() is False
|
||||
Reference in new issue
Block a user