summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2017-07-19 15:17:50 +0000
committeranton <anton@cvs.openbsd.org>2017-07-19 15:17:50 +0000
commitd89d92d65661b9bd60a53b6e9d5858ca6f0f89fd (patch)
tree37a33dd8ce014418e8dd6fced76df8653ea81eea
parentb8e94302f5da807ad88748b4bb7da5f75a40cc05 (diff)
Fix failing tests when executed as a user without a ~/.mailrc configuration file.
While here, fix a flaky test.
-rw-r--r--regress/usr.bin/mail/send.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/regress/usr.bin/mail/send.sh b/regress/usr.bin/mail/send.sh
index bbbd2581dba..0688b702d24 100644
--- a/regress/usr.bin/mail/send.sh
+++ b/regress/usr.bin/mail/send.sh
@@ -35,8 +35,16 @@ testseq() {
return 1
}
+# Create a fake HOME with a minimal .mailrc.
+tmp=$(mktemp -d)
+trap 'rm -r $tmp' 0
+cat >$tmp/.mailrc <<!
+set ask
+!
+
+HOME=$tmp
MALLOC_OPTIONS=S
-export MALLOC_OPTIONS
+export HOME MALLOC_OPTIONS
# NL: New line.
testseq "\n" "Subject: \r\n"
@@ -46,7 +54,7 @@ testseq "\0177" "Subject: "
testseq "a\0177" "Subject: a\b \b"
# VINTR: Kill letter.
-testseq "\0003\0003" \
+testseq "\0003" \
"Subject: ^C\r\n(Interrupt -- one more to kill letter)\r\nSubject: "
# VKILL: Kill line.