mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
API for creating a qemu disk image
This commit is contained in:
1 parent
5d8c90d138
commit
5b0c36c0d6
6 files changed
+123
-60
No files matched your search
@@ -239,3 +239,20 @@ def test_upload_vm_permission_denied(server, tmpdir):
|
||||
with patch("gns3server.modules.Qemu.get_images_directory", return_value=str(tmpdir),):
|
||||
response = server.post("/qemu/vms/test2", body="TEST", raw=True)
|
||||
assert response.status == 409
|
||||
|
||||
|
||||
def test_create_img(server):
|
||||
body = {
|
||||
"qemu_img": "/tmp/qemu-img",
|
||||
"path": "hda.qcow2",
|
||||
"format": "qcow2",
|
||||
"preallocation": "metadata",
|
||||
"cluster_size": 64,
|
||||
"refcount_bits": 12,
|
||||
"lazy_refcounts": "off",
|
||||
"size": 100
|
||||
}
|
||||
with asyncio_patch("gns3server.modules.Qemu.create_disk"):
|
||||
response = server.post("/qemu/img", body=body, example=True)
|
||||
|
||||
assert response.status == 201
|
||||
Reference in new issue
Block a user