Prevent renaming of a running VirtualBox linked VM

Fix https://github.com/GNS3/gns3-gui/issues/1816
This commit is contained in:
Julien Duponchelle committed 2017-01-30 15:19:46 +01:00
1 parent 2da20177a2
commit 580693b1ec
2 files changed
+13

No files matched your search

@@ -44,6 +44,17 @@ def test_vm(project, manager):
assert vm.vmname == "test"
def test_rename_vmname(project, manager, async_run):
"""
Rename a VM is not allowed when using linked clone
"""
vm = VirtualBoxVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager, "test", False)
vm._node_status = "started"
vm._linked_clone = True
with pytest.raises(VirtualBoxError):
async_run(vm.set_vmname("toto"))
def test_vm_valid_virtualbox_api_version(loop, project, manager):
with asyncio_patch("gns3server.compute.virtualbox.VirtualBox.execute", return_value=["API version: 4_3"]):
vm = VirtualBoxVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager, "test", False)