blob: f6be2c812ab0ad33a457406fa3b8b857f794d743 (
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
66
67
68
69
70
|
. functions
export HELOHOST=f.q.d.n
rm -f testmail
cat >testmail <<EOF
bruce@untroubled.org
bruce@untroubled.org
From: <bruce@untroubled.org>
To: <bruce@untroubled.org>
Subject: Nullmailer automated test message
Just testing, please ignore
EOF
for p in smtp qmqp
do
start server "tcpserver -1 ::0 0 sh $srcdir/test/accept-$p.sh"
port=$( head -n 1 $tmpdir/service/server-log )
echo "Testing protocol success with $p (command-line)"
protocol $p --host=localhost --port=$port 3<testmail
echo "Testing protocol success with $p (stdin)"
protocol $p -- host=localhost port=$port 3<testmail
echo "Testing protocol success with $p (stdin, IPv6)"
protocol $p -- host=::1 port=$port 3<testmail
echo "Testing protocol success with $p (source addr)"
protocol $p -- host=::1 port=$port source=::1 3<testmail
echo "Testing protocol failure with $p (bad source addr 1)"
error 19 protocol $p -- host=::1 port=$port source=127.0.0.1 3<testmail
echo "Testing protocol failure with $p (bad source addr 2)"
error 19 protocol $p -- host=127.0.0.1 port=$port source=::1 3<testmail
stop server
echo "Testing host not found error with $p."
error 2 protocol $p --host=this.host.can.not.exist 3<testmail
echo "Testing connection refused error with $p."
error 7 protocol $p -p $port --host=localhost 3<testmail
echo "Testing connection refused error with $p (IPv6)."
error 7 protocol $p -p $port --host=::1 3<testmail
echo "Testing usage error with $p (zero args)."
error 1 protocol $p 3<testmail
echo "Testing usage error with $p (two args)."
error 1 protocol $p --host=localhost foobar 3<testmail
echo "Testing usage error with $p (unknown option)."
error 1 protocol $p -x --host=localhost 3<testmail
echo "Testing usage error with $p (invalid integer)."
error 1 protocol $p -p foo --host=localhost 3<testmail
start server tcpserver -1 0 0 date
port=$( head -n 1 $tmpdir/service/server-log )
echo "Testing protocol failure with $p."
error 11 protocol $p -p $port --host=localhost 3<testmail
stop server
wait
done
rm -f testmail
|