summaryrefslogtreecommitdiffabout
path: root/comsat/tests/testsuite.at
Side-by-side diff
Diffstat (limited to 'comsat/tests/testsuite.at') (more/less context) (ignore whitespace changes)
-rw-r--r--comsat/tests/testsuite.at62
1 files changed, 15 insertions, 47 deletions
diff --git a/comsat/tests/testsuite.at b/comsat/tests/testsuite.at
index 45f3b1e..db2dbd0 100644
--- a/comsat/tests/testsuite.at
+++ b/comsat/tests/testsuite.at
@@ -20,44 +20,39 @@ dnl ------------------------------------------------------------
dnl mailbox for comsatd
m4_pushdef([BIFF_MBOX],[`pwd`/mailbox])
dnl ------------------------------------------------------------
dnl comsatcmd
m4_pushdef([comsatcmd],[comsatd --no-site-config --file ./biff.rc dnl
- --set logging.syslog=no --test])
+ --set logging.syslog=no --test=output])
dnl ------------------------------------------------------------
dnl BIFFTEST(DESCR, KW, DATA, CMDLINE, [STDOUT = `'], [STDERR = `'])
dnl
dnl NOTE: The test is skipped if run as root, because .biffrc is
dnl ignored for root (see open_rc() in action.c
dnl
m4_pushdef([BIFFTEST],[
AT_SETUP([comsatd: $1])
AT_KEYWORDS([comsatd $2])
+AT_CHECK([test -w / && AT_SKIP_TEST
+cwd=`pwd`
$3
-AT_CHECK([test -w / && AT_SKIP_TEST; $4],[0],[$5],[$6])
+],[0],[$4],[$5])
AT_CLEANUP])
AT_INIT
AT_TESTED([comsatd])
MUT_VERSION(comsatd)
BIFFTEST([default commands],[comsatd00],
-[cwd=`pwd`
+[
MUT_MBCOPY($abs_top_srcdir/testsuite/spool/teaparty.mbox, mailbox)
-cat > biff.rc <<EOT
-tty $cwd/output
-default
-EOT
-chmod 600 biff.rc
-> $cwd/output
-],
-[comsatcmd $cwd/mailbox 0
+comsatcmd $cwd/mailbox 0
sed '1s/^Mail to .*/Mail to test user/' output
],
[Mail to test user
---
From: March Hare <hare@wonder.land>
Subject: Invitation
@@ -66,22 +61,15 @@ Have some wine
---
])
BIFFTEST([non-zero qid],[comsatd01],
-[cwd=`pwd`
+[
MUT_MBCOPY($abs_top_srcdir/testsuite/spool/teaparty.mbox, mailbox)
-cat > biff.rc <<EOT
-tty $cwd/output
-default
-EOT
-chmod 600 biff.rc
-> $cwd/output
-],
-[comsatcmd $cwd/mailbox 9367
+comsatcmd $cwd/mailbox 9367
sed '1s/^Mail to .*/Mail to test user/' output
],
[Mail to test user
---
From: Alice <alice@wonder.land>
Subject: Funny watch (was Re: Watch)
@@ -91,22 +79,15 @@ month, and doesn't tell what o'clock it is!
---
])
BIFFTEST([maildir qid],[comsatd02],
-[cwd=`pwd`
+[
MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/teaparty, mailbox)
-cat > biff.rc <<EOT
-tty $cwd/output
-default
-EOT
-chmod 600 biff.rc
-> $cwd/output
-],
-[test "$MAILDIR_SUPPORT" = yes || AT_SKIP_TEST
+test "$MAILDIR_SUPPORT" = yes || AT_SKIP_TEST
comsatcmd maildir:$cwd/mailbox new/1284627340.M364969P3770Q81.Trurl
sed '1s/^Mail to .*/Mail to test user/' output
],
[Mail to test user
---
From: Alice <alice@wonder.land>
@@ -116,22 +97,15 @@ What did they draw?
---
])
BIFFTEST([MH qid],[comsatd03],
-[cwd=`pwd`
+[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty, mailbox)
-cat > biff.rc <<EOT
-tty $cwd/output
-default
-EOT
-chmod 600 biff.rc
-> $cwd/output
-],
-[test "$MH_SUPPORT" = yes || AT_SKIP_TEST
+test "$MH_SUPPORT" = yes || AT_SKIP_TEST
comsatcmd mh:$cwd/mailbox teaparty/58
sed '1s/^Mail to .*/Mail to test user/' output
],
[Mail to test user
---
From: March Hare <hare@wonder.land>
@@ -141,41 +115,35 @@ Suppose we change the subject, I'm getting tired of this.
I vote the young lady tells us a story.
---
])
BIFFTEST([beep command],[comsatd04],
-[cwd=`pwd`
+[
MUT_MBCOPY($abs_top_srcdir/testsuite/spool/mbox1, mailbox)
cat > biff.rc <<EOT
-tty $cwd/output
beep
EOT
chmod 600 biff.rc
-> $cwd/output
-],
-[comsatcmd $cwd/mailbox 0
+comsatcmd $cwd/mailbox 0
cat output | tr '\a' A
],
[AA])
BIFFTEST([exec command],[comsatd05],
[cwd=`pwd`
MUT_MBCOPY($abs_top_srcdir/testsuite/spool/teaparty.mbox, mailbox)
AT_DATA([notifier],[#! /bin/sh
echo "You have mail from $1, regarding $2"
])
chmod +x notifier
cat > biff.rc <<EOT
-tty $cwd/output
exec $cwd/notifier '\$H{from}' '\$H{Subject}'
EOT
chmod 600 biff.rc
-> $cwd/output
-],
-[comsatcmd $cwd/mailbox 0
+comsatcmd $cwd/mailbox 0
cat output
],
[You have mail from March Hare <hare@wonder.land>, regarding Invitation
])
m4_popdef([BIFFTEST])

Return to:

Send suggestions and report system problems to the System administrator.