From e0c37f4a42c3cb9970d24752c2f8bb5a4322931f Mon Sep 17 00:00:00 2001 From: EvgeniiMekhanik Date: Thu, 5 Dec 2024 19:46:40 +0200 Subject: [PATCH] Implement tests to reproduce #2300 issue from Tempesta Check how Tempesta FW make websocket upgrade for negotiable connections (proto is `https.h2` in Tempesta FW config). --- ws/test_ws_ping.py | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/ws/test_ws_ping.py b/ws/test_ws_ping.py index d2f80850c..81a1f8167 100755 --- a/ws/test_ws_ping.py +++ b/ws/test_ws_ping.py @@ -11,7 +11,7 @@ from helpers import dmesg, tf_cfg from helpers.cert_generator_x509 import CertGenerator -from test_suite import tester +from test_suite import marks, tester __author__ = "Tempesta Technologies, Inc." __copyright__ = "Copyright (C) 2017-2024 Tempesta Technologies, Inc." @@ -328,6 +328,38 @@ def test(self): self.p2.join() +@marks.parameterize_class( + [{"name": "HttpsH2", "proto": "https,h2"}, {"name": "H2Https", "proto": "h2,https"}] +) +class WssPingMultipleListeners(WssPing): + tempesta_template = { + "config": """ +listen 81; +listen 82 proto=%s; + +srv_group default { + + server ${server_ip}:8099; +} +frang_limits {http_strict_host_checking false;} +tls_certificate ${general_workdir}/cert.pem; +tls_certificate_key ${general_workdir}/key.pem; +tls_match_any_server_name; +vhost default { + proxy_pass default; +} + +http_chain { + -> default; +} +""", + } + + def setUp(self): + self.tempesta["config"] = self.tempesta_template["config"] % self.proto + super().setUp() + + class WssPingProxy(WssPing): """ Ping test for websocket wss scheme with nginx proxying TLS