File: protocols

package info (click to toggle)
nullmailer 1:2.2-3
  • links: PTS
  • area: main
  • in suites: buster, sid
  • size: 1,228 kB
  • sloc: cpp: 6,785; sh: 504; makefile: 221; perl: 184
file content (60 lines) | stat: -rw-r--r-- 1,850 bytes parent folder | download
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
. functions
export HELOHOST=f.q.d.n

make-testmail

for p in smtp qmqp
do
	start server "tcpserver -1 ::0 0 sh $srcdir/test/accept-$p.sh"
	catch-port server

	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

stop server