From 17de69d5b6a8082a86d08f7617718e38c27205e0 Mon Sep 17 00:00:00 2001 From: Vasilii Kolobkov Date: Thu, 19 Jul 2018 18:54:07 +0200 Subject: [PATCH] Fix tests to run on OpenBSD Use a hardcoded sequence for there's no seq(1) in OpenBSD. awk(1) doesn't support interval regular expression syntax ({n,m}) on some BSDs. hostname(1) has no -f flag on OpenBSD and. Try it first and fallback to `uname -n`. Omit explicit template in mktemp(1) call. --- test/common.sh | 6 ++++++ test/runtest | 2 +- test/tests/mhsign/test-mhsign | 5 ++--- test/tests/mhstore/test-filenames | 2 +- test/tests/show/test-longlines | 6 ++---- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/test/common.sh b/test/common.sh index 805afea..1a67733 100644 --- a/test/common.sh +++ b/test/common.sh @@ -52,6 +52,12 @@ require_locale() test_skip "no suitable locale available" } +# Do a best guess at FQDN +mh_hostname() +{ + hostname -f 2>/dev/null || uname -n +} + # Some stuff for doing silly progress indicators progress_update() { diff --git a/test/runtest b/test/runtest index 9f35ade..32c82f5 100755 --- a/test/runtest +++ b/test/runtest @@ -36,7 +36,7 @@ folder -create `mhparam trashfolder` >/dev/null folder -create `mhparam draftfolder` >/dev/null # create 10 basic messages -for i in `seq 1 10`; +for i in 1 2 3 4 5 6 7 8 9 10; do cat >"$MAILDIR/inbox/$i" <<-! From: Test$i diff --git a/test/tests/mhsign/test-mhsign b/test/tests/mhsign/test-mhsign index 3c2bb97..44e0997 100755 --- a/test/tests/mhsign/test-mhsign +++ b/test/tests/mhsign/test-mhsign @@ -7,7 +7,6 @@ . "$MH_TEST_COMMON" - # setup some aliases cat >"$MH_TEST_DIR/.mmh/aliases" < +Could not find key for Could not find key for -Could not find key for +Could not find key for Could not find key for Could not find key for Could not find key for diff --git a/test/tests/mhstore/test-filenames b/test/tests/mhstore/test-filenames index a1d3c3d..31946ee 100755 --- a/test/tests/mhstore/test-filenames +++ b/test/tests/mhstore/test-filenames @@ -11,7 +11,7 @@ require_locale en_US.utf-8 en_US.utf8 LC_ALL=en_US.UTF-8 export LC_ALL -tempdir=`TMPDIR=$MH_TEST_DIR mktemp -d -t "XXXXX"` +tempdir=`TMPDIR=$MH_TEST_DIR mktemp -d` cd $tempdir msgfile=`mhpath b` diff --git a/test/tests/show/test-longlines b/test/tests/show/test-longlines index 138c724..c15c1cb 100644 --- a/test/tests/show/test-longlines +++ b/test/tests/show/test-longlines @@ -13,13 +13,11 @@ actual=$MH_TEST_DIR/$$.actual genlongsubject() { len="${1:-998}" awk -v len="$len" 'BEGIN { - prefix = "Subject: " len + prefix = "Subject: " len " " while (i++