File: test-spoollocking

package info (click to toggle)
nmh 1.6-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 6,204 kB
  • ctags: 3,851
  • sloc: ansic: 48,922; sh: 16,422; makefile: 559; perl: 509; lex: 402; awk: 74
file content (55 lines) | stat: -rwxr-xr-x 1,155 bytes parent folder | download | duplicates (2)
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
#!/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
#

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

    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 wor
$testmessage not zero'd"

    rmm 11

done

rm -f "$testmessage"

exit ${failed:-0}