diff options
Diffstat (limited to 'libproto/mailer/tests/seqsend.at')
-rw-r--r-- | libproto/mailer/tests/seqsend.at | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/libproto/mailer/tests/seqsend.at b/libproto/mailer/tests/seqsend.at new file mode 100644 index 000000000..68af24139 --- /dev/null +++ b/libproto/mailer/tests/seqsend.at @@ -0,0 +1,101 @@ +# GNU Mailutils -- a suite of utilities for electronic mail +# Copyright (C) 2019-2024 Free Software Foundation, Inc. +# +# This library is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. + +AT_SETUP([multiple sends]) +AT_DATA([msg],[dnl +From: mailutils@localhost +To: root@example.org +Subject: test + +test message +]) + +AT_DATA([expout], +[[MSGID: 0001 +DOMAIN: localhost +SENDER: <mailutils@localhost> +NRCPT: 1 +RCPT[0]: <gray@example.org> +LENGTH: 77 +From: mailutils@localhost +To: root@example.org +Subject: test + +test message +. + +MSGID: 0002 +DOMAIN: localhost +SENDER: <mailutils@localhost> +NRCPT: 1 +RCPT[0]: <root@example.org> +LENGTH: 77 +From: mailutils@localhost +To: root@example.org +Subject: test + +test message +. + +MSGID: 0003 +DOMAIN: localhost +SENDER: <mailutils@localhost> +NRCPT: 1 +RCPT[0]: <wheel@example.com> +LENGTH: 77 +From: mailutils@localhost +To: root@example.org +Subject: test + +test message +. + +]]) + +AT_CHECK([ +p=`$abs_top_builddir/testsuite/mockmta -d mta.diag` +test $? -eq 0 || AT_SKIP_TEST +set -- $p +# $1 - port, $2 - pid +sends "smtp://127.0.0.1:$1;domain=localhost" msg gray@example.org root@example.org wheel@example.com +ec=$? +kill $2 >/dev/null 2>&1 +if test $ec -eq 0; then + cat mta.diag +fi +exit $ec +], +[0], +[expout]) + +AT_CHECK([ +p=`$abs_top_builddir/testsuite/mockmta -d mta.diag` +test $? -eq 0 || AT_SKIP_TEST +set -- $p +# $1 - port, $2 - pid +sendm "smtp://127.0.0.1:$1;domain=localhost" msg gray@example.org root@example.org wheel@example.com +ec=$? +kill $2 >/dev/null 2>&1 +if test $ec -eq 0; then + cat mta.diag +fi +exit $ec +], +[0], +[expout]) + +AT_CLEANUP + |