~samiam/MaraDNS

ref: 3.5.0002 MaraDNS/sqa/franky.hosts.test -rwxr-xr-x 1.9 KiB View raw
db09084f — Sam Trenholme MaraDNS release 3.5.0002 3 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
#!/bin/sh

# This script is a recursive stress test; we run a large number of queries
# against MaraDNS and make sure MaraDNS doesn't crash nor become unable to
# resolve hostnames.  We also make sure that Mara doesn't leak memory.

NUM=1
ASKMARA=../tools/askmara
#ASKMARA=true
HOSTFILE=hosts3
SHELL=sh

while : ; do
	echo Test round $NUM
	NUM=`expr $NUM + 1`
	echo >> sqa.output
	echo >> sqa.output
	echo >> sqa.output
	date >> sqa.output
	ps auxw | grep maradns >> sqa.output
	cat $HOSTFILE | sed 's/[^A-Za-z0-9\-\.\n]//g' | awk '
            BEGIN{srand();}
	    { a++;
            if(a % 7 == 0) {
		    print "./sendudp Awww.google.com. 127.0.0.4 > /dev/null"}
            if(a % 11 == 0) {
		    print "./sendudp Ayahoo.com. 127.0.0.4 > /dev/null"}
            if(a % 13 == 0) {
		    print "./sendudp Awww.msn.com. 127.0.0.4 > /dev/null"}
            if(a % 83 == 0) {
		    print "./sendudp Awww.myspace.com. 127.0.0.4 > /dev/null"}
	    if(a % 17 == 0) {
            w = int(rand() * 256);
            x = int(rand() * 256);
            y = int(rand() * 256);
            z = int(rand() * 256);
 print "./sendudp P" w "." x "." y "." z ".in-addr.arpa. 127.0.0.4 > /dev/null"
               }
            # Regression for ect.d memleak 
	    if(a % 19 == 0) { print "./sendnoise "$0" 127.0.0.4 > /dev/null" }
	    print "./sendudp A"$0". 127.0.0.4 > /dev/null"}' | $SHELL
	    #print "echo ./sendudp A"$0". 127.0.0.4 "}
	sleep 10
        # Make sure we'll still able to resolve host names
	$ASKMARA 1:www.google.com. 127.0.0.4 >> sqa.output
	$ASKMARA 1:www.yahoo.com. 127.0.0.4 >> sqa.output
	$ASKMARA 1:www.msn.com. 127.0.0.4 >> sqa.output
	$ASKMARA 1:www.microsoft.com. 127.0.0.4 >> sqa.output
	$ASKMARA 1:www.redhat.com. 127.0.0.4 >> sqa.output
	$ASKMARA 1:www.distrowatch.com. 127.0.0.4 >> sqa.output
	$ASKMARA 1:www.myspace.com. 127.0.0.4 >> sqa.output
	$ASKMARA 1:www.maradns.org. 127.0.0.4 >> sqa.output
	$ASKMARA 1:www.samiam.org. 127.0.0.4 >> sqa.output
done