From a4e7170a9547aa64fdbd9001014f36de61134e39 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 28 May 2019 00:18:26 +0200 Subject: tests/run: Honor $TMPDIR if the variable is set. Otherwise use /dev/shm. --- tests/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/run') diff --git a/tests/run b/tests/run index 31af03e..d823f0a 100755 --- a/tests/run +++ b/tests/run @@ -36,7 +36,7 @@ if [ ! -d "$TESTDIR" ]; then exit 1 fi -ROOTDIR="$(mktemp --tmpdir=/dev/shm --directory "$NAME.XXXXXXXXXX")" +ROOTDIR="$(mktemp --tmpdir="${TMPDIR:-/dev/shm}" --directory "$NAME.XXXXXXXXXX")" trap 'rm -rf -- "$ROOTDIR"' EXIT INT TERM STDOUT="$ROOTDIR/stdout" -- cgit v1.2.3 From d385fd2817a96bc952b086533798bbf009d3d54f Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 28 May 2019 00:19:17 +0200 Subject: tests/run: Don't void the command's standard error. --- tests/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/run') diff --git a/tests/run b/tests/run index d823f0a..60d9d01 100755 --- a/tests/run +++ b/tests/run @@ -102,12 +102,12 @@ prepare() { [local] type = tunnel command = exec ${HOME_local@Q}/.local/bin/doveadm exec imap - null-stderr = YES + null-stderr = NO [remote] type = tunnel command = exec ${home@Q}/.local/bin/doveadm exec imap - null-stderr = YES + null-stderr = NO EOF done } -- cgit v1.2.3 From 350217c321cf30ebf2a6655d6ad925898f40a992 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 28 May 2019 00:28:33 +0200 Subject: tests/run: set 'mailbox_list_index = yes' in dovecot.conf. LAYOUT=index requires mailbox_list_index = yes. It's the default since dovecot 2.3, but we set it explicitly to support older versions. --- tests/run | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/run') diff --git a/tests/run b/tests/run index 60d9d01..91319f3 100755 --- a/tests/run +++ b/tests/run @@ -73,6 +73,7 @@ prepare() { cat >"$home/.config/dovecot/config" <<-EOF log_path = /dev/null mail_home = $ROOTDIR/home/%u + mailbox_list_index = yes ssl = no EOF cat >>"$home/.config/dovecot/config" <"$src" -- cgit v1.2.3 From a07043f308ee91223b1048a6ca1c878c31b0f83a Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 28 May 2019 16:46:41 +0200 Subject: tests/run: use the current date as Message-ID in `sample_message`. A random 128-bit UUID obtained from /proc/sys/kernel/random/uuid works too but is Linux-specific and requires the proc(5) pseudo-filesystem to be mounted at /proc. --- tests/run | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/run') diff --git a/tests/run b/tests/run index 91319f3..fca4919 100755 --- a/tests/run +++ b/tests/run @@ -133,11 +133,12 @@ doveadm() { # Sample (random) message sample_message() { + local date="$(date +"%s.%N")" cat <<-EOF From: To: - Date: $(date -R) - Message-ID: <$(< /proc/sys/kernel/random/uuid)@example.net> + Date: $(date -R -d@"$date") + Message-ID: <$date@example.net> EOF local len="$(shuf -i1-4096 -n1)" -- cgit v1.2.3 From 93e66f34629f248d14e9123fc5a1050bd3b71108 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Thu, 27 Jun 2019 20:46:26 +0200 Subject: test suite: make sqlite3 ignore ~/.sqliterc --- tests/run | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/run') diff --git a/tests/run b/tests/run index fca4919..32931d6 100755 --- a/tests/run +++ b/tests/run @@ -130,6 +130,9 @@ doveadm() { shift 2 "$home/.local/bin/doveadm" "$@" } +sqlite3() { + command sqlite3 -init /dev/null "$@" +} # Sample (random) message sample_message() { @@ -321,7 +324,7 @@ xcgrep() { declare -a ENVIRON=() environ_set "local" export TMPDIR TESTDIR STDOUT STDERR "${ENVIRON[@]}" -export -f environ_set doveadm interimap sample_message deliver +export -f environ_set doveadm interimap sqlite3 sample_message deliver export -f check_mailbox_status check_mailbox_status_values check_mailbox_status2 export -f check_mailboxes_status check_mailbox_list xgrep xcgrep printf "%s..." "$TEST" -- cgit v1.2.3 From 53ea6efb89aade69c921fc57ad809eb61e9133a8 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Thu, 27 Jun 2019 21:00:56 +0200 Subject: tests/run: fix minor space damage --- tests/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/run') diff --git a/tests/run b/tests/run index 32931d6..4f828d6 100755 --- a/tests/run +++ b/tests/run @@ -220,7 +220,7 @@ check_mailbox_status2() { read MESSAGES < <( sqlite3 "$XDG_DATA_HOME/interimap/$u.db" <<-EOF .mode csv .separator " " "\\n" - SELECT COUNT(*) + SELECT COUNT(*) FROM mailboxes a JOIN mapping b ON a.idx = b.idx WHERE mailbox = $blob EOF -- cgit v1.2.3 From c4abd6128c3ca5471afc84225533a958ce273875 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 5 Jul 2019 02:42:08 +0200 Subject: Fix minor space damage. --- tests/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/run') diff --git a/tests/run b/tests/run index 4f828d6..ee11757 100755 --- a/tests/run +++ b/tests/run @@ -161,7 +161,7 @@ deliver() { doveadm "${argv[@]}" exec dovecot-lda -e "$@" } -# Dump test results +# Dump test results dump_test_result() { local below=">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" local above="<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" -- cgit v1.2.3