serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kot...@apache.org
Subject svn commit: r1805340 - in /serf/branches/1.3.x-r1804008-group/test: test_auth.c test_context.c
Date Thu, 17 Aug 2017 21:51:37 GMT
Author: kotkov
Date: Thu Aug 17 21:51:37 2017
New Revision: 1805340

URL: http://svn.apache.org/viewvc?rev=1805340&view=rev
Log:
On the '1.3.x-r1804008-group' branch: Fix a couple of responses with
chunked encoding in the test suite that are ill-formed per RFC7230,
and now result in an error.

On trunk, these tests use MockHTTP framework and that results in properly
parseable responses, but on the 1.3.x branch they were hand-crafted.
I think that the trunk equivalents of all these responses are just empty
"Transfer-Encoding: chunked" responses, so I changed them here accordingly.

* test/test_auth.c
  (test_authentication_disabled, test_unsupported_authentication,
   basic_authentication, digest_authentication, authentication_switch_realms):
   Mock empty chunked responses.

* test/test_context.c
  (test_ssltunnel_no_creds_cb, ssltunnel_basic_auth,
   test_ssltunnel_digest_auth): Mock empty chunked responses.

Modified:
    serf/branches/1.3.x-r1804008-group/test/test_auth.c
    serf/branches/1.3.x-r1804008-group/test/test_context.c

Modified: serf/branches/1.3.x-r1804008-group/test/test_auth.c
URL: http://svn.apache.org/viewvc/serf/branches/1.3.x-r1804008-group/test/test_auth.c?rev=1805340&r1=1805339&r2=1805340&view=diff
==============================================================================
--- serf/branches/1.3.x-r1804008-group/test/test_auth.c (original)
+++ serf/branches/1.3.x-r1804008-group/test/test_auth.c Thu Aug 17 21:51:37 2017
@@ -53,7 +53,6 @@ static void test_authentication_disabled
             "Transfer-Encoding: chunked" CRLF
             "WWW-Authenticate: Basic realm=""Test Suite""" CRLF
             CRLF
-            "1" CRLF CRLF
             "0" CRLF CRLF},
     };
     apr_status_t status;
@@ -96,7 +95,6 @@ static void test_unsupported_authenticat
             "Transfer-Encoding: chunked" CRLF
             "WWW-Authenticate: NotExistent realm=""Test Suite""" CRLF
             CRLF
-            "1" CRLF CRLF
             "0" CRLF CRLF},
     };
     apr_status_t status;
@@ -195,7 +193,6 @@ static void basic_authentication(CuTest
         "www-Authenticate: bAsIc realm=""Test Suite""" CRLF
         "%s"
         CRLF
-        "1" CRLF CRLF
         "0" CRLF CRLF, resp_hdrs);
     action_list[1].kind = SERVER_RESPOND;
     action_list[1].text = CHUNKED_EMPTY_RESPONSE;
@@ -315,7 +312,6 @@ static void digest_authentication(CuTest
         "algorithm=\"MD5\",qop-options=\"auth\"" CRLF
         "%s"
         CRLF
-        "1" CRLF CRLF
         "0" CRLF CRLF, resp_hdrs);
     /* If the resp_hdrs includes "Connection: close", serf will automatically
        reset the connection from the client side, no need to use 
@@ -457,7 +453,6 @@ static void authentication_switch_realms
         "Transfer-Encoding: chunked" CRLF
         "WWW-Authenticate: %s realm=""Test Suite""%s" CRLF
         CRLF
-        "1" CRLF CRLF
         "0" CRLF CRLF, scheme, authn_attr);
     action_list[1].kind = SERVER_RESPOND;
     action_list[1].text = CHUNKED_EMPTY_RESPONSE;
@@ -469,7 +464,6 @@ static void authentication_switch_realms
         "Transfer-Encoding: chunked" CRLF
         "WWW-Authenticate: %s realm=""New Realm""%s" CRLF
         CRLF
-        "1" CRLF CRLF
         "0" CRLF CRLF, scheme, authn_attr);
     action_list[4].kind = SERVER_RESPOND;
     action_list[4].text = CHUNKED_EMPTY_RESPONSE;

Modified: serf/branches/1.3.x-r1804008-group/test/test_context.c
URL: http://svn.apache.org/viewvc/serf/branches/1.3.x-r1804008-group/test/test_context.c?rev=1805340&r1=1805339&r2=1805340&view=diff
==============================================================================
--- serf/branches/1.3.x-r1804008-group/test/test_context.c (original)
+++ serf/branches/1.3.x-r1804008-group/test/test_context.c Thu Aug 17 21:51:37 2017
@@ -1918,7 +1918,6 @@ static void test_ssltunnel_no_creds_cb(C
             "Transfer-Encoding: chunked" CRLF
             "Proxy-Authenticate: Basic realm=""Test Suite Proxy""" CRLF
             CRLF
-            "1" CRLF CRLF
             "0" CRLF CRLF},
     };
 
@@ -2034,7 +2033,6 @@ static void ssltunnel_basic_auth(CuTest
         "Proxy-Authenticate: Basic realm=""Test Suite Proxy""" CRLF
         "%s"
         CRLF
-        "1" CRLF CRLF
         "0" CRLF CRLF, proxy_407_resp_hdrs);
     action_list_proxy[1].kind = SERVER_RESPOND;
     action_list_proxy[1].text = apr_psprintf(test_pool,
@@ -2043,7 +2041,6 @@ static void ssltunnel_basic_auth(CuTest
         "Proxy-Authenticate: Basic realm=""Test Suite Proxy""" CRLF
         "%s"
         CRLF
-        "1" CRLF CRLF
         "0" CRLF CRLF, proxy_407_resp_hdrs);
 
     action_list_proxy[2].kind = SERVER_RESPOND;
@@ -2053,7 +2050,6 @@ static void ssltunnel_basic_auth(CuTest
         "Proxy-Authenticate: Basic realm=""Test Suite Proxy""" CRLF
         "%s"
         CRLF
-        "1" CRLF CRLF
         "0" CRLF CRLF, proxy_407_resp_hdrs);
 
     action_list_proxy[3].kind = SERVER_RESPOND;
@@ -2099,7 +2095,6 @@ static void ssltunnel_basic_auth(CuTest
         "WWW-Authenticate: Basic realm=""Test Suite""" CRLF
         "%s"
         CRLF
-        "1" CRLF CRLF
         "0" CRLF CRLF, server_resp_hdrs);
     action_list_server[1].kind = SERVER_RESPOND;
     action_list_server[1].text = CHUNKED_EMPTY_RESPONSE;
@@ -2244,7 +2239,6 @@ static void test_ssltunnel_digest_auth(C
             "nonce=\"ABCDEF1234567890\",opaque=\"myopaque\","
             "algorithm=\"MD5\",qop-options=\"auth\"" CRLF
             CRLF
-            "1" CRLF CRLF
             "0" CRLF CRLF},
         {SERVER_RESPOND, CHUNKED_EMPTY_RESPONSE},
         /* Forward the remainder of the data to the server without validation */



Mime
View raw message