From: Tomas Krizek Date: Mon, 3 Dec 2018 12:16:01 +0000 (+0100) Subject: pytests: remove test_tls_cert_expired X-Git-Tag: v3.2.0~18^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19c1a9f22e7ded43ed7d5438d3818cdcafa76c09;p=thirdparty%2Fknot-resolver.git pytests: remove test_tls_cert_expired --- diff --git a/tests/pytests/README.rst b/tests/pytests/README.rst index 36f847e29..9a11ccd0e 100644 --- a/tests/pytests/README.rst +++ b/tests/pytests/README.rst @@ -50,5 +50,5 @@ The framework provides a few useful pytest fixtures to simplify this process: It expands to 4 values (tests) - IPv4 TCP, IPv6 TCP, IPv4 TLS, IPv6 TLS sockets - `make_kresd_sock` is similar to `kresd_sock`, except it's a factory function that produces a new connected socket (of the same type) on each call -- `kresd`, `kresd_tt`, `kresd_tt_expired` are all Kresd instances, already running - and initialized with config (with no / valid / expired TLS certificates) +- `kresd`, `kresd_tt` are all Kresd instances, already running + and initialized with config (with no / valid TLS certificates) diff --git a/tests/pytests/conftest.py b/tests/pytests/conftest.py index a9d36b75d..e10ba3a79 100644 --- a/tests/pytests/conftest.py +++ b/tests/pytests/conftest.py @@ -17,12 +17,6 @@ def kresd_tt(tmpdir): yield kresd -@pytest.fixture -def kresd_tt_expired(tmpdir): - with make_kresd(tmpdir, 'tt-expired') as kresd: - yield kresd - - @pytest.fixture(params=[ 'ip_tcp_socket', 'ip6_tcp_socket', diff --git a/tests/pytests/test_tls.py b/tests/pytests/test_tls.py index a32156b2d..361741d50 100644 --- a/tests/pytests/test_tls.py +++ b/tests/pytests/test_tls.py @@ -42,16 +42,6 @@ def test_tls_cert_hostname_mismatch(kresd_tt, sock_family): ssock.connect(dest) -def test_tls_cert_expired(kresd_tt_expired, sock_family): - """Attempt to use expired certificate.""" - sock, dest = kresd_tt_expired.stream_socket(sock_family, tls=True) - ctx = utils.make_ssl_context(verify_location=kresd_tt_expired.tls_cert_path) - ssock = ctx.wrap_socket(sock, server_hostname='transport-test-server.com') - - with pytest.raises(ssl.SSLError): - ssock.connect(dest) - - @pytest.mark.skipif(sys.version_info < (3, 6), reason="requires python3.6 or higher") @pytest.mark.parametrize('sf1, sf2, sf3', itertools.product(