mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 23:01:15 +02:00
Stream pcap from compute to controller to client
This commit is contained in:
15 files changed
+172
-124
No files matched your search
@@ -218,6 +218,25 @@ def test_get_file(http_compute, tmpdir):
|
||||
assert response.status == 403
|
||||
|
||||
|
||||
def test_stream_file(http_compute, tmpdir):
|
||||
|
||||
with patch("gns3server.config.Config.get_section_config", return_value={"project_directory": str(tmpdir)}):
|
||||
project = ProjectManager.instance().create_project(project_id="01010203-0405-0607-0809-0a0b0c0d0e0b")
|
||||
|
||||
with open(os.path.join(project.path, "hello"), "w+") as f:
|
||||
f.write("world")
|
||||
|
||||
response = http_compute.get("/projects/{project_id}/files/hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 200
|
||||
assert response.body == b"world"
|
||||
|
||||
response = http_compute.get("/projects/{project_id}/files/false".format(project_id=project.id), raw=True)
|
||||
assert response.status == 404
|
||||
|
||||
response = http_compute.get("/projects/{project_id}/files/../hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 403
|
||||
|
||||
|
||||
def test_export(http_compute, tmpdir, loop, project):
|
||||
|
||||
os.makedirs(project.path, exist_ok=True)
|
||||
|
||||
Reference in new issue
Block a user