summaryrefslogtreecommitdiffstats
path: root/tests/config/tls.test.lua
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:55:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:55:53 +0000
commit3d0386f27ca66379acf50199e1d1298386eeeeb8 (patch)
treef87bd4a126b3a843858eb447e8fd5893c3ee3882 /tests/config/tls.test.lua
parentInitial commit. (diff)
downloadknot-resolver-3d0386f27ca66379acf50199e1d1298386eeeeb8.tar.xz
knot-resolver-3d0386f27ca66379acf50199e1d1298386eeeeb8.zip
Adding upstream version 3.2.1.upstream/3.2.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/config/tls.test.lua')
-rw-r--r--tests/config/tls.test.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/config/tls.test.lua b/tests/config/tls.test.lua
new file mode 100644
index 0000000..d02d55f
--- /dev/null
+++ b/tests/config/tls.test.lua
@@ -0,0 +1,24 @@
+local function test_session_config()
+ ok(net.tls_sticket_secret(),
+ 'net.tls_sticket_secret() to trigger key regeneration')
+ -- There is no sufficiently new stable release of GnuTLS.
+ -- ok(net.tls_sticket_secret('0123456789ABCDEF0123456789ABCDEF'),
+ -- 'net.tls_sticket_secret with valid key')
+ boom(net.tls_sticket_secret, {{}},
+ 'net.tls_sticket_secret({}) is invalid')
+ boom(net.tls_sticket_secret, {'0123456789ABCDEF0123456789ABCDE'},
+ 'net.tls_sticket_secret with too short key')
+
+ boom(net.tls_sticket_secret_file, {},
+ 'net.tls_sticket_secret_file without filename')
+ boom(net.tls_sticket_secret_file, {{}},
+ 'net.tls_sticket_secret_file with non-string filename')
+ boom(net.tls_sticket_secret_file, {'/tmp/a_non_existent_file_REALLY_1528898130'},
+ 'net.tls_sticket_secret_file with non-existent filename')
+ boom(net.tls_sticket_secret_file, {'/dev/null'},
+ 'net.tls_sticket_secret_file with empty file')
+end
+
+return {
+ test_session_config
+}