summaryrefslogtreecommitdiff
path: root/regress/lib/libc/asr/regress.sh
blob: b1bbabc1f8a0b13ff5ef93680c268b846c6eb693 (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
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
#	$OpenBSD: regress.sh,v 1.5 2013/03/28 09:36:03 eric Exp $

. regress.subr

EFLAG=

test_res_mkquery()
{
	for i in $@; do
		regress res_mkquery $i
	done
}

test_res_query()
{
	for i in $@; do
		regress res_query $i
		regress res_query -q $i
	done
}

test_getrrsetbyname()
{
	for i in $@; do
		regress getrrsetbyname $i
		regress getrrsetbyname -t MX $i
		regress getrrsetbyname -t AAAA $i
	done
}

test_gethostbyname()
{
	for i in $@; do
		regress gethostnamadr $i
		regress gethostnamadr -4 $i
		regress gethostnamadr -6 $i
	done
}

test_gethostbyaddr()
{
	for i in $@; do
		regress gethostnamadr -a $i
	done
}

test_getaddrinfo()
{
	for i in $@; do
		regress getaddrinfo $i
		regress getaddrinfo -C $i
		regress getaddrinfo -F $i
		regress getaddrinfo -CF $i
		regress getaddrinfo -P $i
		regress getaddrinfo -PF $i
		regress getaddrinfo -PC $i
		regress getaddrinfo -H $i
		regress getaddrinfo -p tcp $i
		regress getaddrinfo -p udp $i
		regress getaddrinfo -s www $i
		regress getaddrinfo -s bad $i
		regress getaddrinfo -S -s 8081 $i
		regress getaddrinfo -S -s bad $i
		regress getaddrinfo -P -s syslog $i
		regress getaddrinfo -P -s syslog -p tcp $i
		regress getaddrinfo -P -s syslog -p udp $i
	done
}

test_getaddrinfo2()
{
	for i in $@; do
		regress getaddrinfo -f inet6 -t raw -p icmpv6 $i
	done
}

test_getnameinfo()
{
	for i in $@; do
		regress getnameinfo $i
		regress getnameinfo -D $i
		regress getnameinfo -F $i
		regress getnameinfo -H $i
		regress getnameinfo -N $i
		regress getnameinfo -S $i
		regress getnameinfo -p 80 $i
		regress getnameinfo -p 514 $i
		regress getnameinfo -p 514 -D $i
		regress getnameinfo -p 5566 $i
	done
}

WEIRD="EMPTY . .. ..."
BASIC="localhost $(hostname -s) $(hostname)"
EXTRA="undeadly.org www.openbsd.org cvs.openbsd.org"

ADDRS="0.0.0.0 :: 127.0.0.1 ::1 212.227.193.194"

for e in file bind local; do
	regress_setenv $e

	test_res_mkquery $WEIRD $BASIC
	test_res_query $WEIRD $BASIC $EXTRA
	test_getrrsetbyname $WEIRD $BASIC $EXTRA
	test_gethostbyname $WEIRD $BASIC $EXTRA
	test_gethostbyaddr $ADDRS
	test_getaddrinfo NULL $WEIRD $BASIC $EXTRA
	test_getaddrinfo2 undeadly.org www.kame.net
	test_getnameinfo $ADDRS
 	test_gethostbyname $ADDRS
done

regress_digest