Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.
This repository was archived by the owner on Jun 1, 2026. It is now read-only.

outside_tests hit servers with behavior that depends on country of origin #27

Closed

Description

Built from the latest revision (78f8554) in the master branch:

Starting test case outside_tests:outside_cnn_dot_com...
../tests/functional/http/client/outside_tests.cpp:56: error: Failure in outside_cnn_dot_com: CHECK_EQUAL(status_codes::OK, response.status_code()) where status_codes::OK=200 and response.status_code()=302
 FAILED
../tests/functional/http/client/outside_tests.cpp:61: error: Failure in outside_cnn_dot_com: CHECK_EQUAL(status_codes::OK, response.status_code()) where status_codes::OK=200 and response.status_code()=302
 FAILED
Test case outside_tests:outside_cnn_dot_com FAILED
Starting test case outside_tests:outside_google_dot_com...
../tests/functional/http/client/outside_tests.cpp:73: error: Failure in outside_google_dot_com: CHECK_EQUAL(status_codes::OK, response.status_code()) where status_codes::OK=200 and response.status_code()=302
 FAILED
../tests/functional/http/client/outside_tests.cpp:73: error: Failure in outside_google_dot_com: CHECK_EQUAL(status_codes::OK, response.status_code()) where status_codes::OK=200 and response.status_code()=302
 FAILED
Test case outside_tests:outside_google_dot_com FAILED
Starting test case outside_tests:multiple_https_requests...
../tests/functional/http/client/outside_tests.cpp:87: error: Failure in multiple_https_requests: CHECK_EQUAL(status_codes::OK, response.status_code()) where status_codes::OK=200 and response.status_code()=302
 FAILED
../tests/functional/http/client/outside_tests.cpp:87: error: Failure in multiple_https_requests: CHECK_EQUAL(status_codes::OK, response.status_code()) where status_codes::OK=200 and response.status_code()=302
 FAILED
../tests/functional/http/client/outside_tests.cpp:87: error: Failure in multiple_https_requests: CHECK_EQUAL(status_codes::OK, response.status_code()) where status_codes::OK=200 and response.status_code()=302
 FAILED
../tests/functional/http/client/outside_tests.cpp:87: error: Failure in multiple_https_requests: CHECK_EQUAL(status_codes::OK, response.status_code()) where status_codes::OK=200 and response.status_code()=302
 FAILED
../tests/functional/http/client/outside_tests.cpp:87: error: Failure in multiple_https_requests: CHECK_EQUAL(status_codes::OK, response.status_code()) where status_codes::OK=200 and response.status_code()=302
 FAILED
Test case outside_tests:multiple_https_requests FAILED
Starting test case outside_tests:reading_google_stream...
../tests/functional/http/client/outside_tests.cpp:107: error: Failure in reading_google_stream: CHECK_EQUAL(strcmp((const char *) chars, "<!doctype html><html itemscope=\"\" itemtype=\"http://schema.org/WebPage\""), 0) where strcmp((const char *) chars, "<!doctype html><html itemscope=\"\" itemtype=\"http://schema.org/WebPage\"")=1 and 0=0
 FAILED
Test case outside_tests:reading_google_stream FAILED

Any ideas?

Kind regards,
Alexander

Activity

  1. Alexander-Shukaev commented on Dec 1, 2015

    @Alexander-Shukaev
    Author

    I found the following patch in Ubuntu's casablanca package [1]:

    Description: Debian forbids calls to http websites.
     Tests trying to do web calls are disabled
     Currently there are only 4 tests that has been disabled:
     outside_cnn_dot_com, outside_google_dot_comm,
     reading_google_stream and outside_ssl_json.
    
    Author: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
    Origin: debian
    Forwarded: not-needed
    Reviewed-By: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
    Last-Update: 2014-09-27
    
    --- casablanca-2.2.0.orig/Release/tests/Functional/http/client/CMakeLists.txt
    +++ casablanca-2.2.0/Release/tests/Functional/http/client/CMakeLists.txt
    @@ -14,7 +14,6 @@ set(SOURCES
       multiple_requests.cpp
       oauth1_tests.cpp
       oauth2_tests.cpp
    -  outside_tests.cpp
       pipeline_stage_tests.cpp
       progress_handler_tests.cpp
       proxy_tests.cpp
    

    Could it be the same problem on Arch Linux?

  2. ras0219-msft commented on Dec 2, 2015

    @ras0219-msft
    Contributor

    Hmm, this might be the issue. It looks like https://en.wikipedia.org/wiki/HTTP_302 is Redirect, so are the tests possibly being run under some sort of proxy?

    What is your testing environment? Archlinux 64-bit on a desktop computer with internet?

  3. Alexander-Shukaev commented on Dec 2, 2015

    @Alexander-Shukaev
    Author

    Yes, Arch Linux 64-bit desktop with Internet connection. No, there is no proxy involved. At least, I'm not aware of the one as this is my personal box and I didn't install any proxy here.

  4. ras0219-msft commented on Dec 2, 2015

    @ras0219-msft
    Contributor

    Odd. At the very least, I don't think the core library functionality should be diminished.

    After running the tests again and ensuring they fail on your current internet connection, could you paste the results of
    $ curl -I http://www.cnn.com/
    here?

  5. Alexander-Shukaev commented on Dec 2, 2015

    @Alexander-Shukaev
    Author

    There you go:

    $ curl -I http://www.cnn.com/
    HTTP/1.1 302 Found
    Server: Varnish
    Retry-After: 0
    Content-Length: 0
    Location: http://edition.cnn.com/
    Accept-Ranges: bytes
    Date: Wed, 02 Dec 2015 19:15:29 GMT
    Via: 1.1 varnish
    Connection: close
    X-Served-By: cache-fra1242-FRA
    X-Cache: HIT
    X-Cache-Hits: 0
    
  6. ras0219-msft commented on Dec 3, 2015

    @ras0219-msft
    Contributor

    Aha, this looks like a US-centrism on our part. Apparently cnn.com redirects users from other countries to the "http://edition.cnn.com/" drop location, which is causing the problem.

    This means that 1) you can consider these tests passing ☺ and 2) these tests should probably be changed to hit the international home pages (which at least in the cnn case does not redirect even in the US).

    Thanks for reporting this issue; if you'd like to prepare a PR changing the tests please do.

  7. AnyCPU commented on Dec 22, 2015

    @AnyCPU
    Contributor

    On FreeBSD this fails too.

  8. changed the title [-]Four HTTP client tests fail on Arch Linux[/-] [+]outside_tests hit servers with behavior that depends on country of origin[/+] on Jan 19, 2016
  9. iamazeem commented on Sep 20, 2016

    @iamazeem

    I have the same issue on Mac OS X. Here's the list of failed tests:-

    **** outside_tests:outside_cnn_dot_com FAILED ****
    **** outside_tests:outside_google_dot_com FAILED ****
    **** outside_tests:multiple_https_requests FAILED ****
    **** outside_tests:reading_google_stream FAILED ****
    **** outside_tests:server_hostname_mismatch FAILED ****
    **** authentication_tests:sni_with_older_server_test FAILED ****
    **** authentication_tests:sni_explicit_hostname FAILED ****
    **** authentication_tests:hostname_mismatch FAILED ****
    

    Using curl shows the redirections. That means the tests have not been updated so far.
    Here are the curl results:-

    CNN:

    $ curl -I http://www.cnn.com/
    HTTP/1.1 302 Found
    Server: Varnish
    Retry-After: 0
    Content-Length: 0
    Location: http://edition.cnn.com/
    Accept-Ranges: bytes
    Date: Tue, 20 Sep 2016 04:51:02 GMT
    Via: 1.1 varnish
    Connection: close
    Set-Cookie: countryCode=PK; Domain=.cnn.com
    X-Served-By: cache-lhr6343-LHR
    X-Cache: HIT
    X-Cache-Hits: 0
    

    Google:

    $ curl -I http://www.google.com/
    HTTP/1.1 302 Found
    Location: http://www.google.com.pk/?gws_rd=cr&ei=o8DgV4T-LIPTU9f4rXA
    Cache-Control: private
    Content-Type: text/html; charset=UTF-8
    P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
    Date: Tue, 20 Sep 2016 04:52:51 GMT
    Server: gws
    Content-Length: 259
    X-XSS-Protection: 1; mode=block
    X-Frame-Options: SAMEORIGIN
    Set-Cookie: NID=86=jaM6fxcpSqTxvKBVYiSVli7BeIq9B6NCTA2pL0g6cIfekZdg3DIMzB_A_xNzQW6WsE9-Iq-tvNkmT9OUNwzge1KzeeDlNBD51NsgmFeJXImHHvDIwxx0eTlMdke1_iKo; expires=Wed, 22-Mar-2017 04:52:51 GMT; path=/; domain=.google.com; HttpOnly
    

    But, what about the other failures? Any thoughts?

  10. added a commit that references this issue on Jul 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions