From b0a94124d24305a6ddf27443b5a881f80daee2fa Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 3 Dec 2025 17:48:43 +0100 Subject: [PATCH] plugin NAT port: disable the plugin for tests: The UPnP-IGD devices discovery takes time and is not necessary during tests, so this plugin is now diable during tests. --- libervia/backend/plugins/plugin_misc_nat_port.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libervia/backend/plugins/plugin_misc_nat_port.py b/libervia/backend/plugins/plugin_misc_nat_port.py index 97915e51..e3a5f79a 100644 --- a/libervia/backend/plugins/plugin_misc_nat_port.py +++ b/libervia/backend/plugins/plugin_misc_nat_port.py @@ -17,6 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import sys from libervia.backend.core.i18n import _ from libervia.backend.core.constants import Const as C from libervia.backend.core.log import getLogger @@ -28,6 +29,11 @@ from twisted.internet import defer from twisted.python import failure import threading + +if "pytest" in sys.modules: + # We skip this module during tests to avoid waiting for UPnP-IGD. + raise exceptions.CancelError("This module is not run during tests.") + try: import miniupnpc except ImportError: @@ -46,7 +52,7 @@ PLUGIN_INFO = { } STARTING_PORT = 6000 # starting point to automatically find a port -DEFAULT_DESC = "SaT port mapping" # we don't use "à" here as some bugged NAT don't manage charset correctly +DEFAULT_DESC = "Libervia port mapping" class MappingError(Exception):