- Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathtesthm.in
executable file
·164 lines (147 loc) · 4.07 KB
/
testhm.in
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/bin/sh
#
# Stupid script for running strange command lines...
# Uncomment the ones you want to play with.
# You need a mailbox named testmail in the current directory to
# use this as is. The t1 ... t12 files are individual messages.
#
set -x
HYPERMAIL=../src/hypermail@suffix@
LABEL="I B TeStInG List"
ABOUT="../"
TESTMAIL=testmail
cleanup_testdir()
{
if [ -d testdir ];then
rm -rf testdir
fi
}
##################
# Test with a mailbox that has had all the dates changes to 2000+
# to test y2k capabilities
##################
#
test_configuration_file_with_mailbox_usage_y2k()
{
cleanup_testdir
$HYPERMAIL -c test.rc -m mboxes/y2k.mbox
}
##################
# Test updating an existing archive with a single message from
# a mailbox
##################
#
test_single_msg_archive_update_from_mailbox()
{
# Test the ability of hypermail to update an archive by only
# one message when the message comes from a mailbox.
cleanup_testdir
$HYPERMAIL -p -m $TESTMAIL -d testdir -l "${LABEL}" -a "${ABOUT}"
$HYPERMAIL -p -u -m mboxes/1msg.mbox -d testdir -l "${LABEL}" -a "${ABOUT}"
}
##################
# Test generating an archive from a mailbox with no config file used
##################
#
test_archive_gen_with_no_overwrite_from_mailbox_no_config_file()
{
cleanup_testdir
$HYPERMAIL -p -m $TESTMAIL -d testdir -l "${LABEL}" -a "${ABOUT}"
}
##################
# Test overwriting an archive from a mailbox with no
# config file used
##################
#
test_overwrite_archives_from_mailbox_no_config_file()
{
cleanup_testdir
cat $TESTMAIL> mboxes/overwrite.mbox
$HYPERMAIL -p -x -m mboxes/overwrite.mbox -d testdir -l "${LABEL}" -a "${ABOUT}"
cat mboxes/1msg.mbox >> mboxes/overwrite.mbox
$HYPERMAIL -p -x -m mboxes/overwrite.mbox -d testdir -l "${LABEL}" -a "${ABOUT}"
rm mboxes/overwrite.mbox
}
##################
# Test using a configuration file
# and specifying a mailbox to read.
##################
#
test_configuration_file_with_mailbox_usage()
{
cleanup_testdir
$HYPERMAIL -c test.rc -m $TESTMAIL
}
##################
# Test messages coming in on stdin with no configuration file used
##################
#
test_messages_coming_on_stdin()
{
cleanup_testdir
foriin mboxes/t[0-9]*
do
cat $i|$HYPERMAIL -p -i -u -l "test" \
-d "testdir" \
-b "http://www.wildheart.org/archives/wire/about.html" \
-a "http://www.wildheart.org/archives/"
sleep 1
if [ -r core ];then
echo"It cooooored"
exit
fi
done
}
##################
# Test messages coming in on stdin with a configuration file used
# and overriding some command line options
##################
#
test_messages_coming_on_stdin_with_config_file_used()
{
cleanup_testdir
foriin mboxes/t[0-9]*
do
cat $i|$HYPERMAIL -p -i -u -l "test" \
-c "test.rc" \
-d "testdir" \
-b "http://www.wildheart.org/archives/wire/about.html" \
-a "http://www.wildheart.org/archives/"
sleep 1
done
}
##################
# Test messages from mailbox with a configuration file used
# and overriding some command line options
##################
#
test_msgs_from_mailbox_config_file_used_and_overriding_options()
{
cleanup_testdir
$HYPERMAIL -p -m "$TESTMAIL" -x -l "test" \
-c "test.rc" \
-d "testdir"
}
##################
# Test messages from mailbox with a configuration file used
# and overriding some command line options
##################
#
test_embedded_msg()
{
cleanup_testdir
cat test.rc |
sed "s/^discard_dup_msgids.*$/discard_dup_msgids = 0/"> dtest.rc
$HYPERMAIL -p -m "mboxes/embedded.msg" -x -c "dtest.rc"
rm -f dtest.rc
}
# test_configuration_file_with_mailbox_usage_y2k
# test_single_msg_archive_update_from_mailbox
# test_archive_gen_with_no_overwrite_from_mailbox_no_config_file
# test_overwrite_archives_from_mailbox_no_config_file
# test_messages_coming_on_stdin
# test_messages_coming_on_stdin_with_config_file_used
# test_msgs_from_mailbox_config_file_used_and_overriding_options
# test_embedded_msg
test_configuration_file_with_mailbox_usage
exit 1