From: Remi Gacogne Date: Tue, 18 Jul 2023 12:37:16 +0000 (+0200) Subject: dnsdist: Give the mock Proxy Protocol proxy some time to start X-Git-Tag: rec-5.0.0-alpha1~19^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ee9fa391fbed622c56fd4d6e5ac3a03d21edf72;p=thirdparty%2Fpdns.git dnsdist: Give the mock Proxy Protocol proxy some time to start --- diff --git a/regression-tests.dnsdist/test_ProxyProtocol.py b/regression-tests.dnsdist/test_ProxyProtocol.py index ee730eacb3..dd4ca4fbef 100644 --- a/regression-tests.dnsdist/test_ProxyProtocol.py +++ b/regression-tests.dnsdist/test_ProxyProtocol.py @@ -531,8 +531,8 @@ class TestProxyProtocolIncoming(ProxyProtocolTest): _serverCert = 'server.chain' _serverName = 'tls.tests.dnsdist.org' _caCert = 'ca.pem' - _dohServerPPOutsidePort = 8443 - _dohServerPPInsidePort = 9443 + _dohServerPPOutsidePort = pickAvailablePort() + _dohServerPPInsidePort = pickAvailablePort() _config_params = ['_dohServerPPOutsidePort', '_serverCert', '_serverKey', '_dohServerPPInsidePort', '_serverCert', '_serverKey', '_proxyResponderPort'] def testNoHeader(self): @@ -769,9 +769,10 @@ class TestProxyProtocolIncoming(ProxyProtocolTest): wire = query.to_wire() - reverseProxyPort = 13053 + reverseProxyPort = pickAvailablePort() reverseProxy = threading.Thread(name='Mock Proxy Protocol Reverse Proxy', target=MockTCPReverseProxyAddingProxyProtocol, args=[reverseProxyPort, self._dohServerPPOutsidePort]) reverseProxy.start() + time.sleep(1) receivedResponse = None conn = self.openDOHConnection(reverseProxyPort, self._caCert, timeout=2.0) @@ -818,7 +819,7 @@ class TestProxyProtocolIncoming(ProxyProtocolTest): wire = query.to_wire() - reverseProxyPort = 14053 + reverseProxyPort = pickAvailablePort() tlsContext = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) tlsContext.load_cert_chain(self._serverCert, self._serverKey) tlsContext.set_alpn_protocols(['h2'])