mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Merge branch '2.2' into 3.0
# Conflicts: # README.md # README.rst # tests/handlers/api/compute/test_nat.py
This commit is contained in:
commit
f09594ae4c
@ -1,4 +1,4 @@
|
|||||||
include README.rst
|
include README.md
|
||||||
include AUTHORS
|
include AUTHORS
|
||||||
include LICENSE
|
include LICENSE
|
||||||
include MANIFEST.in
|
include MANIFEST.in
|
||||||
|
@ -30,7 +30,10 @@ from unittest.mock import patch, MagicMock
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def fake_qemu_img_binary(tmpdir):
|
def fake_qemu_img_binary(tmpdir):
|
||||||
|
|
||||||
bin_path = str(tmpdir / "qemu-img")
|
if sys.platform.startswith("win"):
|
||||||
|
bin_path = str(tmpdir / "qemu-img.EXE")
|
||||||
|
else:
|
||||||
|
bin_path = str(tmpdir / "qemu-img")
|
||||||
with open(bin_path, "w+") as f:
|
with open(bin_path, "w+") as f:
|
||||||
f.write("1")
|
f.write("1")
|
||||||
os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
||||||
|
@ -45,7 +45,10 @@ async def manager(port_manager):
|
|||||||
def fake_qemu_img_binary(monkeypatch, tmpdir):
|
def fake_qemu_img_binary(monkeypatch, tmpdir):
|
||||||
|
|
||||||
monkeypatch.setenv("PATH", str(tmpdir))
|
monkeypatch.setenv("PATH", str(tmpdir))
|
||||||
bin_path = os.path.join(os.environ["PATH"], "qemu-img")
|
if sys.platform.startswith("win"):
|
||||||
|
bin_path = os.path.join(os.environ["PATH"], "qemu-img.EXE")
|
||||||
|
else:
|
||||||
|
bin_path = os.path.join(os.environ["PATH"], "qemu-img")
|
||||||
with open(bin_path, "w+") as f:
|
with open(bin_path, "w+") as f:
|
||||||
f.write("1")
|
f.write("1")
|
||||||
os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
||||||
@ -865,7 +868,10 @@ 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")
|
||||||
assert vm._get_qemu_img() == str(tmpdir / "qemu-img")
|
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")
|
||||||
|
|
||||||
|
|
||||||
# def test_get_qemu_img_not_exist(vm, tmpdir):
|
# def test_get_qemu_img_not_exist(vm, tmpdir):
|
||||||
|
0
tests/handlers/api/compute/test_nat.py
Normal file
0
tests/handlers/api/compute/test_nat.py
Normal file
Loading…
Reference in New Issue
Block a user