Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.19.1: pytest based test suite is failing #192

Open
kloczek opened this issue May 6, 2021 · 15 comments
Open

0.19.1: pytest based test suite is failing #192

kloczek opened this issue May 6, 2021 · 15 comments

Comments

@kloczek
Copy link

kloczek commented May 6, 2021

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/python3 -Bm pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/tkloczko/rpmbuild/BUILD/httplib2-0.19.1/.hypothesis/examples')
rootdir: /home/tkloczko/rpmbuild/BUILD/httplib2-0.19.1, configfile: setup.cfg
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, asyncio-0.14.0, expect-1.1.0, cov-2.11.1, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, pyfakefs-4.4.0, freezegun-0.4.2, cases-3.4.6, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, flaky-3.7.0, mock-3.6.0, hypothesis-6.12.0
timeout: 17.0s
timeout method: signal
timeout func_only: False
collected 199 items

tests/test_auth.py::test_credentials PASSED                                                                                                                          [  0%]

[..]

tests/test_https.py::test_get_via_https FAILED                                                                                                                       [ 67%]
tests/test_https.py::test_get_301_via_https FAILED                                                                                                                   [ 68%]
tests/test_https.py::test_get_301_via_https_spec_violation_on_location FAILED                                                                                        [ 68%]
tests/test_https.py::test_invalid_ca_certs_path FAILED                                                                                                               [ 69%]
tests/test_https.py::test_not_trusted_ca FAILED                                                                                                                      [ 69%]
tests/test_https.py::test_set_tls_version[None-maximum_version] PASSED                                                                                               [ 70%]
tests/test_https.py::test_set_tls_version[None-minimum_version] PASSED                                                                                               [ 70%]
tests/test_https.py::test_set_tls_version[TLSv1_2-maximum_version] PASSED                                                                                            [ 71%]
tests/test_https.py::test_set_tls_version[TLSv1_2-minimum_version] PASSED                                                                                            [ 71%]
tests/test_https.py::test_set_tls_version[TLSVersion.TLSv1_2-maximum_version] PASSED                                                                                 [ 72%]
tests/test_https.py::test_set_tls_version[TLSVersion.TLSv1_2-minimum_version] PASSED                                                                                 [ 72%]
tests/test_https.py::test_min_tls_version FAILED                                                                                                                     [ 73%]
tests/test_https.py::test_max_tls_version FAILED                                                                                                                     [ 73%]
tests/test_https.py::test_client_cert_verified FAILED                                                                                                                [ 74%]
tests/test_https.py::test_client_cert_password_verified FAILED                                                                                                       [ 74%]
tests/test_https.py::test_sni_set_servername_callback FAILED                                                                                                         [ 75%]
tests/test_other.py::test_convert_byte_str PASSED                                                                                                                    [ 75%]
tests/test_other.py::test_reflect PASSED                                                                                                                             [ 76%]
tests/test_other.py::test_pickle_http PASSED                                                                                                                         [ 76%]
tests/test_other.py::test_pickle_http_with_connection PASSED                                                                                                         [ 77%]
tests/test_other.py::test_pickle_custom_request_http PASSED                                                                                                          [ 77%]
tests/test_other.py::test_timeout_global XPASS (FIXME: for unknown reason global timeout test fails in Python3 with response 200)                                    [ 78%]
tests/test_other.py::test_timeout_individual PASSED                                                                                                                  [ 78%]
tests/test_other.py::test_timeout_subsequent PASSED                                                                                                                  [ 79%]
tests/test_other.py::test_timeout_https PASSED                                                                                                                       [ 79%]
tests/test_other.py::test_connection_close PASSED                                                                                                                    [ 80%]
tests/test_other.py::test_get_end2end_headers PASSED                                                                                                                 [ 80%]
tests/test_other.py::test_ipv6[http] PASSED                                                                                                                          [ 81%]
tests/test_other.py::test_ipv6[https] PASSED                                                                                                                         [ 81%]
tests/test_other.py::test_connection_proxy_info_attribute_error[HTTPConnectionWithTimeout] PASSED                                                                    [ 82%]
tests/test_other.py::test_connection_proxy_info_attribute_error[HTTPSConnectionWithTimeout] PASSED                                                                   [ 82%]
tests/test_other.py::test_http_443_forced_https PASSED                                                                                                               [ 83%]
tests/test_other.py::test_close PASSED                                                                                                                               [ 83%]
tests/test_other.py::test_connect_exception_type PASSED                                                                                                              [ 84%]
tests/test_proxy.py::test_from_url PASSED                                                                                                                            [ 84%]
tests/test_proxy.py::test_from_url_ident PASSED                                                                                                                      [ 85%]
tests/test_proxy.py::test_from_env PASSED                                                                                                                            [ 85%]
tests/test_proxy.py::test_from_env_https PASSED                                                                                                                      [ 86%]
tests/test_proxy.py::test_from_env_none PASSED                                                                                                                       [ 86%]
tests/test_proxy.py::test_applies_to PASSED                                                                                                                          [ 87%]
tests/test_proxy.py::test_noproxy_trailing_comma PASSED                                                                                                              [ 87%]
tests/test_proxy.py::test_noproxy_star PASSED                                                                                                                        [ 88%]
tests/test_proxy.py::test_headers PASSED                                                                                                                             [ 88%]
tests/test_proxy.py::test_server_not_found_error_is_raised_for_invalid_hostname FAILED                                                                               [ 89%]
tests/test_proxy.py::test_auth_str_bytes PASSED                                                                                                                      [ 89%]
tests/test_proxy.py::test_socks5_auth FAILED                                                                                                                         [ 90%]
tests/test_proxy.py::test_functional_noproxy_star_http PASSED                                                                                                        [ 90%]
tests/test_proxy.py::test_functional_noproxy_star_https FAILED                                                                                                       [ 91%]
tests/test_uri.py::test_from_std66 PASSED                                                                                                                            [ 91%]
tests/test_uri.py::test_norm PASSED                                                                                                                                  [ 92%]
tests/test_uri.py::test_safename[('', ',d41d8cd98f00b204e9800998ecf8427e')] PASSED                                                                                   [ 92%]
tests/test_uri.py::test_safename[('http://example.org/fred/?a=b', 'example.orgfreda=b,58489f63a7a83c3b7794a6a398ee8b1f')] PASSED                                     [ 93%]
tests/test_uri.py::test_safename[('http://example.org/fred?/a=b', 'example.orgfreda=b,8c5946d56fec453071f43329ff0be46b')] PASSED                                     [ 93%]
tests/test_uri.py::test_safename[('http://www.example.org/fred?/a=b', 'www.example.orgfreda=b,499c44b8d844a011b67ea2c015116968')] PASSED                             [ 94%]
tests/test_uri.py::test_safename[('https://www.example.org/fred?/a=b', 'www.example.orgfreda=b,692e843a333484ce0095b070497ab45d')] PASSED                            [ 94%]
tests/test_uri.py::test_safename[('http://www/', 'www,1c73b6efd55cef1164fc084ecc331965')] PASSED                                                                     [ 95%]
tests/test_uri.py::test_safename[('http://\u2304.org/fred/?a=b', '.orgfreda=b,ecaf0f97756c0716de76f593bd60a35e')] PASSED                                             [ 95%]
tests/test_uri.py::test_safename[('normal-resource-name.js', 'normal-resource-name.js,8ff7c46fd6e61bf4e91a0a1606954a54')] PASSED                                     [ 96%]
tests/test_uri.py::test_safename[('foo://dom/path/brath/carapath', 'dompathbrathcarapath,83db942781ed975c7a5b7c24039f8ca3')] PASSED                                  [ 96%]
tests/test_uri.py::test_safename[('with/slash', 'withslash,17cc656656bb8ce2411bd41ead56d176')] PASSED                                                                [ 97%]
tests/test_uri.py::test_safename[('thisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuch', 'thisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuchthisistoomuc,c4553439dd179422c6acf6a8ac093eb6')] PASSED [ 97%]
tests/test_uri.py::test_safename[('\u043f\u0440', ',9f18c0db74a9734e9d18461e16345083')] PASSED                                                                       [ 98%]
tests/test_uri.py::test_safename[(b'\\xd0\\xbf\\xd1\\x80', ',9f18c0db74a9734e9d18461e16345083')] PASSED                                                              [ 98%]
tests/test_uri.py::test_safename[(b'column\\tvalues/unstr.zip', 'columnvaluesunstr.zip,b9740dcd0553e11b526450ceb8f76683')] PASSED                                    [ 99%]
tests/test_uri.py::test_safename2 PASSED                                                                                                                             [100%]

================================================================================= FAILURES =================================================================================
____________________________________________________________________________ test_get_via_https ____________________________________________________________________________
tests/test_https.py:12: in test_get_via_https
    with tests.server_const_http(tls=True) as uri:
        http       = <httplib2.Http object at 0x7f6c657bc250>
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f6c657bc460>
tests/__init__.py:345: in server_socket
    context.load_cert_chain(tls)
E   ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
        bind_hostname = 'localhost'
        context    = <ssl.SSLContext object at 0x7f6c66488ac0>
        fun        = <function server_request.<locals>.server_request_socket_handler at 0x7f6c66525040>
        gcounter   = [0]
        gresult    = [None]
        request_count = 1
        scheme     = ''
        server     = <socket.socket fd=14, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 33027)>
        server_port = 33027
        server_socket_thread = <function server_socket.<locals>.server_socket_thread at 0x7f6c66525af0>
        tick       = <function server_socket.<locals>.tick at 0x7f6c66525280>
        timeout    = 5
        tls        = '/home/tkloczko/rpmbuild/BUILD/httplib2-0.19.1/tests/tls/server_chain.pem'
        tls_skip_errors = ['TLSV1_ALERT_UNKNOWN_CA']
__________________________________________________________________________ test_get_301_via_https __________________________________________________________________________
tests/test_https.py:26: in test_get_301_via_https
    with tests.server_request(handler, request_count=2, tls=True) as uri:
        glocation  = ['']
        handler    = <function test_get_301_via_https.<locals>.handler at 0x7f6c664b2a60>
        http       = <httplib2.Http object at 0x7f6c66395250>
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f6c66395490>
tests/__init__.py:345: in server_socket
    context.load_cert_chain(tls)
E   ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
        bind_hostname = 'localhost'
        context    = <ssl.SSLContext object at 0x7f6c656f5d40>
        fun        = <function server_request.<locals>.server_request_socket_handler at 0x7f6c664b2dc0>
        gcounter   = [0]
        gresult    = [None]
        request_count = 2
        scheme     = ''
        server     = <socket.socket fd=16, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 45237)>
        server_port = 45237
        server_socket_thread = <function server_socket.<locals>.server_socket_thread at 0x7f6c664b2ee0>
        tick       = <function server_socket.<locals>.tick at 0x7f6c664b2e50>
        timeout    = 5
        tls        = '/home/tkloczko/rpmbuild/BUILD/httplib2-0.19.1/tests/tls/server_chain.pem'
        tls_skip_errors = ['TLSV1_ALERT_UNKNOWN_CA']
____________________________________________________________ test_get_301_via_https_spec_violation_on_location _____________________________________________________________
tests/test_https.py:46: in test_get_301_via_https_spec_violation_on_location
    with tests.server_request(handler, request_count=2, tls=True) as uri:
        handler    = <function test_get_301_via_https_spec_violation_on_location.<locals>.handler at 0x7f6c664b2b80>
        http       = <httplib2.Http object at 0x7f6c66111640>
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f6c661110d0>
tests/__init__.py:345: in server_socket
    context.load_cert_chain(tls)
E   ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
        bind_hostname = 'localhost'
        context    = <ssl.SSLContext object at 0x7f6c664a6ac0>
        fun        = <function server_request.<locals>.server_request_socket_handler at 0x7f6c664a5430>
        gcounter   = [0]
        gresult    = [None]
        request_count = 2
        scheme     = ''
        server     = <socket.socket fd=17, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 58795)>
        server_port = 58795
        server_socket_thread = <function server_socket.<locals>.server_socket_thread at 0x7f6c664a5550>
        tick       = <function server_socket.<locals>.tick at 0x7f6c664a54c0>
        timeout    = 5
        tls        = '/home/tkloczko/rpmbuild/BUILD/httplib2-0.19.1/tests/tls/server_chain.pem'
        tls_skip_errors = ['TLSV1_ALERT_UNKNOWN_CA']
________________________________________________________________________ test_invalid_ca_certs_path ________________________________________________________________________
tests/test_https.py:55: in test_invalid_ca_certs_path
    with tests.server_const_http(request_count=0, tls=True) as uri:
        http       = <httplib2.Http object at 0x7f6c6622e610>
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f6c6622e6a0>
tests/__init__.py:345: in server_socket
    context.load_cert_chain(tls)
E   ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
        bind_hostname = 'localhost'
        context    = <ssl.SSLContext object at 0x7f6c664a6b40>
        fun        = <function server_request.<locals>.server_request_socket_handler at 0x7f6c664a5670>
        gcounter   = [0]
        gresult    = [None]
        request_count = 0
        scheme     = ''
        server     = <socket.socket fd=18, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 55175)>
        server_port = 55175
        server_socket_thread = <function server_socket.<locals>.server_socket_thread at 0x7f6c664a59d0>
        tick       = <function server_socket.<locals>.tick at 0x7f6c664a5940>
        timeout    = 5
        tls        = '/home/tkloczko/rpmbuild/BUILD/httplib2-0.19.1/tests/tls/server_chain.pem'
        tls_skip_errors = ['TLSV1_ALERT_UNKNOWN_CA']
___________________________________________________________________________ test_not_trusted_ca ____________________________________________________________________________
tests/test_https.py:64: in test_not_trusted_ca
    with tests.server_const_http(tls=True) as uri:
        http       = <httplib2.Http object at 0x7f6c664e1040>
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f6c6647c2e0>
tests/__init__.py:345: in server_socket
    context.load_cert_chain(tls)
E   ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
        bind_hostname = 'localhost'
        context    = <ssl.SSLContext object at 0x7f6c6611f840>
        fun        = <function server_request.<locals>.server_request_socket_handler at 0x7f6c664a5e50>
        gcounter   = [0]
        gresult    = [None]
        request_count = 1
        scheme     = ''
        server     = <socket.socket fd=19, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 59375)>
        server_port = 59375
        server_socket_thread = <function server_socket.<locals>.server_socket_thread at 0x7f6c664a5f70>
        tick       = <function server_socket.<locals>.tick at 0x7f6c664a5ee0>
        timeout    = 5
        tls        = '/home/tkloczko/rpmbuild/BUILD/httplib2-0.19.1/tests/tls/server_chain.pem'
        tls_skip_errors = ['TLSV1_ALERT_UNKNOWN_CA']
___________________________________________________________________________ test_min_tls_version ___________________________________________________________________________
tests/test_https.py:107: in test_min_tls_version
    with tests.server_const_http(tls=setup_tls) as uri:
        http       = <httplib2.Http object at 0x7f6c6620ce20>
        setup_tls  = <function test_min_tls_version.<locals>.setup_tls at 0x7f6c664a5b80>
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f6c6620cd00>
tests/__init__.py:342: in server_socket
    context.load_cert_chain(SERVER_CHAIN)
E   ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
        bind_hostname = 'localhost'
        context    = <ssl.SSLContext object at 0x7f6c6649e840>
        fun        = <function server_request.<locals>.server_request_socket_handler at 0x7f6c665179d0>
        gcounter   = [0]
        gresult    = [None]
        request_count = 1
        scheme     = ''
        server     = <socket.socket fd=21, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 48109)>
        server_port = 48109
        server_socket_thread = <function server_socket.<locals>.server_socket_thread at 0x7f6c66517a60>
        tick       = <function server_socket.<locals>.tick at 0x7f6c66517790>
        timeout    = 5
        tls        = <function test_min_tls_version.<locals>.setup_tls at 0x7f6c664a5b80>
        tls_skip_errors = ['TLSV1_ALERT_UNKNOWN_CA']
___________________________________________________________________________ test_max_tls_version ___________________________________________________________________________
tests/test_https.py:121: in test_max_tls_version
    with tests.server_const_http(tls=True) as uri:
        http       = <httplib2.Http object at 0x7f6c6622ed90>
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f6c6622e580>
tests/__init__.py:345: in server_socket
    context.load_cert_chain(tls)
E   ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
        bind_hostname = 'localhost'
        context    = <ssl.SSLContext object at 0x7f6c6649eb40>
        fun        = <function server_request.<locals>.server_request_socket_handler at 0x7f6c66517280>
        gcounter   = [0]
        gresult    = [None]
        request_count = 1
        scheme     = ''
        server     = <socket.socket fd=20, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 45199)>
        server_port = 45199
        server_socket_thread = <function server_socket.<locals>.server_socket_thread at 0x7f6c66517af0>
        tick       = <function server_socket.<locals>.tick at 0x7f6c66517820>
        timeout    = 5
        tls        = '/home/tkloczko/rpmbuild/BUILD/httplib2-0.19.1/tests/tls/server_chain.pem'
        tls_skip_errors = ['TLSV1_ALERT_UNKNOWN_CA']
________________________________________________________________________ test_client_cert_verified _________________________________________________________________________
tests/test_https.py:140: in test_client_cert_verified
    with tests.server_request(handler, tls=setup_tls) as uri:
        cert_log   = []
        handler    = <function test_client_cert_verified.<locals>.handler at 0x7f6c661290d0>
        http       = <httplib2.Http object at 0x7f6c654e7b80>
        setup_tls  = <function test_client_cert_verified.<locals>.setup_tls at 0x7f6c66517d30>
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f6c654e7760>
tests/__init__.py:342: in server_socket
    context.load_cert_chain(SERVER_CHAIN)
E   ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
        bind_hostname = 'localhost'
        context    = <ssl.SSLContext object at 0x7f6c6649ee40>
        fun        = <function server_request.<locals>.server_request_socket_handler at 0x7f6c66129160>
        gcounter   = [0]
        gresult    = [None]
        request_count = 1
        scheme     = ''
        server     = <socket.socket fd=22, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47721)>
        server_port = 47721
        server_socket_thread = <function server_socket.<locals>.server_socket_thread at 0x7f6c66129280>
        tick       = <function server_socket.<locals>.tick at 0x7f6c661291f0>
        timeout    = 5
        tls        = <function test_client_cert_verified.<locals>.setup_tls at 0x7f6c66517d30>
        tls_skip_errors = ['TLSV1_ALERT_UNKNOWN_CA']
____________________________________________________________________ test_client_cert_password_verified ____________________________________________________________________
tests/test_https.py:163: in test_client_cert_password_verified
    with tests.server_request(handler, tls=setup_tls) as uri:
        cert_log   = []
        handler    = <function test_client_cert_password_verified.<locals>.handler at 0x7f6c66129790>
        http       = <httplib2.Http object at 0x7f6c654dec40>
        setup_tls  = <function test_client_cert_password_verified.<locals>.setup_tls at 0x7f6c66129310>
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f6c654de760>
tests/__init__.py:342: in server_socket
    context.load_cert_chain(SERVER_CHAIN)
E   ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
        bind_hostname = 'localhost'
        context    = <ssl.SSLContext object at 0x7f6c661217c0>
        fun        = <function server_request.<locals>.server_request_socket_handler at 0x7f6c66129820>
        gcounter   = [0]
        gresult    = [None]
        request_count = 1
        scheme     = ''
        server     = <socket.socket fd=23, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 38969)>
        server_port = 38969
        server_socket_thread = <function server_socket.<locals>.server_socket_thread at 0x7f6c66129940>
        tick       = <function server_socket.<locals>.tick at 0x7f6c661298b0>
        timeout    = 5
        tls        = <function test_client_cert_password_verified.<locals>.setup_tls at 0x7f6c66129310>
        tls_skip_errors = ['TLSV1_ALERT_UNKNOWN_CA']
_____________________________________________________________________ test_sni_set_servername_callback _____________________________________________________________________
tests/test_https.py:186: in test_sni_set_servername_callback
    with tests.server_const_http(tls=setup_tls) as uri:
        http       = <httplib2.Http object at 0x7f6c6655cca0>
        setup_tls  = <function test_sni_set_servername_callback.<locals>.setup_tls at 0x7f6c661299d0>
        sni_log    = []
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f6c6655ce80>
tests/__init__.py:342: in server_socket
    context.load_cert_chain(SERVER_CHAIN)
E   ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
        bind_hostname = 'localhost'
        context    = <ssl.SSLContext object at 0x7f6c661216c0>
        fun        = <function server_request.<locals>.server_request_socket_handler at 0x7f6c66129ee0>
        gcounter   = [0]
        gresult    = [None]
        request_count = 1
        scheme     = ''
        server     = <socket.socket fd=24, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 45185)>
        server_port = 45185
        server_socket_thread = <function server_socket.<locals>.server_socket_thread at 0x7f6c66136040>
        tick       = <function server_socket.<locals>.tick at 0x7f6c66129f70>
        timeout    = 5
        tls        = <function test_sni_set_servername_callback.<locals>.setup_tls at 0x7f6c661299d0>
        tls_skip_errors = ['TLSV1_ALERT_UNKNOWN_CA']
________________________________________________________ test_server_not_found_error_is_raised_for_invalid_hostname ________________________________________________________
/usr/lib/python3.8/site-packages/socks.py:787: in connect
    super(socksocket, self).connect(proxy_addr)
        __class__  = <class 'socks.socksocket'>
        catch_errors = None
        dest_addr  = 'invalid.hostname.foo.bar'
        dest_pair  = ('invalid.hostname.foo.bar', 80)
        dest_port  = 80
        msg        = 'Error connecting to HTTP proxy 255.255.255.255:8001'
        password   = None
        printable_type = 'HTTP'
        proxy_addr = '255.255.255.255'
        proxy_port = 8001
        proxy_server = '255.255.255.255:8001'
        proxy_type = 3
        rdns       = True
        self       = <socks.socksocket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
        username   = None
/usr/lib64/python3.8/unittest/mock.py:1081: in __call__
    return self._mock_call(*args, **kwargs)
        args       = (('255.255.255.255', 8001),)
        kwargs     = {}
        self       = <MagicMock name='connect' spec='method_descriptor' id='140110397439520'>
/usr/lib64/python3.8/unittest/mock.py:1085: in _mock_call
    return self._execute_mock_call(*args, **kwargs)
        args       = (('255.255.255.255', 8001),)
        kwargs     = {}
        self       = <MagicMock name='connect' spec='method_descriptor' id='140110397439520'>
/usr/lib64/python3.8/unittest/mock.py:1146: in _execute_mock_call
    result = effect(*args, **kwargs)
        args       = (('255.255.255.255', 8001),)
        effect     = <function _raise_name_not_known_error at 0x7f6c66356ee0>
        kwargs     = {}
        self       = <MagicMock name='connect' spec='method_descriptor' id='140110397439520'>
tests/test_proxy.py:24: in _raise_name_not_known_error
    raise socket.gaierror(socket.EAI_NONAME, "Name or service not known")
E   socket.gaierror: [Errno -2] Name or service not known
        args       = (('255.255.255.255', 8001),)
        kwargs     = {}

During handling of the above exception, another exception occurred:
../../BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py:1349: in _conn_request
    conn.connect()
        body       = None
        conn       = <httplib2.HTTPConnectionWithTimeout object at 0x7f6c6642b790>
        headers    = {'accept-encoding': 'gzip, deflate', 'user-agent': 'Python-httplib2/0.19.1 (gzip)'}
        i          = 1
        method     = 'GET'
        request_uri = '/'
        seen_bad_status_line = False
        self       = <httplib2.Http object at 0x7f6c654e7df0>
../../BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py:1049: in connect
    raise socket_err
        af         = <AddressFamily.AF_INET: 2>
        canonname  = ''
        host       = '255.255.255.255'
        port       = 8001
        proto      = 6
        proxy_headers = None
        proxy_host = '255.255.255.255'
        proxy_pass = None
        proxy_port = 8001
        proxy_rdns = True
        proxy_type = 3
        proxy_user = None
        res        = (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('255.255.255.255', 8001))
        sa         = ('255.255.255.255', 8001)
        self       = <httplib2.HTTPConnectionWithTimeout object at 0x7f6c6642b790>
        socket_err = ProxyConnectionError()
        socktype   = <SocketKind.SOCK_STREAM: 1>
        use_proxy  = True
../../BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py:1032: in connect
    self.sock.connect((self.host, self.port) + sa[2:])
        af         = <AddressFamily.AF_INET: 2>
        canonname  = ''
        host       = '255.255.255.255'
        port       = 8001
        proto      = 6
        proxy_headers = None
        proxy_host = '255.255.255.255'
        proxy_pass = None
        proxy_port = 8001
        proxy_rdns = True
        proxy_type = 3
        proxy_user = None
        res        = (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('255.255.255.255', 8001))
        sa         = ('255.255.255.255', 8001)
        self       = <httplib2.HTTPConnectionWithTimeout object at 0x7f6c6642b790>
        socket_err = ProxyConnectionError()
        socktype   = <SocketKind.SOCK_STREAM: 1>
        use_proxy  = True
/usr/lib/python3.8/site-packages/socks.py:47: in wrapper
    return function(*args, **kwargs)
        _is_blocking = None
        args       = (<socks.socksocket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, ('invalid.hostname.foo.bar', 80))
        function   = <function socksocket.connect at 0x7f6dfc1b4e50>
        kwargs     = {}
        self       = <socks.socksocket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
/usr/lib/python3.8/site-packages/socks.py:800: in connect
    raise ProxyConnectionError(msg, error)
E   socks.ProxyConnectionError: Error connecting to HTTP proxy 255.255.255.255:8001: [Errno -2] Name or service not known
        __class__  = <class 'socks.socksocket'>
        catch_errors = None
        dest_addr  = 'invalid.hostname.foo.bar'
        dest_pair  = ('invalid.hostname.foo.bar', 80)
        dest_port  = 80
        msg        = 'Error connecting to HTTP proxy 255.255.255.255:8001'
        password   = None
        printable_type = 'HTTP'
        proxy_addr = '255.255.255.255'
        proxy_port = 8001
        proxy_server = '255.255.255.255:8001'
        proxy_type = 3
        rdns       = True
        self       = <socks.socksocket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
        username   = None

During handling of the above exception, another exception occurred:
tests/test_proxy.py:119: in test_server_not_found_error_is_raised_for_invalid_hostname
    http.request("http://invalid.hostname.foo.bar/", "GET")
        http       = <httplib2.Http object at 0x7f6c654e7df0>
        mock_socket_connect = <MagicMock name='connect' spec='method_descriptor' id='140110397439520'>
../../BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py:1711: in request
    (response, content) = self._request(
        authority  = 'invalid.hostname.foo.bar'
        body       = None
        cached_value = None
        cachekey   = None
        cc         = {}
        certs      = []
        conn       = <httplib2.HTTPConnectionWithTimeout object at 0x7f6c6642b790>
        conn_key   = 'http:invalid.hostname.foo.bar'
        connection_type = <class 'httplib2.HTTPConnectionWithTimeout'>
        defrag_uri = 'http://invalid.hostname.foo.bar/'
        headers    = {'accept-encoding': 'gzip, deflate', 'user-agent': 'Python-httplib2/0.19.1 (gzip)'}
        info       = <email.message.Message object at 0x7f6c6642b0d0>
        is_timeout = False
        method     = 'GET'
        redirections = 5
        request_uri = '/'
        scheme     = 'http'
        self       = <httplib2.Http object at 0x7f6c654e7df0>
        uri        = 'http://invalid.hostname.foo.bar/'
../../BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py:1427: in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
        absolute_uri = 'http://invalid.hostname.foo.bar/'
        auth       = None
        auths      = []
        body       = None
        cachekey   = None
        conn       = <httplib2.HTTPConnectionWithTimeout object at 0x7f6c6642b790>
        headers    = {'accept-encoding': 'gzip, deflate', 'user-agent': 'Python-httplib2/0.19.1 (gzip)'}
        host       = 'invalid.hostname.foo.bar'
        method     = 'GET'
        redirections = 5
        request_uri = '/'
        self       = <httplib2.Http object at 0x7f6c654e7df0>
../../BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py:1358: in _conn_request
    errno_ = e.args[0].errno if isinstance(e.args[0], socket.error) else e.errno
E   IndexError: tuple index out of range
        body       = None
        conn       = <httplib2.HTTPConnectionWithTimeout object at 0x7f6c6642b790>
        headers    = {'accept-encoding': 'gzip, deflate', 'user-agent': 'Python-httplib2/0.19.1 (gzip)'}
        i          = 1
        method     = 'GET'
        request_uri = '/'
        seen_bad_status_line = False
        self       = <httplib2.Http object at 0x7f6c654e7df0>
_____________________________________________________________________________ test_socks5_auth _____________________________________________________________________________
tests/test_proxy.py:177: in test_socks5_auth
    with tests.assert_raises(httplib2.socks.Socks5AuthError):
E   AttributeError: module 'socks' has no attribute 'Socks5AuthError'
        http       = <httplib2.Http object at 0x7f6c6569a100>
        proxy_conn = <function test_socks5_auth.<locals>.proxy_conn at 0x7f6c66136310>
        proxy_info = <ProxyInfo type=2 host:port=localhost:38257 rdns=True user=user_str headers=None>
        uri        = 'http://localhost:38257/'
        uri_parsed = ParseResult(scheme='http', netloc='localhost:38257', path='/', params='', query='', fragment='')
____________________________________________________________________ test_functional_noproxy_star_https ____________________________________________________________________
tests/test_proxy.py:205: in test_functional_noproxy_star_https
    with tests.server_request(handler, tls=True) as uri:
        handler    = <function test_functional_noproxy_star_https.<locals>.handler at 0x7f6c656bc670>
        monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6c654f1520>
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f6c654f1b80>
tests/__init__.py:345: in server_socket
    context.load_cert_chain(tls)
E   ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
        bind_hostname = 'localhost'
        context    = <ssl.SSLContext object at 0x7f6c656da9c0>
        fun        = <function server_request.<locals>.server_request_socket_handler at 0x7f6c656bcc10>
        gcounter   = [0]
        gresult    = [None]
        request_count = 1
        scheme     = ''
        server     = <socket.socket fd=26, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 54959)>
        server_port = 54959
        server_socket_thread = <function server_socket.<locals>.server_socket_thread at 0x7f6c656bcd30>
        tick       = <function server_socket.<locals>.tick at 0x7f6c656bcca0>
        timeout    = 5
        tls        = '/home/tkloczko/rpmbuild/BUILD/httplib2-0.19.1/tests/tls/server_chain.pem'
        tls_skip_errors = ['TLSV1_ALERT_UNKNOWN_CA']
============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1183
  /usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1183: PytestDeprecationWarning: The --strict option is deprecated, use --strict-markers instead.
    self.issue_config_time_warning(

-- Docs: https://docs.pytest.org/en/stable/warnings.html

----------- coverage: platform linux, python 3.8.9-final-0 -----------
Name                                                                                                                          Stmts   Miss  Cover
-------------------------------------------------------------------------------------------------------------------------------------------------
/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py     916    163    82%
/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/auth.py          36      3    92%
/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/certs.py         30      4    87%
/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/error.py         25      0   100%
/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/iri2uri.py       41     15    63%
/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.19.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/socks.py        244    244     0%
-------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                                          1292    429    67%

========================================================================= short test summary info ==========================================================================
SKIPPED [4] tests/test_auth.py:249: benchmark disabled by default, set env httplib2_test_bench=1
SKIPPED [1] tests/test_cache.py:48: was commented in legacy code
SKIPPED [1] tests/test_http.py:253: FIXME: timeout on Travis py27 and pypy, works elsewhere
SKIPPED [1] tests/test_http.py:404: FIXME: timeout on Travis py27 and pypy, works elsewhere
SKIPPED [1] tests/test_http.py:557: was commented in legacy code
XFAIL tests/test_http.py::test_get_301_no_redirect
  FIXME: 301 cache works only with follow_redirects, should work regardless
XPASS tests/test_other.py::test_timeout_global FIXME: for unknown reason global timeout test fails in Python3 with response 200
FAILED tests/test_https.py::test_get_via_https - ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
FAILED tests/test_https.py::test_get_301_via_https - ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
FAILED tests/test_https.py::test_get_301_via_https_spec_violation_on_location - ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
FAILED tests/test_https.py::test_invalid_ca_certs_path - ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
FAILED tests/test_https.py::test_not_trusted_ca - ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
FAILED tests/test_https.py::test_min_tls_version - ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
FAILED tests/test_https.py::test_max_tls_version - ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
FAILED tests/test_https.py::test_client_cert_verified - ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
FAILED tests/test_https.py::test_client_cert_password_verified - ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
FAILED tests/test_https.py::test_sni_set_servername_callback - ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
FAILED tests/test_proxy.py::test_server_not_found_error_is_raised_for_invalid_hostname - IndexError: tuple index out of range
FAILED tests/test_proxy.py::test_socks5_auth - AttributeError: module 'socks' has no attribute 'Socks5AuthError'
FAILED tests/test_proxy.py::test_functional_noproxy_star_https - ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4029)
=============================================== 13 failed, 176 passed, 8 skipped, 1 xfailed, 1 xpassed, 1 warning in 12.07s ================================================
@temoto
Copy link
Member

temoto commented May 6, 2021

I'd like to learn how to reproduce this build.

There is script/test to run tests. It creates virtualenv by default or uses python/pip from PATH if CONTINUOUS_INTEGRATION env is set. Please try that.

This CA_MD_TOO_WEAK error is definitely OS dependant, maybe generating new certs would help. But there are two other failures.

Please post

cat /etc/os-release

script/generate-tls && CONTINUOUS_INTEGRATION=1 script/test

@kloczek
Copy link
Author

kloczek commented May 6, 2021

I'm using my own duistribution but it is relativelly close to fedora rawhide.😊

I'd like to learn how to reproduce this build.

As I'm packaging now all python modules for my distro I'm trying to add to every possible package execute something in %check section. On most of the python modules pytest is able to scan and generate some test units. In most of the cases fails or warnings may point on something which can be corrected/fixed.
So please do not take pytest results as 100% accurate if you have own testing methodology😊

If pytest is woirking and if developer want to habve some isolation from some system installed pytest extensions/plugins which may show some false results the bezs metjot of such isolation is use tox.

script/generate-tls && CONTINUOUS_INTEGRATION=1 script/test

Looks like that may be missing step on test suite execution
Will try that and beck with results soon.

Thx.

@temoto
Copy link
Member

temoto commented May 6, 2021

generate-tls wasn't meant to be run on every test execution, but it may help to find root of problem with CA_MD_TOO_WEAK

@kloczek
Copy link
Author

kloczek commented May 6, 2021

generate certs did not helped ..

@kloczek
Copy link
Author

kloczek commented May 13, 2021

Do you want PR for below patch?

Fixes pytest warning

../../../../../usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1183
  /usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1183: PytestDeprecationWarning: The --strict option is deprecated, use --strict-markers instead.
    self.issue_config_time_warning(

https://github.com/pytest-dev/pytest/issues/8668

--- a/setup.cfg~        2021-03-30 17:03:13.000000000 +0100
+++ b/setup.cfg 2021-05-13 19:44:03.540814830 +0100
@@ -20,7 +20,7 @@
   --cov=httplib2
   --noconftest
   --showlocals
-  --strict
+  --strict-markers
   --tb=short
   --timeout=17
   --verbose

@temoto
Copy link
Member

temoto commented May 13, 2021 via email

@kloczek
Copy link
Author

kloczek commented May 13, 2021

Done :)
#194

@mgorny
Copy link
Contributor

mgorny commented Oct 11, 2021

FTR, recerting fixed CA_MD_TOO_WEAK in my case. Note that I had to copy the created files to tests/tls directory.

After recerting, I get the following test failures:

FAILED tests/test_https.py::test_min_tls_version - AssertionError: assert 'SSLV3_ALERT_HANDSHAKE_FAILURE' in ('UNSUPPORTED_PROTOCOL'...
FAILED tests/test_https.py::test_max_tls_version - ssl.SSLError: [SSL: NO_PROTOCOLS_AVAILABLE] no protocols available (_ssl.c:1001)
FAILED tests/test_https.py::test_client_cert_verified - AssertionError: assert '6675DC31B24D...3EAD79BE3BBC1' == 'E2AA6A96D1BF1AEC'
FAILED tests/test_https.py::test_client_cert_password_verified - AssertionError: assert '6675DC31B24D...3EAD79BE3BBC2' == 'E2AA6A96D...
FAILED tests/test_proxy.py::test_server_not_found_error_is_raised_for_invalid_hostname - socks.ProxyConnectionError: Error connectin...
FAILED tests/test_proxy.py::test_socks5_auth - AttributeError: module 'socks' has no attribute 'Socks5AuthError'

The two last are #170, I think. The middle two probably indicate that fingerprint needs to be updated somewhere after recerting. However, the first two look valid problems (incompatibility with OpenSSL 1.1.1l?)

@kloczek
Copy link
Author

kloczek commented Oct 11, 2021

I'm using openssl 3.0.0.

@mgorny
Copy link
Contributor

mgorny commented Nov 18, 2021

Ping.

@mgorny
Copy link
Contributor

mgorny commented Nov 18, 2021

Also, I've just noticed that the tests fail with CPython but not with PyPy3, so it probably has something to do with CPython switching to more secure TLS defaults.

mgorny added a commit to mgorny/httplib2 that referenced this issue Nov 18, 2021
Newer Python versions have stronger TLS defaults, and therefore reject
the certificates currently used by the test suite.  Regenerate them
to fix most of the test failures.

This also requires bumping the protocol versions used to test min/max
version attributes, as Python no longer allows TLS<1.2.

Unfortunately, test_min_tls_version still fails and I wasn't able to
figure out a way to fix it.

Issue httplib2#192
temoto pushed a commit to mgorny/httplib2 that referenced this issue Nov 18, 2021
temoto pushed a commit to mgorny/httplib2 that referenced this issue Nov 18, 2021
@temoto
Copy link
Member

temoto commented Nov 18, 2021

@kloczek please check out new master, requirements-test updated pytest and strict-markers is used.

@kloczek
Copy link
Author

kloczek commented Dec 14, 2021

Just tested 0.20.3 and things looks better because only three units seems are failing now :P

+ PYTHONPATH=/data/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/data/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -q
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=2128044070
rootdir: /data/home/tkloczko/rpmbuild/BUILD/httplib2-0.20.3, configfile: setup.cfg
plugins: shutil-1.7.0, virtualenv-1.7.0, mock-3.6.1, cov-2.12.1, anyio-3.3.4, flaky-3.7.0, tornasync-0.6.0.post2, console-scripts-1.2.0, trio-0.7.0, timeout-2.0.1, asyncio-0.16.0, freezegun-0.4.2, flake8-1.0.7, pyfakefs-4.5.3, benchmark-3.4.1, profiling-1.7.0, datadir-1.3.1, regressions-2.2.0, randomly-3.8.0, rerunfailures-9.1.1, yagot-0.5.0, requests-mock-1.9.3, subtests-0.5.0, easy-server-0.8.0, django-4.5.2, forked-1.4.0, ordering-0.6, xdist-2.5.0, hypothesis-6.31.4
timeout: 17.0s
timeout method: signal
timeout func_only: False
collected 491 items

tests/test_cacerts_from_env.py .....                                                                                                                                 [  1%]
tests/test_proxy.py ..F..........F...                                                                                                                                [  4%]
tests/test_cache.py ...................................s..                                                                                                           [ 12%]
tests/test_test_helpers.py ......................................................................................................................................... [ 40%]
.......................................................................................................................................................              [ 70%]
tests/test_https.py .......F.........                                                                                                                                [ 74%]
tests/test_uri.py .................                                                                                                                                  [ 77%]
tests/test_other.py ......X...........                                                                                                                               [ 81%]
tests/test_auth.py ............s...ss.....................s..........                                                                                                [ 91%]
tests/test_http.py ...s....s....................s....x                                                                                                               [ 98%]
tests/test_encoding.py ......                                                                                                                                        [100%]

================================================================================= FAILURES =================================================================================
________________________________________________________ test_server_not_found_error_is_raised_for_invalid_hostname ________________________________________________________
/usr/lib/python3.8/site-packages/socks.py:787: in connect
    super(socksocket, self).connect(proxy_addr)
        __class__  = <class 'socks.socksocket'>
        catch_errors = None
        dest_addr  = 'invalid.hostname.foo.bar'
        dest_pair  = ('invalid.hostname.foo.bar', 80)
        dest_port  = 80
        msg        = 'Error connecting to HTTP proxy 255.255.255.255:8001'
        password   = None
        printable_type = 'HTTP'
        proxy_addr = '255.255.255.255'
        proxy_port = 8001
        proxy_server = '255.255.255.255:8001'
        proxy_type = 3
        rdns       = True
        self       = <socks.socksocket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
        username   = None
/usr/lib64/python3.8/unittest/mock.py:1081: in __call__
    return self._mock_call(*args, **kwargs)
        args       = (('255.255.255.255', 8001),)
        kwargs     = {}
        self       = <MagicMock name='connect' spec='method_descriptor' id='140190693781360'>
/usr/lib64/python3.8/unittest/mock.py:1085: in _mock_call
    return self._execute_mock_call(*args, **kwargs)
        args       = (('255.255.255.255', 8001),)
        kwargs     = {}
        self       = <MagicMock name='connect' spec='method_descriptor' id='140190693781360'>
/usr/lib64/python3.8/unittest/mock.py:1146: in _execute_mock_call
    result = effect(*args, **kwargs)
        args       = (('255.255.255.255', 8001),)
        effect     = <function _raise_name_not_known_error at 0x7f80b0de3280>
        kwargs     = {}
        self       = <MagicMock name='connect' spec='method_descriptor' id='140190693781360'>
tests/test_proxy.py:24: in _raise_name_not_known_error
    raise socket.gaierror(socket.EAI_NONAME, "Name or service not known")
E   socket.gaierror: [Errno -2] Name or service not known
        args       = (('255.255.255.255', 8001),)
        kwargs     = {}

During handling of the above exception, another exception occurred:
tests/test_proxy.py:140: in test_server_not_found_error_is_raised_for_invalid_hostname
    http.request("http://invalid.hostname.foo.bar/", "GET")
        http       = <httplib2.Http object at 0x7f811717c3a0>
        mock_socket_connect = <MagicMock name='connect' spec='method_descriptor' id='140190693781360'>
../../BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py:1721: in request
    (response, content) = self._request(
        authority  = 'invalid.hostname.foo.bar'
        body       = None
        cached_value = None
        cachekey   = None
        cc         = {}
        certs      = []
        conn       = <httplib2.HTTPConnectionWithTimeout object at 0x7f811717cf70>
        conn_key   = 'http:invalid.hostname.foo.bar'
        connection_type = <class 'httplib2.HTTPConnectionWithTimeout'>
        defrag_uri = 'http://invalid.hostname.foo.bar/'
        headers    = {'accept-encoding': 'gzip, deflate', 'user-agent': 'Python-httplib2/0.20.3 (gzip)'}
        info       = <email.message.Message object at 0x7f811717cee0>
        is_timeout = False
        method     = 'GET'
        redirections = 5
        request_uri = '/'
        scheme     = 'http'
        self       = <httplib2.Http object at 0x7f811717c3a0>
        uri        = 'http://invalid.hostname.foo.bar/'
../../BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py:1441: in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
        absolute_uri = 'http://invalid.hostname.foo.bar/'
        auth       = None
        auths      = []
        body       = None
        cachekey   = None
        conn       = <httplib2.HTTPConnectionWithTimeout object at 0x7f811717cf70>
        headers    = {'accept-encoding': 'gzip, deflate', 'user-agent': 'Python-httplib2/0.20.3 (gzip)'}
        host       = 'invalid.hostname.foo.bar'
        method     = 'GET'
        redirections = 5
        request_uri = '/'
        self       = <httplib2.Http object at 0x7f811717c3a0>
../../BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py:1363: in _conn_request
    conn.connect()
        body       = None
        conn       = <httplib2.HTTPConnectionWithTimeout object at 0x7f811717cf70>
        errno_     = -2
        headers    = {'accept-encoding': 'gzip, deflate', 'user-agent': 'Python-httplib2/0.20.3 (gzip)'}
        i          = 1
        method     = 'GET'
        request_uri = '/'
        seen_bad_status_line = False
        self       = <httplib2.Http object at 0x7f811717c3a0>
../../BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py:1063: in connect
    raise socket_err
        af         = <AddressFamily.AF_INET: 2>
        canonname  = ''
        host       = '255.255.255.255'
        port       = 8001
        proto      = 6
        proxy_headers = None
        proxy_host = '255.255.255.255'
        proxy_pass = None
        proxy_port = 8001
        proxy_rdns = True
        proxy_type = 3
        proxy_user = None
        res        = (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('255.255.255.255', 8001))
        sa         = ('255.255.255.255', 8001)
        self       = <httplib2.HTTPConnectionWithTimeout object at 0x7f811717cf70>
        socket_err = ProxyConnectionError()
        socktype   = <SocketKind.SOCK_STREAM: 1>
        use_proxy  = True
../../BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py:1046: in connect
    self.sock.connect((self.host, self.port) + sa[2:])
        af         = <AddressFamily.AF_INET: 2>
        canonname  = ''
        host       = '255.255.255.255'
        port       = 8001
        proto      = 6
        proxy_headers = None
        proxy_host = '255.255.255.255'
        proxy_pass = None
        proxy_port = 8001
        proxy_rdns = True
        proxy_type = 3
        proxy_user = None
        res        = (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('255.255.255.255', 8001))
        sa         = ('255.255.255.255', 8001)
        self       = <httplib2.HTTPConnectionWithTimeout object at 0x7f811717cf70>
        socket_err = ProxyConnectionError()
        socktype   = <SocketKind.SOCK_STREAM: 1>
        use_proxy  = True
/usr/lib/python3.8/site-packages/socks.py:47: in wrapper
    return function(*args, **kwargs)
        _is_blocking = None
        args       = (<socks.socksocket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>, ('invalid.hostname.foo.bar', 80))
        function   = <function socksocket.connect at 0x7f80b17c70d0>
        kwargs     = {}
        self       = <socks.socksocket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
/usr/lib/python3.8/site-packages/socks.py:800: in connect
    raise ProxyConnectionError(msg, error)
E   socks.ProxyConnectionError: Error connecting to HTTP proxy 255.255.255.255:8001: [Errno -2] Name or service not known
        __class__  = <class 'socks.socksocket'>
        catch_errors = None
        dest_addr  = 'invalid.hostname.foo.bar'
        dest_pair  = ('invalid.hostname.foo.bar', 80)
        dest_port  = 80
        msg        = 'Error connecting to HTTP proxy 255.255.255.255:8001'
        password   = None
        printable_type = 'HTTP'
        proxy_addr = '255.255.255.255'
        proxy_port = 8001
        proxy_server = '255.255.255.255:8001'
        proxy_type = 3
        rdns       = True
        self       = <socks.socksocket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
        username   = None
_____________________________________________________________________________ test_socks5_auth _____________________________________________________________________________
tests/test_proxy.py:198: in test_socks5_auth
    with tests.assert_raises(httplib2.socks.Socks5AuthError):
E   AttributeError: module 'socks' has no attribute 'Socks5AuthError'
        http       = <httplib2.Http object at 0x7f80b05cf850>
        proxy_conn = <function test_socks5_auth.<locals>.proxy_conn at 0x7f80b0a4a4c0>
        proxy_info = <ProxyInfo type=2 host:port=localhost:38837 rdns=True user=user_str headers=None>
        uri        = 'http://localhost:38837/'
        uri_parsed = ParseResult(scheme='http', netloc='localhost:38837', path='/', params='', query='', fragment='')
____________________________________________________________________ test_client_cert_password_verified ____________________________________________________________________
tests/test_https.py:151: in test_client_cert_password_verified
    expect_serial = tests.x509_serial(tests.CLIENT_ENCRYPTED_PEM) if tests.x509 else 16332984194609126128
        cert_log   = [{'issuer': ((('countryName', 'ZZ'),), (('stateOrProvinceName', '.'),), (('localityName', '.'),), (('organizationName'...tAfter': 'Oct  1 23:57:26 2031 GMT', 'notBefore': 'Oct  3 23:57:26 2021 GMT', 'serialNumber': 'E2AA6A96D1BF1AF0', ...}]
        handler    = <function test_client_cert_password_verified.<locals>.handler at 0x7f80b09c6820>
        http       = <httplib2.Http object at 0x7f80b0995070>
        setup_tls  = <function test_client_cert_password_verified.<locals>.setup_tls at 0x7f80b09c63a0>
        uri        = 'https://localhost:38501/'
        uri_parsed = ParseResult(scheme='https', netloc='localhost:38501', path='/', params='', query='', fragment='')
tests/__init__.py:786: in x509_serial
    cert = x509.load_pem_x509_certificate(pem)
        f          = <_io.BufferedReader name='/data/home/tkloczko/rpmbuild/BUILD/httplib2-0.20.3/tests/tls/client_encrypted.pem'>
        path       = '/data/home/tkloczko/rpmbuild/BUILD/httplib2-0.20.3/tests/tls/client_encrypted.pem'
        pem        = b'serial=E2AA6A96D1BF1AF0\nSHA1 Fingerprint=FB:42:16:53:02:8D:EA:F9:66:DB:BD:88:37:E1:93:7E:97:21:29:23\n-----BEGIN CE...LOQ4D+jK8/fcV9bhBuH\nLzBJ4gtPwUnvYqsaiIAeGi2EVllW0Ka+aTTzM1Yascl2q9WROvutAT0zz0M6smpO\n-----END RSA PRIVATE KEY-----\n'
/usr/lib64/python3.8/site-packages/cryptography/x509/base.py:531: in load_pem_x509_certificate
    return rust_x509.load_pem_x509_certificate(data)
E   ValueError: Unable to load PEM file. See https://cryptography.io/en/latest/faq.html#why-can-t-i-import-my-pem-file for more details. InvalidData(InvalidByte(4, 45))
        backend    = None
        data       = b'serial=E2AA6A96D1BF1AF0\nSHA1 Fingerprint=FB:42:16:53:02:8D:EA:F9:66:DB:BD:88:37:E1:93:7E:97:21:29:23\n-----BEGIN CE...LOQ4D+jK8/fcV9bhBuH\nLzBJ4gtPwUnvYqsaiIAeGi2EVllW0Ka+aTTzM1Yascl2q9WROvutAT0zz0M6smpO\n-----END RSA PRIVATE KEY-----\n'

---------- coverage: platform linux, python 3.8.12-final-0 -----------
Name                                                                                                                               Stmts   Miss  Cover
------------------------------------------------------------------------------------------------------------------------------------------------------
/data/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/__init__.py     919    146    84%
/data/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/auth.py          40      5    88%
/data/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/certs.py         30      4    87%
/data/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/error.py         25      0   100%
/data/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/iri2uri.py       41     15    63%
/data/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.20.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/httplib2/socks.py        244    244     0%
------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                                               1299    414    68%

========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_cache.py:48: was commented in legacy code
SKIPPED [4] tests/test_auth.py:249: benchmark disabled by default, set env httplib2_test_bench=1
SKIPPED [1] tests/test_http.py:240: FIXME: timeout on CI py27 and pypy, works elsewhere
SKIPPED [1] tests/test_http.py:524: was commented in legacy code
SKIPPED [1] tests/test_http.py:382: FIXME: timeout on CI py27 and pypy, works elsewhere
XFAIL tests/test_http.py::test_get_301_no_redirect
  FIXME: 301 cache works only with follow_redirects, should work regardless
XPASS tests/test_other.py::test_timeout_global FIXME: for unknown reason global timeout test fails in Python3 with response 200
FAILED tests/test_proxy.py::test_server_not_found_error_is_raised_for_invalid_hostname - socks.ProxyConnectionError: Error connecting to HTTP proxy 255.255.255.255:8001:...
FAILED tests/test_proxy.py::test_socks5_auth - AttributeError: module 'socks' has no attribute 'Socks5AuthError'
FAILED tests/test_https.py::test_client_cert_password_verified - ValueError: Unable to load PEM file. See https://cryptography.io/en/latest/faq.html#why-can-t-i-import-m...
===================================================== 3 failed, 478 passed, 8 skipped, 1 xfailed, 1 xpassed in 14.89s ======================================================

@kloczek
Copy link
Author

kloczek commented May 14, 2022

gentle ping 😃

@kloczek
Copy link
Author

kloczek commented Feb 11, 2023

After add pyparsing to build env I have now only one unit failing

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.20.4-9.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-httplib2-0.20.4-9.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' -q
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/httplib2-0.20.4, configfile: setup.cfg
plugins: timeout-2.1.0
timeout: 17.0s
timeout method: signal
timeout func_only: False
collected 492 items

tests/test_auth.py .......................................ssss.......                                                                                                                 [ 10%]
tests/test_cacerts_from_env.py .....                                                                                                                                                  [ 11%]
tests/test_cache.py ...s..................................                                                                                                                            [ 18%]
tests/test_encoding.py ......                                                                                                                                                         [ 20%]
tests/test_http.py .................x.......s.........                                                                                                                                [ 27%]
tests/test_https.py .............F...                                                                                                                                                 [ 30%]
tests/test_other.py .....X............                                                                                                                                                [ 34%]
tests/test_proxy.py ..................                                                                                                                                                [ 38%]
tests/test_test_helpers.py .......................................................................................................................................................... [ 69%]
......................................................................................................................................                                                [ 96%]
tests/test_uri.py .................                                                                                                                                                   [100%]

========================================================================================= FAILURES ==========================================================================================
____________________________________________________________________________ test_client_cert_password_verified _____________________________________________________________________________
tests/test_https.py:151: in test_client_cert_password_verified
    expect_serial = tests.x509_serial(tests.CLIENT_ENCRYPTED_PEM) if tests.x509 else 16332984194609126128
        cert_log   = [{'issuer': ((('countryName', 'ZZ'),), (('stateOrProvinceName', '.'),), (('localityName', '.'),), (('organizationName'...tAfter': 'Oct  1 23:57:26 2031 GMT', 'notBefore': 'Oct  3 23:57:26 2021 GMT', 'serialNumber': 'E2AA6A96D1BF1AF0', ...}]
        handler    = <function test_client_cert_password_verified.<locals>.handler at 0x7f9d91e35310>
        http       = <httplib2.Http object at 0x7f9d9119aca0>
        setup_tls  = <function test_client_cert_password_verified.<locals>.setup_tls at 0x7f9d91e35b80>
        uri        = 'https://localhost:40133/'
        uri_parsed = ParseResult(scheme='https', netloc='localhost:40133', path='/', params='', query='', fragment='')
tests/__init__.py:786: in x509_serial
    cert = x509.load_pem_x509_certificate(pem)
        f          = <_io.BufferedReader name='/home/tkloczko/rpmbuild/BUILD/httplib2-0.20.4/tests/tls/client_encrypted.pem'>
        path       = '/home/tkloczko/rpmbuild/BUILD/httplib2-0.20.4/tests/tls/client_encrypted.pem'
        pem        = b'serial=E2AA6A96D1BF1AF0\nSHA1 Fingerprint=FB:42:16:53:02:8D:EA:F9:66:DB:BD:88:37:E1:93:7E:97:21:29:23\n-----BEGIN CE...LOQ4D+jK8/fcV9bhBuH\nLzBJ4gtPwUnvYqsaiIAeGi2EVllW0Ka+aTTzM1Yascl2q9WROvutAT0zz0M6smpO\n-----END RSA PRIVATE KEY-----\n'
/usr/lib64/python3.8/site-packages/cryptography/x509/base.py:521: in load_pem_x509_certificate
    return rust_x509.load_pem_x509_certificate(data)
E   ValueError: Unable to load PEM file. See https://cryptography.io/en/latest/faq/#why-can-t-i-import-my-pem-file for more details. InvalidData(InvalidByte(4, 45))
        backend    = None
        data       = b'serial=E2AA6A96D1BF1AF0\nSHA1 Fingerprint=FB:42:16:53:02:8D:EA:F9:66:DB:BD:88:37:E1:93:7E:97:21:29:23\n-----BEGIN CE...LOQ4D+jK8/fcV9bhBuH\nLzBJ4gtPwUnvYqsaiIAeGi2EVllW0Ka+aTTzM1Yascl2q9WROvutAT0zz0M6smpO\n-----END RSA PRIVATE KEY-----\n'
================================================================================== short test summary info ==================================================================================
SKIPPED [4] tests/test_auth.py:249: benchmark disabled by default, set env httplib2_test_bench=1
SKIPPED [1] tests/test_cache.py:48: was commented in legacy code
SKIPPED [1] tests/test_http.py:525: was commented in legacy code
XFAIL tests/test_http.py::test_get_301_no_redirect - FIXME: 301 cache works only with follow_redirects, should work regardless
XPASS tests/test_other.py::test_timeout_global FIXME: for unknown reason global timeout test fails in Python3 with response 200
FAILED tests/test_https.py::test_client_cert_password_verified - ValueError: Unable to load PEM file. See https://cryptography.io/en/latest/faq/#why-can-t-i-import-my-pem-file for more details. InvalidData(InvalidByte(4, 45))
============================================================== 1 failed, 483 passed, 6 skipped, 1 xfailed, 1 xpassed in 26.81s ==============================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants