Parcourir la source

[trac606] fixed distcheck problems by making sure all necessary files are in EXTRA_DIST.

For distcheck we only needed cleanall.sh, but to make tar balls complete
we need other files including test scripts and data.

Some other cleanups are piggy-backed:
- use port 53210 instead of 5300 to be aligned with trac #523
- use reference to BIND 9 tools (instead of copying them) when we don't
  need to modify them
JINMEI Tatuya il y a 14 ans
Parent
commit
ccd3fea758

+ 8 - 0
tests/system/Makefile.am

@@ -3,3 +3,11 @@ systest:
 
 distclean-local:
 	sh $(srcdir)/cleanall.sh
+
+# Most of the files under this directory (including test subdirectories)
+# must be listed in EXTRA_DIST.
+EXTRA_DIST = README cleanall.sh ifconfig.sh start.pl stop.pl run.sh runall.sh
+EXTRA_DIST += glue/auth.good glue/example.good glue/noglue.good glue/test.good
+EXTRA_DIST += glue/tests.sh glue/clean.sh
+EXTRA_DIST += glue/nsx1/com.db glue/nsx1/net.db glue/nsx1/root-servers.nil.db
+EXTRA_DIST += glue/nsx1/root.db

+ 1 - 1
tests/system/README

@@ -47,7 +47,7 @@ copy org.isc.bind.system and org.isc.bind.system to
 "launchctl load /Library/LaunchDaemons/org.isc.bind.system.plist" as
 root.
 
-The servers use port 5300 instead of the usual port 53, so they can be
+The servers use port 53210 instead of the usual port 53, so they can be
 run without root privileges once the interfaces have been set up.
 
 The tests can be run individually like this:

+ 4 - 1
tests/system/conf.sh.in

@@ -41,6 +41,9 @@ RUN_BIND10=$TOP/src/bin/bind10/run_bind10.sh
 B10_LOADZONE=$TOP/src/bin/loadzone/run_loadzone.sh
 BIND9_NAMED=$BIND9_TOP/bin/named/named
 DIG=$BIND9_TOP/bin/dig/dig
+# Test tools borrowed from BIND 9's system test (without change).
+TESTSOCK=$BIND9_TOP/bin/tests/system/testsock.pl
+DIGCOMP=$BIND9_TOP/bin/tests/system/digcomp.pl
 
 SUBDIRS="glue"
 #SUBDIRS="dnssec glue masterfile xfer"
@@ -48,4 +51,4 @@ SUBDIRS="glue"
 # PERL will be an empty string if no perl interpreter was found.
 PERL=@PERL@
 
-export RUN_BIND10 BIND9_NAMED DIG SUBDIRS PERL
+export RUN_BIND10 BIND9_NAMED DIG SUBDIRS PERL TESTSOCK

+ 0 - 112
tests/system/digcomp.pl

@@ -1,112 +0,0 @@
-#!/usr/bin/perl
-#
-# Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 2000, 2001  Internet Software Consortium.
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# Compare two files, each with the output from dig, for differences.
-# Ignore "unimportant" differences, like ordering of NS lines, TTL's,
-# etc...
-
-# This is a bare copy of the script used in BIND 9's system test.  It was
-# old and may need cleanups, or we may want to rewrite it in python.
-
-$file1 = $ARGV[0];
-$file2 = $ARGV[1];
-
-$count = 0;
-$firstname = "";
-$status = 0;
-$rcode1 = "none";
-$rcode2 = "none";
-
-open(FILE1, $file1) || die("open: $file1: $!\n");
-while (<FILE1>) {
-	chomp;
-	if (/^;.+status:\s+(\S+).+$/) {
-		$rcode1 = $1;
-	}
-	next if (/^;/);
-	if (/^(\S+)\s+\S+\s+(\S+)\s+(\S+)\s+(.+)$/) {
-		$name = $1;
-		$class = $2;
-		$type = $3;
-		$value = $4;
-		if ($type eq "SOA") {
-			$firstname = $name if ($firstname eq "");
-			if ($name eq $firstname) {
-				$name = "$name$count";
-				$count++;
-			}
-		}
-		if ($entry{"$name ; $class.$type ; $value"} ne "") {
-			$line = $entry{"$name ; $class.$type ; $value"};
-			print("Duplicate entry in $file1:\n> $_\n< $line\n");
-		} else {
-			$entry{"$name ; $class.$type ; $value"} = $_;
-		}
-	}
-}
-close(FILE1);
-
-$printed = 0;
-
-open(FILE2, $file2) || die("open: $file2: $!\n");
-while (<FILE2>) {
-	chomp;
-	if (/^;.+status:\s+(\S+).+$/) {
-		$rcode2 = $1;
-	}
-	next if (/^;/);
-	if (/^(\S+)\s+\S+\s+(\S+)\s+(\S+)\s+(.+)$/) {
-		$name = $1;
-		$class = $2;
-		$type = $3;
-		$value = $4;
-		if (($name eq $firstname) && ($type eq "SOA")) {
-			$count--;
-			$name = "$name$count";
-		}
-		if ($entry{"$name ; $class.$type ; $value"} ne "") {
-			$entry{"$name ; $class.$type ; $value"} = "";
-		} else {
-			print("Only in $file2 (missing from $file1):\n")
-			    if ($printed == 0);
-			print("> $_\n");
-			$printed++;
-			$status = 1;
-		}
-	}
-}
-close(FILE2);
-
-$printed = 0;
-
-foreach $key (keys(%entry)) {
-	if ($entry{$key} ne "") {
-		print("Only in $file1 (missing from $file2):\n")
-		    if ($printed == 0);
-		print("< $entry{$key}\n");
-		$status = 1;
-		$printed++;
-	}
-}
-
-if ($rcode1 ne $rcode2) {
-	print("< status: $rcode1\n");
-	print("> status: $rcode2\n");
-	$status = 1;
-}
-
-exit($status);

+ 1 - 1
tests/system/glue/nsx1/b10-config.db.in

@@ -1,6 +1,6 @@
 {"version": 2,
  "Auth": {
-   "listen_on": [{"address": "10.53.0.1", "port": 5300}],
+   "listen_on": [{"address": "10.53.0.1", "port": 53210}],
    "database_file": "@abs_builddir@/zone.sqlite3"
  },
  "Xfrout": {

+ 10 - 10
tests/system/glue/tests.sh

@@ -34,32 +34,32 @@ n=0
 # the other zone and uses the authoritative data in that zone (which is
 # intentionally different from the glue in the root zone).
 echo "I:testing that a TLD referral gets a full glue set from the root zone ($n)"
-$DIG +norec @10.53.0.1 -p 5300 foo.bar.example. A >dig.out.$n || status=1
-$PERL ../digcomp.pl example.good dig.out.$n || status=1
+$DIG +norec @10.53.0.1 -p 53210 foo.bar.example. A >dig.out.$n || status=1
+$PERL $DIGCOMP example.good dig.out.$n || status=1
 n=`expr $n + 1`
 
 echo "I:testing that we find glue A RRs we are authoritative for ($n)"
-$DIG +norec @10.53.0.1 -p 5300 foo.bar.example.org. a >dig.out.$n || status=1
-$PERL ../digcomp.pl auth.good dig.out.$n || status=1
+$DIG +norec @10.53.0.1 -p 53210 foo.bar.example.org. a >dig.out.$n || status=1
+$PERL $DIGCOMP auth.good dig.out.$n || status=1
 n=`expr $n + 1`
 
 # We cannot do this test for BIND 10 because b10-auth doesn't act as a
 # recursive (caching) server (by design)
 # echo "I:testing that we find glue A/AAAA RRs in the cache ($n)"
-# $DIG +norec @10.53.0.1 -p 5300 foo.bar.yy. a >dig.out.$n || status=1
-# $PERL ../digcomp.pl yy.good dig.out.$n || status=1
+# $DIG +norec @10.53.0.1 -p 53210 foo.bar.yy. a >dig.out.$n || status=1
+# $PERL $DIGCOMP yy.good dig.out.$n || status=1
 # n=`expr $n + 1`
 
 echo "I:testing that we don't find out-of-zone glue ($n)"
-$DIG +norec @10.53.0.1 -p 5300 example.net. a > dig.out.$n || status=1
-$PERL ../digcomp.pl noglue.good dig.out.$n || status=1
+$DIG +norec @10.53.0.1 -p 53210 example.net. a > dig.out.$n || status=1
+$PERL $DIGCOMP noglue.good dig.out.$n || status=1
 n=`expr $n + 1`
 
 # This test currently fails (additional section will be empty, which is
 # incorrect).  See Trac ticket #646.
 #echo "I:testing that we are finding partial out-of-zone glue ($n)"
-#$DIG +norec @10.53.0.1 -p 5300 foo.bar.test. a >dig.out.$n || status=1
-#$PERL ../digcomp.pl test.good dig.out.$n || status=1
+#$DIG +norec @10.53.0.1 -p 53210 foo.bar.test. a >dig.out.$n || status=1
+#$PERL $DIGCOMP test.good dig.out.$n || status=1
 #n=`expr $n + 1`
 
 echo "I:exit status: $status"

+ 1 - 1
tests/system/run.sh

@@ -47,7 +47,7 @@ then
     exit 0;
 fi
 
-$PERL testsock.pl || {
+$PERL $TESTSOCK || {
     echo "I:Network interface aliases not set up.  Skipping test." >&2;
     echo "R:UNTESTED" >&2;
     echo "E:$test:`date`" >&2;

+ 1 - 1
tests/system/runall.sh

@@ -29,7 +29,7 @@ do
 	sh run.sh $d || status=1
 done
 
-$PERL testsock.pl || {
+$PERL $TESTSOCK || {
     cat <<EOF >&2
 I:
 I:NOTE: Many of the tests were skipped because they require that

+ 4 - 3
tests/system/start.pl

@@ -57,6 +57,7 @@ my $NAMED = $ENV{'NAMED'};
 my $LWRESD = $ENV{'LWRESD'};
 my $DIG = $ENV{'DIG'};
 my $PERL = $ENV{'PERL'};
+my $TESTSOCK = $ENV{'TESTSOCK'};
 
 # Start the server(s)
 
@@ -100,7 +101,7 @@ sub check_ports {
 
 	my $tries = 0;
 	while (1) {
-		my $return = system("$PERL $topdir/testsock.pl -p 5300 $options");
+		my $return = system("$PERL $TESTSOCK -p 53210 $options");
 		last if ($return == 0);
 		if (++$tries > 4) {
 			print "$0: could not bind to server addresses, still running?\n";
@@ -160,7 +161,7 @@ sub start_server {
 			$command .= "-m record,size,mctx ";
 			$command .= "-T clienttest ";
 			$command .= "-C resolv.conf -d 99 -g ";
-			$command .= "-i lwresd.pid -P 9210 -p 5300";
+			$command .= "-i lwresd.pid -P 9210 -p 53210";
 		}
 		$command .= " >lwresd.run 2>&1 &";
 		$pid_file = "lwresd.pid";
@@ -210,7 +211,7 @@ sub verify_server {
 
 	my $tries = 0;
 	while (1) {
-		my $return = system("$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd -p 5300 version.bind. chaos txt \@10.53.0.$n > dig.out");
+		my $return = system("$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd -p 53210 version.bind. chaos txt \@10.53.0.$n > dig.out");
 		last if ($return == 0);
 		print `grep ";" dig.out`;
 		if (++$tries >= 30) {

+ 0 - 49
tests/system/testsock.pl

@@ -1,49 +0,0 @@
-#!/usr/bin/perl
-#
-# Copyright (C) 2004, 2007, 2010  Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 2000, 2001  Internet Software Consortium.
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# Test whether the interfaces on 10.53.0.* are up.
-
-require 5.001;
-
-use Socket;
-use Getopt::Long;
-
-my $port = 0;
-my $id = 0;
-GetOptions("p=i" => \$port,
-           "i=i" => \$id);
-
-my @ids;
-if ($id != 0) {
-	@ids = ($id);
-} else {
-	@ids = (1..7);
-}
-
-foreach $id (@ids) {
-        my $addr = pack("C4", 10, 53, 0, $id);
-	my $sa = pack_sockaddr_in($port, $addr);
-	socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname("tcp"))
-      		or die "$0: socket: $!\n";
-	setsockopt(SOCK, SOL_SOCKET, SO_REUSEADDR, pack("l", 1));
-
-	bind(SOCK, $sa)
-	    	or die sprintf("$0: bind(%s, %d): $!\n",
-			       inet_ntoa($addr), $port);
-	close(SOCK);
-	sleep(1);
-}