File: test-spoollocking

package info (click to toggle)
nmh 1.8-4
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 7,860 kB
  • sloc: ansic: 50,445; sh: 22,697; makefile: 1,138; lex: 740; perl: 509; yacc: 265
file content (57 lines) | stat: -rwxr-xr-x 1,232 bytes parent folder | download | duplicates (5)
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
#!/bin/sh
######################################################
#
# Test the locking of nmh spool file
#
######################################################

set -e

if test -z "${MH_OBJ_DIR}"; then
    srcdir=`dirname $0`/../..
    MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
fi

. "$MH_OBJ_DIR/test/common.sh"

setup_test

testmessage="$MH_TEST_DIR/testmessage"

cat > "$testmessage" <<EOM
Received: From somewhere
From: No Such User <nosuch@example.com>
To: Some Other User <someother@example.com>
Subject: Hello, how are you?
Date: Sun, 17 Dec 2006 12:13:14 -0500

This is a test; will it work?
EOM

#
# invoke "inc" for each locking algorithm
#

mv -f ${MHMTSCONF} ${MHMTSCONF}.backup

for locktype in $supported_locks
do
    sed -e '/^spoollocking:/d' < ${MHMTSCONF}.backup > ${MHMTSCONF}

    echo "spoollocking: $locktype" >> ${MHMTSCONF}

    run_test "inc -notruncate -width 80 -file $testmessage" \
"Incorporating new mail into inbox...

  11+ 12/17 No Such User       Hello, how are you?<<This is a test; will it work
$testmessage not zero'd"

    rmm 11
done

#### Restore mts.conf so subsequent tests use expected spoollocking.
mv -f ${MHMTSCONF}.backup ${MHMTSCONF}

rm -f "$testmessage"

exit ${failed:-0}