mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
When you change settings of the GNS3 VM the VM is reloaded and project using it closed
Fix #644
This commit is contained in:
7 files changed
+87
-25
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in new issue
Block a user