When you change settings of the GNS3 VM the VM is reloaded and project using it closed

Fix #644
This commit is contained in:
Julien Duponchelle committed 2016-08-26 14:09:18 +02:00
1 parent 5289c714f4
commit 8352ff02a1
7 files changed
+87 -25

No files matched your search

+2 -2
View File
@@ -301,9 +301,9 @@ def test_start_vm(controller, async_run):
with asyncio_patch("gns3server.controller.gns3vm.vmware_gns3_vm.VMwareGNS3VM.start") as mock:
async_run(controller.start())
assert mock.called
assert len(controller.computes) == 2 # Local compute and vm are created
assert "local" in controller.computes
assert "vm" in controller.computes
assert len(controller.computes) == 2 # Local compute and vm are created
def test_stop(controller, async_run):
@@ -322,7 +322,7 @@ def test_stop_vm(controller, async_run):
"engine": "vmware",
"auto_stop": True
}
controller.gns3vm.running = True
controller.gns3vm._current_engine().running = True
with asyncio_patch("gns3server.controller.gns3vm.vmware_gns3_vm.VMwareGNS3VM.stop") as mock:
async_run(controller.stop())
assert mock.called
+13
View File
@@ -37,3 +37,16 @@ def test_list(async_run, controller):
def test_json(controller):
vm = GNS3VM(controller)
assert vm.__json__() == vm._settings
def test_update_settings(controller, async_run):
vm = GNS3VM(controller)
vm.settings = {
"enable": True,
"engine": "vmware"
}
with asyncio_patch("gns3server.controller.gns3vm.vmware_gns3_vm.VMwareGNS3VM.start"):
async_run(vm.auto_start_vm())
assert "vm" in controller.computes
async_run(vm.update_settings({"enable": False}))
assert "vm" not in controller.computes