mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Merge branch '2.2' into 3.0
# Conflicts: # CHANGELOG # dev-requirements.txt # gns3server/compute/qemu/__init__.py # gns3server/compute/vmware/__init__.py # gns3server/controller/snapshot.py # gns3server/crash_report.py # gns3server/handlers/api/compute/atm_switch_handler.py # gns3server/run.py # gns3server/static/web-ui/26.77d4bfd104f37c42e028.js # gns3server/static/web-ui/index.html # gns3server/static/web-ui/runtime.415291667f70565cd8ef.js # gns3server/utils/__init__.py # gns3server/utils/images.py # gns3server/utils/interfaces.py # gns3server/version.py # gns3server/web/web_server.py # pytest.ini # requirements.txt # scripts/update-bundled-web-ui.sh # setup.py # tests/api/routes/compute/test_dynamips_nodes.py # tests/compute/builtin/nodes/test_cloud.py # tests/compute/docker/test_docker.py # tests/compute/docker/test_docker_vm.py # tests/compute/dynamips/test_dynamips_manager.py # tests/compute/dynamips/test_dynamips_router.py # tests/compute/iou/test_iou_vm.py # tests/compute/qemu/test_qcow2.py # tests/compute/qemu/test_qemu_manager.py # tests/compute/qemu/test_qemu_vm.py # tests/compute/test_base_node.py # tests/compute/test_manager.py # tests/compute/test_project.py # tests/compute/traceng/test_traceng_vm.py # tests/compute/virtualbox/test_virtualbox_manager.py # tests/compute/virtualbox/test_virtualbox_vm.py # tests/compute/vmware/test_vmware_manager.py # tests/compute/vmware/test_vmware_vm.py # tests/compute/vpcs/test_vpcs_vm.py # tests/conftest.py # tests/controller/gns3vm/test_remote_gns3_vm.py # tests/controller/gns3vm/test_virtualbox_gns3_vm.py # tests/controller/gns3vm/test_vmware_gns3_vm.py # tests/controller/test_export_project.py # tests/controller/test_gns3vm.py # tests/controller/test_import_project.py # tests/test_config.py # tests/utils/test_asyncio.py # tests/utils/test_images.py # tests/web/test_response.py
This commit is contained in:
11 files changed
+46
-25
No files matched your search
@@ -146,7 +146,7 @@ def fake_image(tmpdir) -> str:
|
||||
|
||||
path = str(tmpdir / "7200.bin")
|
||||
with open(path, "wb+") as f:
|
||||
f.write(b'\x7fELF\x01\x02\x01')
|
||||
f.write(b'\x7fELF\x01\x01\x01')
|
||||
os.chmod(path, stat.S_IREAD)
|
||||
return path
|
||||
|
||||
@@ -170,7 +170,7 @@ async def test_images(app: FastAPI, compute_client: AsyncClient, tmpdir, fake_im
|
||||
assert response.json() == [{"filename": "7200.bin",
|
||||
"path": "7200.bin",
|
||||
"filesize": 7,
|
||||
"md5sum": "b0d5aa897d937aced5a6b1046e8f7e2e"}]
|
||||
"md5sum": "e573e8f5c93c6c00783f20c7a170aa6c"}]
|
||||
|
||||
|
||||
async def test_upload_image(app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None:
|
||||
|
||||
@@ -247,7 +247,7 @@ async def test_install_busybox_dynamic_linked():
|
||||
with pytest.raises(DockerError) as e:
|
||||
dst_dir = Docker.resources_path()
|
||||
await Docker.install_busybox(dst_dir)
|
||||
assert str(e.value) == "No busybox executable could be found"
|
||||
assert str(e.value) == "No busybox executable could be found, please install busybox (apt install busybox-static on Debian/Ubuntu) and make sure it is in your PATH"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -258,4 +258,4 @@ async def test_install_busybox_no_executables():
|
||||
with pytest.raises(DockerError) as e:
|
||||
dst_dir = Docker.resources_path()
|
||||
await Docker.install_busybox(dst_dir)
|
||||
assert str(e.value) == "No busybox executable could be found"
|
||||
assert str(e.value) == "No busybox executable could be found, please install busybox (apt install busybox-static on Debian/Ubuntu) and make sure it is in your PATH"
|
||||
+2
-2
@@ -105,5 +105,5 @@ class AsyncioBytesIO(io.BytesIO):
|
||||
async def write(self, data):
|
||||
return super().write(data)
|
||||
|
||||
async def close(self):
|
||||
return super().close()
|
||||
# async def close(self):
|
||||
# return super().close()
|
||||
@@ -115,11 +115,11 @@ def test_remove_checksum(tmpdir):
|
||||
async def test_list_images(tmpdir, config):
|
||||
|
||||
path1 = tmpdir / "images1" / "IOS" / "test1.image"
|
||||
path1.write(b'\x7fELF\x01\x02\x01', ensure=True)
|
||||
path1.write(b'\x7fELF\x01\x01\x01', ensure=True)
|
||||
path1 = force_unix_path(str(path1))
|
||||
|
||||
path2 = tmpdir / "images2" / "test2.image"
|
||||
path2.write(b'\x7fELF\x01\x02\x01', ensure=True)
|
||||
path2.write(b'\x7fELF\x01\x01\x01', ensure=True)
|
||||
path2 = force_unix_path(str(path2))
|
||||
|
||||
# Invalid image because not a valid elf file
|
||||
@@ -128,7 +128,7 @@ async def test_list_images(tmpdir, config):
|
||||
|
||||
if sys.platform.startswith("linux"):
|
||||
path3 = tmpdir / "images1" / "IOU" / "test3.bin"
|
||||
path3.write(b'\x7fELF\x01\x02\x01', ensure=True)
|
||||
path3.write(b'\x7fELF\x02\x01\x01', ensure=True)
|
||||
path3 = force_unix_path(str(path3))
|
||||
|
||||
path4 = tmpdir / "images1" / "QEMU" / "test4.qcow2"
|
||||
@@ -146,13 +146,13 @@ async def test_list_images(tmpdir, config):
|
||||
{
|
||||
'filename': 'test1.image',
|
||||
'filesize': 7,
|
||||
'md5sum': 'b0d5aa897d937aced5a6b1046e8f7e2e',
|
||||
'md5sum': 'e573e8f5c93c6c00783f20c7a170aa6c',
|
||||
'path': 'test1.image'
|
||||
},
|
||||
{
|
||||
'filename': 'test2.image',
|
||||
'filesize': 7,
|
||||
'md5sum': 'b0d5aa897d937aced5a6b1046e8f7e2e',
|
||||
'md5sum': 'e573e8f5c93c6c00783f20c7a170aa6c',
|
||||
'path': str(path2)
|
||||
}
|
||||
]
|
||||
@@ -162,7 +162,7 @@ async def test_list_images(tmpdir, config):
|
||||
{
|
||||
'filename': 'test3.bin',
|
||||
'filesize': 7,
|
||||
'md5sum': 'b0d5aa897d937aced5a6b1046e8f7e2e',
|
||||
'md5sum': 'c73626d23469519894d58bc98bee9655',
|
||||
'path': 'test3.bin'
|
||||
}
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user