aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2019-10-10 02:20:10 +0200
committerMatthias Andree <matthias.andree@gmx.de>2019-10-10 02:20:10 +0200
commit2cbe6f655a6bb5dea83b1b65bfc1f523195254b2 (patch)
treed4c453b007614fb12610193d5595e499d8bbcf99
parentb966ec71fad3e76266bb00cf8b3c3bea5130c167 (diff)
downloadfetchmail-2cbe6f655a6bb5dea83b1b65bfc1f523195254b2.tar.gz
fetchmail-2cbe6f655a6bb5dea83b1b65bfc1f523195254b2.tar.bz2
fetchmail-2cbe6f655a6bb5dea83b1b65bfc1f523195254b2.zip
Make t.smoke more robust. FreeBSD Bug#240914.
-rw-r--r--NEWS6
-rwxr-xr-xt.smoke23
2 files changed, 23 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 7672a5fe..ec492e72 100644
--- a/NEWS
+++ b/NEWS
@@ -71,6 +71,12 @@ fetchmail 6.4.2 (not yet released):
inside the table, which is unsupported by FreeBSD 12's mandoc(1) formatter.
FreeBSD Bug#241032, reported by Helge Oldach.
+## CHANGES:
+* Make t.smoke more robust and use temporary directory as FETCHMAILHOME, to make
+ sure that the home directory resolves for the user running the test suite
+ even if the environment isn't perfect. Reported by Konstantin Belousov,
+ analysed by Corey Halpin, FreeBSD Bug#240914.
+
fetchmail 6.4.1 (released 2019-09-28, 27473 LoC):
## REGRESSION FIXES:
diff --git a/t.smoke b/t.smoke
index c0ed8a66..041072da 100755
--- a/t.smoke
+++ b/t.smoke
@@ -3,9 +3,20 @@
# This is a rudimentary tests to see if fetchmail can parse a trivial
# configuration and dump it in human-readable and machine-readable form.
-set -e
-trap 'rm -f t.rc.$$' 0
-cp "${srcdir}/t.rc" t.rc.$$
-chmod 0400 t.rc.$$
-./fetchmail -V -f t.rc.$$ >/dev/null
-./fetchmail --configdump -f t.rc.$$ >/dev/null
+set -eu
+: "${TMPDIR:=/tmp}"
+{
+ dir=`(umask 077 && mktemp -d "$TMPDIR/t.smoke.XXXXXX")` 2>/dev/null \
+ && test -d "$dir"
+} || {
+ dir=$TMPDIR/t.smoke.$$-$RANDOM
+ (umask 077 && mkdir "$dir")
+}
+trap 'r=$? ; rm -fr t.rc.$$ $dir ; exit $r' 0
+cp "${srcdir}/t.rc" $dir/t.rc.$$
+chmod 0400 $dir/t.rc.$$
+HOME=$dir
+FETCHMAILHOME=$dir
+export HOME FETCHMAILHOME
+./fetchmail -V -f $dir/t.rc.$$ >/dev/null
+./fetchmail --configdump -f $dir/t.rc.$$ >/dev/null