]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
pytests: test_tls move + doc
authorTomas Krizek <tomas.krizek@nic.cz>
Fri, 16 Nov 2018 09:28:56 +0000 (10:28 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 4 Dec 2018 16:13:42 +0000 (17:13 +0100)
tests/pytests/test_tls.py [moved from tests/pytests/test_tls_certs.py with 84% similarity]

similarity index 84%
rename from tests/pytests/test_tls_certs.py
rename to tests/pytests/test_tls.py
index 1eec53db59e16ec5e7d0a80ca12d509dd94069dd..fd73cc0d1062b9d2cc46e6fe29ebc6cda70337d9 100644 (file)
@@ -1,4 +1,4 @@
-"""Tests with TLS certificates"""
+"""TLS-specific tests"""
 
 import ssl
 
@@ -8,6 +8,7 @@ import utils
 
 
 def test_tls_no_cert(kresd, sock_family):
+    """Use TLS without certificates."""
     sock, dest = kresd.stream_socket(sock_family, tls=True)
     ctx = utils.make_ssl_context(insecure=True)
     ssock = ctx.wrap_socket(sock)
@@ -17,6 +18,7 @@ def test_tls_no_cert(kresd, sock_family):
 
 
 def test_tls_selfsigned_cert(kresd_tt, sock_family):
+    """Use TLS with a self signed certificate."""
     sock, dest = kresd_tt.stream_socket(sock_family, tls=True)
     ctx = utils.make_ssl_context(verify_location=kresd_tt.tls_cert_path)
     ssock = ctx.wrap_socket(sock, server_hostname='transport-test-server.com')
@@ -26,6 +28,7 @@ def test_tls_selfsigned_cert(kresd_tt, sock_family):
 
 
 def test_tls_cert_hostname_mismatch(kresd_tt, sock_family):
+    """Attempt to use self signed certificate and incorrect hostname."""
     sock, dest = kresd_tt.stream_socket(sock_family, tls=True)
     ctx = utils.make_ssl_context(verify_location=kresd_tt.tls_cert_path)
     ssock = ctx.wrap_socket(sock, server_hostname='wrong-host-name')
@@ -35,6 +38,7 @@ def test_tls_cert_hostname_mismatch(kresd_tt, sock_family):
 
 
 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')