mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Captures written in the captures directory on the controller
This commit is contained in:
9 files changed
+155
-40
No files matched your search
@@ -97,11 +97,13 @@ def test_stop_capture(http_controller, tmpdir, project, compute, async_run):
|
||||
|
||||
def test_pcap(http_controller, tmpdir, project, compute, async_run):
|
||||
link = Link(project)
|
||||
link
|
||||
link._capture_file_name = "test"
|
||||
link._capturing = True
|
||||
with open(link.capture_file_path, "w+") as f:
|
||||
f.write("hello")
|
||||
project._links = {link.id: link}
|
||||
with asyncio_patch("gns3server.controller.link.Link.read_pcap", return_value=None) as mock:
|
||||
response = http_controller.get("/projects/{}/links/{}/pcap".format(project.id, link.id), example=True)
|
||||
assert mock.called
|
||||
response = http_controller.get("/projects/{}/links/{}/pcap".format(project.id, link.id), example=True)
|
||||
assert response.body == b"hello"
|
||||
|
||||
|
||||
def test_delete_link(http_controller, tmpdir, project, compute, async_run):
|
||||
|
||||
Reference in new issue
Block a user