mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-22 05:55:14 +02:00
Make sure used ports in a project are cleaned up when closing it.
This commit is contained in:
1 parent
2d6d153262
commit
153914bf97
17 files changed
+127
-65
No files matched your search
+3
-3
@@ -114,14 +114,14 @@ def port_manager():
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def free_console_port(request, port_manager):
|
||||
def free_console_port(request, port_manager, project):
|
||||
"""Get a free TCP port"""
|
||||
|
||||
# In case of already use ports we will raise an exception
|
||||
port = port_manager.get_free_tcp_port()
|
||||
port = port_manager.get_free_tcp_port(project)
|
||||
# We release the port immediately in order to allow
|
||||
# the test do whatever the test want
|
||||
port_manager.release_tcp_port(port)
|
||||
port_manager.release_tcp_port(port, project)
|
||||
return port
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user