aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run9
-rw-r--r--tests/tls-protocols/openssl.cnf (renamed from tests/config/openssl.cnf)0
-rw-r--r--tests/tls-protocols/t3
3 files changed, 8 insertions, 4 deletions
diff --git a/tests/run b/tests/run
index 329f3e3..1eaad54 100755
--- a/tests/run
+++ b/tests/run
@@ -35,6 +35,9 @@ if [ ! -d "$TESTDIR" ]; then
exit 1
fi
+# cleanup environment
+unset OPENSSL_CONF SSL_CERT_FILE SSL_CERT_DIR
+
ROOTDIR="$(mktemp --tmpdir="${TMPDIR:-/dev/shm}" --directory "$1.XXXXXXXXXX")"
declare -a DOVECOT_SERVER=()
trap cleanup EXIT INT TERM
@@ -57,13 +60,11 @@ mkdir -- "$TMPDIR" "$ROOTDIR/home"
declare -a REMOTES=()
# Set environment for the given user
-OPENSSL_CONF="$BASEDIR/config/openssl.cnf"
environ_set() {
local user="$1" home
eval home="\$HOME_$user"
ENVIRON=(
PATH="$PATH"
- OPENSSL_CONF="$OPENSSL_CONF"
USER="$user"
HOME="$home"
XDG_CONFIG_HOME="$home/.config"
@@ -209,6 +210,7 @@ _interimap_cmd() {
local script="$1" rv=0
shift
environ_set "local"
+ [ -z "${OPENSSL_CONF+x}" ] || ENVIRON+=( OPENSSL_CONF="$OPENSSL_CONF" )
[ -z "${SSL_CERT_FILE+x}" ] || ENVIRON+=( SSL_CERT_FILE="$SSL_CERT_FILE" )
[ -z "${SSL_CERT_DIR+x}" ] || ENVIRON+=( SSL_CERT_DIR="$SSL_CERT_DIR" )
env -i "${ENVIRON[@]}" perl -I./lib -T "./$script" "$@" 2>"$STDERR" || rv=$?
@@ -447,8 +449,7 @@ passed() {
# Run test in a sub-shell
declare -a ENVIRON=()
environ_set "local"
-unset SSL_CERT_FILE SSL_CERT_DIR
-export TMPDIR TESTDIR STDERR "${ENVIRON[@]}" OPENSSL_CONF
+export TMPDIR TESTDIR STDERR "${ENVIRON[@]}"
export -f environ_set doveadm interimap interimap_init pullimap _interimap_cmd
export -f sqlite3 sample_message deliver ptree_abort step_start step_done passed
export -f check_mailbox_status check_mailbox_status_values check_mailbox_status2
diff --git a/tests/config/openssl.cnf b/tests/tls-protocols/openssl.cnf
index 980097d..980097d 100644
--- a/tests/config/openssl.cnf
+++ b/tests/tls-protocols/openssl.cnf
diff --git a/tests/tls-protocols/t b/tests/tls-protocols/t
index c302731..72f7db2 100644
--- a/tests/tls-protocols/t
+++ b/tests/tls-protocols/t
@@ -5,6 +5,9 @@ interimap --debug || error
! grep -E "^remote: Maximum SSL/TLS protocol version: " <"$STDERR" || error
grep -E "^remote: SSL protocol: TLSv" <"$STDERR" || error
+# load custom OpenSSL configuration to allow TLS protocol version <=1.1
+export OPENSSL_CONF="$TESTDIR/openssl.cnf"
+
# backup config
install -m0600 "$XDG_CONFIG_HOME/interimap/config" "$XDG_CONFIG_HOME/interimap/config~"
with_remote_tls_protocols() {