From: Stefan Eissing Date: Thu, 7 Oct 2021 08:18:33 +0000 (+0000) Subject: * changed status expectations X-Git-Tag: 2.5.0-alpha2-ci-test-only~768 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34f7c6ed3bd60b76e483189d210063e8245f287b;p=thirdparty%2Fapache%2Fhttpd.git * changed status expectations git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893957 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/modules/http2/test_203_encoding.py b/test/modules/http2/test_203_encoding.py index 6a88a71d57e..a9a450ac0a5 100644 --- a/test/modules/http2/test_203_encoding.py +++ b/test/modules/http2/test_203_encoding.py @@ -7,6 +7,8 @@ from h2_conf import HttpdConf class TestEncoding: + EXP_AH10244_ERRS = 0 + @pytest.fixture(autouse=True, scope='class') def _class_scope(self, env): extras = { @@ -28,6 +30,12 @@ class TestEncoding: }) conf.install() assert env.apache_restart() == 0 + yield + errors, warnings = env.apache_errors_and_warnings() + assert (len(errors), len(warnings)) == (TestEncoding.EXP_AH10244_ERRS, 0),\ + f"apache logged {len(errors)} errors and {len(warnings)} warnings: \n"\ + "{0}\n{1}\n".format("\n".join(errors), "\n".join(warnings)) + env.apache_error_log_clear() # check handling of url encodings that are accepted @pytest.mark.parametrize("path", [ @@ -56,15 +64,18 @@ class TestEncoding: # check path traversals @pytest.mark.parametrize(["path", "status"], [ ["/../cgi/echo.py", 404], - ["/nothing/%%32%65%%32%65/echo.py", 404], - ["/nothing/%%32%65%%32%65/echo.py", 404], - ["/cgi-bin/%%32%65%%32%65/echo.py", 404], - ["/cgi-bin/%%32%65%%32%65/%%32%65%%32%65/h2_env.py", 404], + ["/nothing/%%32%65%%32%65/echo.py", 400], + ["/nothing/%%32%65%%32%65/echo.py", 400], + ["/cgi-bin/%%32%65%%32%65/echo.py", 400], + ["/cgi-bin/%%32%65%%32%65/%%32%65%%32%65/h2_env.py", 400], ]) def test_203_04(self, env, path, status): url = env.mkurl("https", "cgi", path) r = env.curl_get(url) assert r.response["status"] == status + if status == 400: + TestEncoding.EXP_AH10244_ERRS += 1 + # the log will have a core:err about invalid URI path # check handling of %2f url encodings that are not decoded by default @pytest.mark.parametrize(["host", "path", "status"], [