summaryrefslogtreecommitdiff
path: root/mail/tests/copy00.at
blob: ae003dd011a035158e06629bdf1f3faffe971de9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2015-2019 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# GNU Mailutils 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.

AT_SETUP([copy to stdout])
AT_KEYWORDS([copy copy00])

# Description: Check if copying to /dev/stdout works.
# Reported-By: Dan Jacobson <jidanni@jidanni.org>
# References: <87wq0tazcr.fsf@jidanni.org>,
#    https://lists.gnu.org/archive/html/bug-mailutils/2015-05/msg00002.html

AT_CHECK([
test -f /dev/stdout || AT_SKIP_TEST
MUT_MBCOPY($abs_top_srcdir/testsuite/spool/mbox)
echo 'copy 1 /dev/stdout' | \
  MUT_MAIL_CMD -N -E 'set readonly' -f ./mbox 2>err | \
  sed 's/  *$//;/^Held 1 message/d'

if test -s err; then
  # On OSX. /dev/stdout cannot be locked.
  # Reported by Chris Weichenberger on Thu, 11 Jul 2019 18:04:06 +0200
  # in private correspondence.  See <20190711160406.picxk2geuqxjh2mx@X>
  sed -e '/Cannot lock \/dev\/stdout/d' err >err2
  if test -s err2; then
    cat err2 >&2
  else
    AT_SKIP_TEST
  fi
fi
],
[0],
[From gray@example.net Tue Jul 16 12:11:35 2002
Organization: Mailutils-tests
Received: from example.net (localhost [[127.0.0.1]]) 
	by example.net with ESMTP id g6G9BZb00791
	for <gray@example.net>; Tue, 16 Jul 2002 12:11:35 +0300
Message-Id: <200207160911.g6G9BZb00791@example.net>
To: Bar <bar@dontmailme.org>
Subject: MBOX
Date: Tue, 16 Jul 2002 12:11:35 +0300
From: Sergey Poznyakoff <gray@example.net>


This is a sample user's mbox.

"/dev/stdout"  14/438

])

AT_CLEANUP


Return to:

Send suggestions and report system problems to the System administrator.