~samiam/MaraDNS

ref: 3.5.0021 MaraDNS/deadwood-github/sqa/do.tests.CentOS-5.3 -rwxr-xr-x 5.8 KiB
ca00f282 — Sam Trenholme MaraDNS release 3.5.0021 5 months ago
                                                                                
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#!/bin/sh

# This is for my 64-bit CentOS 5.3 install without internet

# This is a shell script that will do all of the sqa tests; this script
# will halt if any of the tests does not give the desired result

# This test needs to be run from root, it needs to be run with Deadwood 
# inside the MaraDNS source tree, and it needs to be run with the
# current working directory the directory this test is in

SQADIR=$(pwd)
export CC=gcc

cd ../..
if [ ! -e maradns.gpg.key ] ; then
	echo These tests must be run inside of MaraDNS\; place the
	echo Deadwood code off of MaraDNS\' top-level directory before
        echo running these tests
	exit 0
fi
# Make sure MaraDNS is compiled
echo compiling MaraDNS...
make clean > /dev/null 2>&1 # MaraDNS
make > /dev/null 2>&1 # MaraDNS
#make # MaraDNS

# Now compile Deadwood
cd $SQADIR
cd ../src
export FLAGS='-O3'
echo compiling Deadwood...
make -f Makefile.centos5 clean > /dev/null 2>&1 
make -f Makefile.centos5 > /dev/null 2>&1 
#make -f Makefile.centos5

# Now, back to the SQA directory to run the tests
cd $SQADIR

TESTS=""
# I need to test ipv6 but haven't yet
#TESTS=$TESTS"basic_test basic_tcp_test basic_ipv6_test "

# Here are the tests we currently run
#TESTS=$TESTS"

# sqa_tcp is first because the example.com nameserver and DNS info
# constantly move
#TESTS=$TESTS"sqa_tcp " # Disable this if you have no internet

# These tests sometimes fail
TESTS=$TESTS"dwood2rc_n_maxprocs "
TESTS=$TESTS"dwood2rc_s_cache_file "
TESTS=$TESTS"sqa_one_upstream_down "
TESTS=$TESTS"sqa_tcp_buffering_2 "

# These tests are stable and don't fail
TESTS=$TESTS"basic_test basic_tcp_test "
TESTS=$TESTS"dwood2rc_s_bind_address "
TESTS=$TESTS"dwood2rc_n_dns_port "
TESTS=$TESTS"dwood2rc_n_handle_noreply "
TESTS=$TESTS"dwood2rc_n_handle_noreply_tcp "
TESTS=$TESTS"dwood2rc_n_handle_overload "
TESTS=$TESTS"dwood2rc_s_ipv4_bind_addresses "
TESTS=$TESTS"dwood2rc_n_maximum_cache_elements "
TESTS=$TESTS"dwood2rc_n_maradns_gid "
TESTS=$TESTS"dwood2rc_n_maradns_uid "
TESTS=$TESTS"dwood2rc_n_max_ar_chain "
TESTS=$TESTS"dwood2rc_n_num_retries "
TESTS=$TESTS"dwood2rc_s_random_seed_file "
TESTS=$TESTS"dwood2rc_n_recurse_min_bind_port "
TESTS=$TESTS"dwood2rc_n_recurse_number_ports "
TESTS=$TESTS"dwood2rc_s_recursive_acl "
TESTS=$TESTS"dwood2rc_n_resurrections "
TESTS=$TESTS"dwood2rc_n_timeout_seconds "
TESTS=$TESTS"dwood2rc_n_ttl_age "
TESTS=$TESTS"dwood2rc_n_upstream_port "
TESTS=$TESTS"dwood2rc_d_upstream_servers "
TESTS=$TESTS"dwood2rc_n_verbose_level "
TESTS=$TESTS"sqa_badid_question "
TESTS=$TESTS"sqa_bigpacket " # Needs BIND to run
TESTS=$TESTS"sqa_cname_chain "
TESTS=$TESTS"sqa_roy_arends "
TESTS=$TESTS"sqa_tcp_buffering "
# This test is last since it recompiles Deadwood
# Valgrind output is different in CentOS 5.5; so we need to do this different
#TESTS=$TESTS"sqa_valgrind "

for test in $TESTS ; do
	cd $test
	sh ./do.test > output.test 2> /dev/null
	sleep 2
	if ! cmp output.success output.test > /dev/null 2>&1 ; then
		echo test $test failed
		exit 1
	else
		echo test $test succeeded
	fi
	rm output.test
	cd ..
done

# sqa_valgrind gets special treatment
cd sqa_valgrind
echo doing test sqa_valgrind 
sh ./do.test > output.test 2> /dev/null
sleep 2
if ! cmp output.success.5.3 output.test > /dev/null 2>&1 ; then
	echo test sqa_valgrind failed
	exit 1
else
	echo test sqa_valgrind succeeded
fi
rm output.test
cd ..


# Let's test RG32
cd sqa_rg32
echo running RG32 test
sh ./do.test > output.test 2> /dev/null
sleep 2
if ! cmp output.success output.test > /dev/null 2>&1 ; then
	echo test sqa_rg32 failed
	exit 1
fi
echo RG32 pass
rm -f output.test 2> /dev/null
cd ..

# Let's test hash_magic_number
cd ../src
make -f Makefile.centos5 clean > /dev/null 2>&1
export FLAGS='-O3 -DHASH_DEBUG -DXTRA_STUFF'
make -f Makefile.centos5 > /dev/null 2>&1
cd $SQADIR
cd dwood2rc_n_hash_magic_number
sh ./do.test > output.test 2> /dev/null
sleep 2
if ! cmp output.success output.test > /dev/null 2>&1 ; then
	echo test dwood2rc_n_hash_magic_number failed
	#exit 1
else
	echo test dwood2rc_n_hash_magic_number succeeded
fi
rm output.test
cd ..

# Inflight test
cd $SQADIR
cd ../src
make -f Makefile.centos5 clean > /dev/null 2>&1
export FLAGS='-O3 -DINFLIGHT_VERBOSE -DVALGRIND_NOERRORS'
#export FLAGS='-g -DINFLIGHT_VERBOSE -DVALGRIND_NOERRORS'
make -f Makefile.centos5 > /dev/null 2>&1
cd $SQADIR
cd dwood2rc_n_max_inflights
sh ./do.test > output.test 2> /dev/null
sleep 2
if ! cmp output.success.5.3 output.test > /dev/null 2>&1 ; then
	echo test dwood2rc_n_max_inflights failed
	exit 1
else
	echo test dwood2rc_n_max_inflights succeeded
fi

# Now, let's test IPv6
cd $SQADIR
cd ../..
make clean > /dev/null 2>&1 # MaraDNS
./configure --authonly > /dev/null 2>&1
make > /dev/null 2>&1 # MaraDNS
cd $SQADIR
cd ../src
make -f Makefile.centos5 clean > /dev/null 2>&1
export FLAGS='-O3 -DIPV6'
make -f Makefile.centos5 > /dev/null 2>&1
cd $SQADIR
cd basic_ipv6_test
sh ./do.test > output.test 2> /dev/null
sleep 2
if ! cmp output.success output.test > /dev/null 2>&1 ; then
	echo test basic_ipv6_test failed
	exit 1
else
	echo test basic_ipv6_test succeeded
fi
rm output.test

# dwood2rc_s_ip_blacklist
cd ../dwood2rc_s_ip_blacklist
sh ./do.test > output.test 2> /dev/null
sleep 2
if ! cmp output.success output.test > /dev/null 2>&1 ; then
	echo test dwood2rc_s_ip_blacklist failed
	exit 1
else
	echo test dwood2rc_s_ip_blacklist succeeded
fi
rm output.test

# No warnings when compiled with gcc43
cd $SQADIR
cd ../src
make -f Makefile.centos5 clean > /dev/null 2>&1
export FLAGS='-O3'
export CC='gcc43' # For CentOS 5.3
#export CC='gcc44'
rm -f foo1 foo2 > /dev/null 2>&1
make -f Makefile.centos5 > /dev/null 2> foo1
touch foo2
if ! cmp foo1 foo2 > /dev/null 2>&1 ; then
	echo test gcc43 compile failed
	exit 1
else
	echo test gcc43 compile succeeded
fi
rm foo1 foo2

# OK, clean up
cd $SQADIR
cd ../src
make -f Makefile.centos5 clean > /dev/null 2>&1
cd $SQADIR
cd ../../
make clean > /dev/null 2>&1

echo All tests successful

cd ..