]> diplodocus.org Git - nmh/blob - test/locking/test-spoollocking
Update the mh-sequence(5) man page with details of the format of the
[nmh] / test / locking / test-spoollocking
1 #!/bin/sh
2 ######################################################
3 #
4 # Test the locking of nmh spool file
5 #
6 ######################################################
7
8 set -e
9
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir=`dirname $0`/../..
12 MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
13 fi
14
15 . "$MH_OBJ_DIR/test/common.sh"
16
17 setup_test
18
19 testmessage="$MH_TEST_DIR/testmessage"
20
21 cat > "$testmessage" <<EOM
22 Received: From somewhere
23 From: No Such User <nosuch@example.com>
24 To: Some Other User <someother@example.com>
25 Subject: Hello, how are you?
26 Date: Sun, 17 Dec 2006 12:13:14 -0500
27
28 This is a test; will it work?
29 EOM
30
31 #
32 # invoke "inc" for each locking algorithm
33 #
34
35 for locktype in $supported_locks
36 do
37 mv -f ${MHMTSCONF} ${MHMTSCONF}.backup
38 sed -e '/^datalocking:/d' < ${MHMTSCONF}.backup > ${MHMTSCONF}
39 rm -f ${MHMTSCONF}.backup
40
41 echo "spoollocking: $locktype" >> ${MHMTSCONF}
42
43 run_test "inc -notruncate -width 80 -file $testmessage" \
44 "Incorporating new mail into inbox...
45
46 11+ 12/17 No Such User Hello, how are you?<<This is a test; will it wor
47 $testmessage not zero'd"
48
49 rmm 11
50
51 done
52
53 rm -f "$testmessage"
54
55 exit ${failed:-0}