mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-17 23:08:18 +00:00
Duplicate support for qemu
Ref https://github.com/GNS3/gns3-gui/issues/1065
This commit is contained in:
@ -16,6 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import pytest
|
||||
import uuid
|
||||
import os
|
||||
import sys
|
||||
import stat
|
||||
@ -346,3 +347,17 @@ def test_capabilities(http_compute):
|
||||
with asyncio_patch("gns3server.compute.Qemu.get_kvm_archs", return_value=["x86_64"]):
|
||||
response = http_compute.get("/qemu/capabilities", example=True)
|
||||
assert response.json["kvm"] == ["x86_64"]
|
||||
|
||||
|
||||
def test_qemu_duplicate(http_compute, vm):
|
||||
with asyncio_patch("gns3server.compute.qemu.Qemu.duplicate_node", return_value=True) as mock:
|
||||
response = http_compute.post(
|
||||
"/projects/{project_id}/qemu/nodes/{node_id}/duplicate".format(
|
||||
project_id=vm["project_id"],
|
||||
node_id=vm["node_id"]),
|
||||
body={
|
||||
"destination_node_id": str(uuid.uuid4())
|
||||
},
|
||||
example=True)
|
||||
assert mock.called
|
||||
assert response.status == 201
|
||||
|
Reference in New Issue
Block a user