From b7514eeac609a7e99c66031f853f695bb82c990a Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 10 Nov 2019 18:11:05 +0100 Subject: Test suite: don't treat broken symlinks as missing. `test -f` deferences paths so fails on broken symlinks, yielding an incorrect test environment and perhaps even a false negative. --- tests/run | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/run b/tests/run index bff9c18..2903938 100755 --- a/tests/run +++ b/tests/run @@ -73,7 +73,7 @@ environ_set() { prepare() { declare -a ENVIRON=() local src cfg target u home n proto - if [ -f "$TESTDIR/remotes" ]; then + if [ -f "$TESTDIR/remotes" ] || [ -L "$TESTDIR/remotes" ]; then for cfg in $(seq 1 "$(< "$TESTDIR/remotes")"); do REMOTES+=( "remote$cfg" ) done @@ -98,7 +98,7 @@ prepare() { inbox = yes } EOF - if [ -f "$TESTDIR/$u.conf" ]; then + if [ -f "$TESTDIR/$u.conf" ] || [ -L "$TESTDIR/$u.conf" ]; then cat >>"$home/.dovecot/config" <"$TESTDIR/$u.conf" fi cp -aT -- "$BASEDIR/snippets/dovecot" "$home/.dovecot/conf.d" @@ -157,7 +157,7 @@ prepare() { database = $u.db #logfile = $HOME_local/interimap$n.log EOF - if [ -f "$TESTDIR/interimap$n.conf" ]; then + if [ -f "$TESTDIR/interimap$n.conf" ] || [ -L "$TESTDIR/interimap$n.conf" ]; then cat <"$TESTDIR/interimap$n.conf" >>"$HOME_local/.config/interimap/config$n" fi @@ -168,7 +168,7 @@ prepare() { command = exec ${HOME_local@Q}/.local/bin/doveadm exec imap null-stderr = NO EOF - if [ -f "$TESTDIR/interimap$n.local" ]; then + if [ -f "$TESTDIR/interimap$n.local" ] || [ -L "$TESTDIR/interimap$n.local" ]; then cat <"$TESTDIR/interimap$n.local" >>"$HOME_local/.config/interimap/config$n" fi @@ -185,7 +185,7 @@ prepare() { null-stderr = NO EOF fi >>"$HOME_local/.config/interimap/config$n" - if [ -f "$TESTDIR/interimap$n.remote" ]; then + if [ -f "$TESTDIR/interimap$n.remote" ] || [ -L "$TESTDIR/interimap$n.remote" ]; then cat <"$TESTDIR/interimap$n.remote" >>"$HOME_local/.config/interimap/config$n" fi done -- cgit v1.2.3