mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-01 11:40:56 +00:00
Fix more tests
This commit is contained in:
parent
eb3fc1bb3a
commit
997e0ad6ee
@ -60,7 +60,7 @@ def fake_qemu_binary(monkeypatch, tmpdir):
|
|||||||
|
|
||||||
monkeypatch.setenv("PATH", str(tmpdir))
|
monkeypatch.setenv("PATH", str(tmpdir))
|
||||||
if sys.platform.startswith("win"):
|
if sys.platform.startswith("win"):
|
||||||
bin_path = os.path.join(os.environ["PATH"], "qemu-system-x86_64w.EXE")
|
bin_path = os.path.join(os.environ["PATH"], "qemu-system-x86_64w.exe")
|
||||||
else:
|
else:
|
||||||
bin_path = os.path.join(os.environ["PATH"], "qemu-system-x86_64")
|
bin_path = os.path.join(os.environ["PATH"], "qemu-system-x86_64")
|
||||||
with open(bin_path, "w+") as f:
|
with open(bin_path, "w+") as f:
|
||||||
@ -859,6 +859,9 @@ def test_get_qemu_img(vm, tmpdir):
|
|||||||
open(str(tmpdir / "qemu-system-x86_64"), "w+").close()
|
open(str(tmpdir / "qemu-system-x86_64"), "w+").close()
|
||||||
open(str(tmpdir / "qemu-img"), "w+").close()
|
open(str(tmpdir / "qemu-img"), "w+").close()
|
||||||
vm._qemu_path = str(tmpdir / "qemu-system-x86_64")
|
vm._qemu_path = str(tmpdir / "qemu-system-x86_64")
|
||||||
|
if sys.platform.startswith("win"):
|
||||||
|
assert vm._get_qemu_img() == str(tmpdir / "qemu-img.EXE")
|
||||||
|
else:
|
||||||
assert vm._get_qemu_img() == str(tmpdir / "qemu-img")
|
assert vm._get_qemu_img() == str(tmpdir / "qemu-img")
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,9 +74,9 @@ async def test_nat_nio_update_udp(compute_api, vm):
|
|||||||
"rhost": "127.0.0.1"
|
"rhost": "127.0.0.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
await compute_api.post("/projects/{project_id}/nat/nodes/{node_id}/adapters/0/ports/0/nio".format(project_id=vm["project_id"], node_id=vm["node_id"]), params)
|
await compute_api.post("/projects/{project_id}/nat/nodes/{node_id}/adapters/0/ports/1/nio".format(project_id=vm["project_id"], node_id=vm["node_id"]), params)
|
||||||
params["filters"] = {}
|
params["filters"] = {}
|
||||||
response = await compute_api.put("/projects/{project_id}/nat/nodes/{node_id}/adapters/0/ports/0/nio".format(project_id=vm["project_id"], node_id=vm["node_id"]), params)
|
response = await compute_api.put("/projects/{project_id}/nat/nodes/{node_id}/adapters/0/ports/1/nio".format(project_id=vm["project_id"], node_id=vm["node_id"]), params)
|
||||||
assert response.status == 201, response.body.decode()
|
assert response.status == 201, response.body.decode()
|
||||||
assert response.route == r"/projects/{project_id}/nat/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio"
|
assert response.route == r"/projects/{project_id}/nat/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio"
|
||||||
assert response.json["type"] == "nio_udp"
|
assert response.json["type"] == "nio_udp"
|
||||||
|
Loading…
Reference in New Issue
Block a user