BIND 10 trac606, updated. ccd3fea75828ec4e0e2b20d8bba1d7b103164141 [trac606] fixed distcheck problems by making sure all necessary files are in EXTRA_DIST.

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Mar 8 02:27:25 UTC 2011


The branch, trac606 has been updated
       via  ccd3fea75828ec4e0e2b20d8bba1d7b103164141 (commit)
       via  a663b567f5a57c19c033de049219e4a5eb6d936b (commit)
       via  4cf5938f86b3c1a54beac417f6723505183ddf11 (commit)
       via  977a6a742c821ed49fc7d977f917b47f23563bdb (commit)
      from  bdc63200a7e2adcde2b0ce44aaeb8477fb059d17 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ccd3fea75828ec4e0e2b20d8bba1d7b103164141
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Mar 7 18:24:28 2011 -0800

    [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

commit a663b567f5a57c19c033de049219e4a5eb6d936b
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Mar 7 14:46:54 2011 -0800

    [trac606] corrected a test case.  it was intended to test the unlink behavior,
    but the original test code was wrong and didn't make sense.

commit 4cf5938f86b3c1a54beac417f6723505183ddf11
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Mar 7 14:45:09 2011 -0800

    [trac606] corrected typo in pydoc comment.

commit 977a6a742c821ed49fc7d977f917b47f23563bdb
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Mar 7 14:19:58 2011 -0800

    [trac606] do not try to unlink the pid file at the beginning of in dump_pid()
    as suggested in review.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/bind10/bind10.py.in             |    3 +-
 src/bin/bind10/tests/bind10_test.py.in  |    7 +-
 tests/system/Makefile.am                |    8 ++
 tests/system/README                     |    2 +-
 tests/system/conf.sh.in                 |    5 +-
 tests/system/digcomp.pl                 |  112 -------------------------------
 tests/system/glue/nsx1/b10-config.db.in |    2 +-
 tests/system/glue/tests.sh              |   20 +++---
 tests/system/run.sh                     |    2 +-
 tests/system/runall.sh                  |    2 +-
 tests/system/start.pl                   |    7 +-
 tests/system/testsock.pl                |   49 -------------
 12 files changed, 35 insertions(+), 184 deletions(-)
 delete mode 100755 tests/system/digcomp.pl
 delete mode 100755 tests/system/testsock.pl

-----------------------------------------------------------------------
diff --git a/src/bin/bind10/bind10.py.in b/src/bin/bind10/bind10.py.in
index 0a1e8b1..ce6e523 100755
--- a/src/bin/bind10/bind10.py.in
+++ b/src/bin/bind10/bind10.py.in
@@ -795,7 +795,6 @@ def dump_pid(pid_file):
     """
     if pid_file is None:
         return
-    unlink_pid_file(pid_file)
     f = open(pid_file, "w")
     f.write('%d\n' % os.getpid())
     f.close()
@@ -803,7 +802,7 @@ def dump_pid(pid_file):
 def unlink_pid_file(pid_file):
     """
     Remove the given file, which is basically expected to be the PID file
-    created by dump_pid().  If the specified may or may not exist; if it
+    created by dump_pid().  The specified may or may not exist; if it
     doesn't this function does nothing.  Other system level errors in removing
     the file will be propagated as the corresponding exception.
     """
diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in
index 30b9718..0603443 100644
--- a/src/bin/bind10/tests/bind10_test.py.in
+++ b/src/bin/bind10/tests/bind10_test.py.in
@@ -435,11 +435,12 @@ class TestPIDFile(unittest.TestCase):
         open(self.pid_file, "w").write('dummy data\n')
         self.check_pid_file()
 
-    def test_dump_pid_notexist(self):
+    def test_unlink_pid_file_notexist(self):
         dummy_data = 'dummy_data\n'
         open(self.pid_file, "w").write(dummy_data)
-        dump_pid('no_such_pid_file')
-        # the original content of the file should be intact.
+        unlink_pid_file("no_such_pid_file")
+        # the file specified for unlink_pid_file doesn't exist,
+        # and the original content of the file should be intact.
         self.assertEqual(dummy_data, open(self.pid_file, "r").read())
 
     def test_dump_pid_with_none(self):
diff --git a/tests/system/Makefile.am b/tests/system/Makefile.am
index 050ee2f..efd5d7f 100644
--- a/tests/system/Makefile.am
+++ b/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
diff --git a/tests/system/README b/tests/system/README
index 3ace845..080652d 100644
--- a/tests/system/README
+++ b/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:
diff --git a/tests/system/conf.sh.in b/tests/system/conf.sh.in
index 69ebe69..29d959a 100755
--- a/tests/system/conf.sh.in
+++ b/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
diff --git a/tests/system/digcomp.pl b/tests/system/digcomp.pl
deleted file mode 100755
index f5cd7fe..0000000
--- a/tests/system/digcomp.pl
+++ /dev/null
@@ -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);
diff --git a/tests/system/glue/nsx1/b10-config.db.in b/tests/system/glue/nsx1/b10-config.db.in
index 51f00f1..acd040c 100644
--- a/tests/system/glue/nsx1/b10-config.db.in
+++ b/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": {
diff --git a/tests/system/glue/tests.sh b/tests/system/glue/tests.sh
index 21f93f5..50b2330 100755
--- a/tests/system/glue/tests.sh
+++ b/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"
diff --git a/tests/system/run.sh b/tests/system/run.sh
index 3a02a05..4f852f4 100755
--- a/tests/system/run.sh
+++ b/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;
diff --git a/tests/system/runall.sh b/tests/system/runall.sh
index 1cb9275..5d0fe9b 100755
--- a/tests/system/runall.sh
+++ b/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
diff --git a/tests/system/start.pl b/tests/system/start.pl
index 122c71d..56f00c4 100755
--- a/tests/system/start.pl
+++ b/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) {
diff --git a/tests/system/testsock.pl b/tests/system/testsock.pl
deleted file mode 100755
index 44dd970..0000000
--- a/tests/system/testsock.pl
+++ /dev/null
@@ -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);
-}




More information about the bind10-changes mailing list