mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-19 12:45:19 +02:00
Merge branch '2.2' into 3.0
# Conflicts: # .github/workflows/testing.yml # CHANGELOG # README.md # dev-requirements.txt # gns3server/compute/docker/docker_vm.py # gns3server/controller/export_project.py # gns3server/controller/import_project.py # gns3server/controller/project.py # gns3server/crash_report.py # gns3server/static/web-ui/index.html # gns3server/static/web-ui/main.df8c319a3da6fb0e3629.js # gns3server/version.py # requirements.txt # setup.py # tests/compute/docker/test_docker_vm.py # tests/controller/test_import_project.py
This commit is contained in:
24 files changed
+648
-312
No files matched your search
@@ -21,6 +21,7 @@ import json
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
import zipfile
|
||||
import stat
|
||||
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
@@ -119,6 +120,8 @@ async def test_export(tmpdir, project):
|
||||
with open(os.path.join(path, "project-files", "snapshots", "test"), 'w+') as f:
|
||||
f.write("WORLD")
|
||||
|
||||
os.symlink("/tmp/anywhere", os.path.join(path, "vm-1", "dynamips", "symlink"))
|
||||
|
||||
with aiozipstream.ZipFile() as z:
|
||||
with patch("gns3server.compute.Dynamips.get_images_directory", return_value=str(tmpdir / "IOS"),):
|
||||
await export_project(z, project, str(tmpdir), include_images=False)
|
||||
@@ -134,9 +137,12 @@ async def test_export(tmpdir, project):
|
||||
assert 'vm-1/dynamips/empty-dir/' in myzip.namelist()
|
||||
assert 'project-files/snapshots/test' not in myzip.namelist()
|
||||
assert 'vm-1/dynamips/test_log.txt' not in myzip.namelist()
|
||||
|
||||
assert 'images/IOS/test.image' not in myzip.namelist()
|
||||
|
||||
assert 'vm-1/dynamips/symlink' in myzip.namelist()
|
||||
zip_info = myzip.getinfo('vm-1/dynamips/symlink')
|
||||
assert stat.S_ISLNK(zip_info.external_attr >> 16)
|
||||
|
||||
with myzip.open("project.gns3") as myfile:
|
||||
topo = json.loads(myfile.read().decode())["topology"]
|
||||
assert topo["nodes"][0]["compute_id"] == "local" # All node should have compute_id local after export
|
||||
|
||||
Reference in new issue
Block a user