M_PERTURB: "0x42"
PANIC_ACTION: "gdb -batch -x raddb/panic.gdb %e %p 1>&0 2>&0"
SMTP_TEST_SERVER: 127.0.0.1
+ SMTP_TEST_SERVER_PORT: 2525
IMAP_TEST_SERVER: 127.0.0.1
+ IMAP_TEST_SERVER_PORT: 1430
+ IMAP_TEST_SERVER_SSL_PORT: 1431
SQL_MYSQL_TEST_SERVER: 127.0.0.1
SQL_POSTGRESQL_TEST_SERVER: 127.0.0.1
LDAP_TEST_SERVER: 127.0.0.1
touch "${LOGPATH}"
touch "${LOGINFOPATH}"
+# Get primary group name
+GROUP=$(id -gn)
+
#
# Add users to the password file
#
# Configure the specifics for the non_tls dovecot server
echo "
-instance_name = "fr_dovecot"
+instance_name = \"fr_dovecot\"
ssl = no
# Configure the specifics for the tls dovecot server
echo "
-instance_name = "fr_tls_dovecot"
+instance_name = \"fr_tls_dovecot\"
base_dir = ${TLSRUNDIR}
" >> "${TLSCONF}"
# Make sure there is a clean imap-stop.sh file
-> ${CIDIR}/imap-stop.sh
+echo "" > "${CIDIR}/imap-stop.sh"
#
# Add system specific dovecot information
echo "
userdb {
driver = static
- args = uid=${USER} gid=${USER}
+ args = uid=${USER} gid=${GROUP}
} \
" >> "${CONFPATH}"
# Run the imap server
echo "Starting a dovecot imap server at ${CONFPATH}"
-if ! dovecot -c ${CONFPATH}; then
+if ! dovecot -c "${CONFPATH}"; then
echo "The server failed to start up. Here is fr_dovecot.log"
- cat ${LOGPATH}
+ cat "${LOGPATH}"
echo "And here is fr_dovecot-info.log"
- cat ${LOGINFOPATH}
+ cat "${LOGINFOPATH}"
fi
echo "dovecot -c ${CONFPATH} stop" >> "${CIDIR}/imap-stop.sh"
ifdef ${1}_require_test_server
ifdef TEST_SERVER
- # define FOO_TEST_SERVER
- $(eval $(shell echo ${1} | tr a-z A-Z)_TEST_SERVER := $(TEST_SERVER))
- else
+ # define and export FOO_TEST_SERVER if it's not already defined
+ $(eval export $(shell echo ${1} | tr a-z A-Z)_TEST_SERVER ?= $(TEST_SERVER))
+ endif
+ ifeq "$($(shell echo ${1} | tr a-z A-Z)_TEST_SERVER)" ""
# the module requires a test server, but we don't have one. Skip it.
FILES_SKIP += ${2}
endif
# and make the output file depend on the library. That way if the
# module is re-built, then the tests are re-run.
#
-$(foreach x, $(FILES), $(eval $$(OUTPUT.$(TEST))/$x: $(patsubst %,$(BUILD_DIR)/lib/rlm_%.la,$(patsubst %/,%,$(dir $x)))))
+$(foreach x, $(FILES), $(eval $$(OUTPUT.$(TEST))/$x: $(patsubst %,$(BUILD_DIR)/lib/rlm_%.la,$(patsubst %/,%,$(firstword $(subst /, ,$(dir $x)))))))
#
#IMAP unit test config
imap imap_bad_tls {
- uri = "127.0.0.1:1431"
+ uri = "$ENV{IMAP_TEST_SERVER}:$ENV{IMAP_TEST_SERVER_SSL_PORT}"
timeout = 1000
tls {
#IMAP unit test config
imap imap_try_tls {
- uri = "127.0.0.1:1431"
+ uri = "$ENV{IMAP_TEST_SERVER}:$ENV{IMAP_TEST_SERVER_SSL_PORT}"
timeout = 1s
tls {
#IMAP unit test config
imap imap_tls {
- uri = "127.0.0.1:1431"
+ uri = "$ENV{IMAP_TEST_SERVER}:$ENV{IMAP_TEST_SERVER_SSL_PORT}"
timeout = 1s
tls {
#IMAP unit test config
imap {
- uri = "127.0.0.1:1430"
+ uri = "$ENV{IMAP_TEST_SERVER}:$ENV{IMAP_TEST_SERVER_PORT}"
timeout = 1s
}
message_id = "123456789@example.com"
}
- uri = "127.0.0.1:2525"
+ uri = "$ENV{SMTP_TEST_SERVER}:$ENV{SMTP_TEST_SERVER_PORT}"
timeout = 5s
template_directory = "$ENV{top_srcdir}build/ci/exim4"
smtp.authorize
#
-# Wait up to a tenth second for exim to deliver the email
+# Wait up to half a second for exim to deliver the email
# Then confirm it was delivered
#
if (`/bin/sh -c "for i in 1 2 3 4 5 ; \
do if [ -e build/ci/exim4/mail/smtp_attachment_receiver ] ;\
then break; \
-fi; sleep .02;\
+fi; sleep .1;\
done ; \
test -f build/ci/exim4/mail/smtp_attachment_receiver ;\
echo $?"` == "1") {
reject
}
-if (&request:TLS-Cert-Issuer =~ /@example\.org/) {
+if (&request.TLS-Cert-Issuer =~ /@example\.org/) {
test_pass
} else {
test_fail
reject
}
-if (&request:TLS-Cert-Issuer =~ /@example\.org/) {
+if (&request.TLS-Cert-Issuer =~ /@example\.org/) {
test_pass
} else {
test_fail
reject
}
-if (&request:TLS-Cert-Issuer =~ /@example\.org/) {
+if (&request.TLS-Cert-Issuer =~ /@example\.org/) {
test_pass
} else {
test_fail