]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
tests: add the websockets python module version checks needed for our CI infra
authorStefan Eissing <icing@apache.org>
Wed, 28 Jun 2023 11:03:29 +0000 (11:03 +0000)
committerStefan Eissing <icing@apache.org>
Wed, 28 Jun 2023 11:03:29 +0000 (11:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910654 13f79535-47bb-0310-9956-ffa450edef68

test/modules/http2/test_800_websockets.py

index 2afa45edc3b0012eb2b0b546c391874bf4af246f..754ac00d62468b2746c3222eaa39e5ab8c5ea795 100644 (file)
@@ -5,8 +5,10 @@ import shutil
 import subprocess
 import time
 from datetime import timedelta, datetime
+import packaging.version
 
 import pytest
+import websockets
 from pyhttpd.result import ExecResult
 from pyhttpd.ws_util import WsFrameReader, WsFrame
 
@@ -15,6 +17,9 @@ from .env import H2Conf, H2TestEnv
 
 log = logging.getLogger(__name__)
 
+ws_version = packaging.version.parse(websockets.version.version)
+ws_version_min = packaging.version.Version('10.4')
+
 
 def ws_run(env: H2TestEnv, path, authority=None, do_input=None, inbytes=None,
            send_close=True, timeout=5, scenario='ws-stdin',
@@ -80,6 +85,8 @@ def ws_run(env: H2TestEnv, path, authority=None, do_input=None, inbytes=None,
 @pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 @pytest.mark.skipif(condition=not H2TestEnv().httpd_is_at_least("2.5.0"),
                     reason=f'need at least httpd 2.5.0 for this')
+@pytest.mark.skipif(condition=ws_version < ws_version_min,
+                    reason=f'websockets is {ws_version}, need at least {ws_version_min}')
 class TestWebSockets:
 
     @pytest.fixture(autouse=True, scope='class')