You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2021/10/07 08:18:33 UTC

svn commit: r1893957 - /httpd/httpd/trunk/test/modules/http2/test_203_encoding.py

Author: icing
Date: Thu Oct  7 08:18:33 2021
New Revision: 1893957

URL: http://svn.apache.org/viewvc?rev=1893957&view=rev
Log:
 * changed status expectations 


Modified:
    httpd/httpd/trunk/test/modules/http2/test_203_encoding.py

Modified: httpd/httpd/trunk/test/modules/http2/test_203_encoding.py
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/test/modules/http2/test_203_encoding.py?rev=1893957&r1=1893956&r2=1893957&view=diff
==============================================================================
--- httpd/httpd/trunk/test/modules/http2/test_203_encoding.py (original)
+++ httpd/httpd/trunk/test/modules/http2/test_203_encoding.py Thu Oct  7 08:18:33 2021
@@ -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"], [