aboutsummaryrefslogtreecommitdiffstats
path: root/spec/tls/run.sh
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2025-04-03 15:11:58 +0100
committerMatthew Wild <mwild1@gmail.com>2025-04-03 15:11:58 +0100
commite6849bb76ee3682ece53d7434bb1e94a89c91cbc (patch)
treeb8fa5ad7b955d5735bcbd8cc6ab257acf1729d0a /spec/tls/run.sh
parent3905dcae02962457bfa8d426c472944358cfcf20 (diff)
downloadprosody-e6849bb76ee3682ece53d7434bb1e94a89c91cbc.tar.gz
prosody-e6849bb76ee3682ece53d7434bb1e94a89c91cbc.zip
spec/tls: Add TLS/certificate integration tests
These tests help to verify that various configurations translate into the expected running TLS setups. Specifically right now we are checking the correct certificate is served.
Diffstat (limited to 'spec/tls/run.sh')
-rwxr-xr-xspec/tls/run.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/tls/run.sh b/spec/tls/run.sh
new file mode 100755
index 00000000..8bceddb2
--- /dev/null
+++ b/spec/tls/run.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+export LUA_PATH="../../../?.lua;;"
+export LUA_CPATH="../../../?.so;;"
+
+any_failed=0
+
+for config in config*; do
+ echo "# Preparing $config"
+ pushd "$config";
+ cp ../../../prosody.cfg.lua.dist ./prosody-default.cfg.lua
+ echo 'VirtualHost "*" {pidfile = "prosody.pid";log={debug="prosody.log"}}' >> ./prosody-default.cfg.lua
+ ln -s ../../../plugins plugins
+ mkdir -p certs data
+ ./prepare.sh
+ ../../../prosody -D
+ sleep 1;
+ echo "# Testing $config"
+ ./assert.sh
+ status=$?
+ ../../../prosodyctl stop
+ rm plugins #prosody-default.cfg.lua
+ popd
+ if [[ "$status" != "0" ]]; then
+ echo -n "NOT ";
+ any_failed=1
+ fi
+ echo "OK: $config";
+done
+
+if [[ "$any_failed" != "0" ]]; then
+ echo "NOT OK: One or more TLS tests failed";
+ exit 1;
+fi
+
+echo "OK: All TLS tests passed";
+exit 0;