]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
pytests: remove test_tls_cert_expired
authorTomas Krizek <tomas.krizek@nic.cz>
Mon, 3 Dec 2018 12:16:01 +0000 (13:16 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 4 Dec 2018 16:13:42 +0000 (17:13 +0100)
tests/pytests/README.rst
tests/pytests/conftest.py
tests/pytests/test_tls.py

index 36f847e29b526986aba920badeef7ccf3451af71..9a11ccd0e92e0361328fa34076c16d0ae8b9fea3 100644 (file)
@@ -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)
index a9d36b75de12e316ccf7bd1d1833553a42e29066..e10ba3a795f00da7c44e86640d08b7d0ee349b65 100644 (file)
@@ -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',
index a32156b2de2baa3d6f9543d9acd9839686011c19..361741d50ae2d9f8a7ec71dda6300ebcc13a12e7 100644 (file)
@@ -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(