Merge remote-tracking branch 'origin/master' into 2.1

This commit is contained in:
Julien Duponchelle committed 2017-06-19 10:44:52 +02:00
commit bb8097a052
16 files changed
+95 -13

No files matched your search

@@ -113,3 +113,15 @@ def test_patch_vm_uuid(vm):
with open(vm._linked_vbox_file()) as f:
c = f.read()
assert "{" + vm.id + "}" in c
def test_patch_vm_uuid_with_corrupted_file(vm):
xml = """<?xml version="1.0"?>
<VirtualBox>
"""
os.makedirs(os.path.join(vm.working_dir, vm._vmname), exist_ok=True)
with open(vm._linked_vbox_file(), "w+") as f:
f.write(xml)
vm._linked_clone = True
with pytest.raises(VirtualBoxError):
vm._patch_vm_uuid()