]> granicus.if.org Git - pdns/commitdiff
warn if recursor or pdns can't be found in regression tests (but continue anyhow...
authorbert hubert <bert.hubert@netherlabs.nl>
Tue, 22 Mar 2016 07:54:43 +0000 (08:54 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 22 Mar 2016 08:40:15 +0000 (09:40 +0100)
regression-tests.recursor/README.md
regression-tests.recursor/config.sh
regression-tests.recursor/vars.sample

index 91bbe1a2c3df60afff45aa5e1d0592fc9ab8b1aa..edcaa0c30c3570c66ee8118cc2e09165eefea183 100644 (file)
@@ -16,9 +16,12 @@ The suite also requires `bind()` access to port 53. The example config
 relies on authbind for this:
 
     $ ls -al /etc/authbind/byport/53
-    -rwxr-xr-x 1 root root 0 May 31  2012 /etc/authbind/byport/53
+    -rwxr-xr-x 1 you you 0 May 31  2012 /etc/authbind/byport/53
 
-Other dependencies: daemontools.
+Note that this file needs to be executable by the user you run as for
+authbind to work!
+
+Other dependencies: daemontools, lua-posix
 
 SETTING UP
 ----------
@@ -27,7 +30,7 @@ Copy `vars.sample` to `vars`
 
     $ cp vars.sample vars
 
-Edit `vars`.
+Edit `vars`:
 
 The /24 to bind the various daemons in:
 
@@ -39,7 +42,7 @@ How to run the auth server (usually no need to change this):
 
 How to run the recursor (usually, again, no need to change this):
 
-    RECRUN="exec authbind ../../../pdns/pdns_recursor --config-dir=. --socket-dir=. --daemon=no --trace=yes --dont-query= --local-address=$PREFIX.9 --hint-file=hintfile --packetcache-ttl=0 --max-cache-ttl=15 --threads=1 > logfile 2>&1"
+    RECRUN="exec authbind ../../../pdns/recursordist/pdns_recursor --config-dir=. --socket-dir=. --daemon=no --trace=yes --dont-query= --local-address=$PREFIX.9 --hint-file=hintfile --packetcache-ttl=0 --max-cache-ttl=15 --threads=1 > logfile 2>&1"
 
 
 RUNNING
@@ -63,11 +66,9 @@ Check that they are all up:
     ...
     configs/10.0.3.8: up (pid 1138) 13 seconds
     configs/recursor-service: up (pid 1140) 13 seconds
-    configs/run-auth: unable to chdir: not a directory
 
 (They all need to be up more than a few seconds, otherwise they might be
 crashing on startup. Check the per-service `logfile` if something is wrong).
-The `run- auth` error is normal.
 
 Run the tests:
 
index b7b8cb1b266f661a2fba8313cec94e8c599752ba..a3ffc930a5d0cc4e1f1545c9609575ce4dfe1a25 100755 (executable)
@@ -21,10 +21,8 @@ then
     exit 1
 fi
 
-
 rm -rf configs/
 mkdir configs
-cd configs
 
 cat > run-auth <<EOF
 #!/bin/sh
@@ -32,18 +30,35 @@ $AUTHRUN
 EOF
 chmod +x run-auth
 
+cd configs
+
 mkdir recursor-service
-cat > recursor-service/run <<EOF
+cd recursor-service
+if [ \! -x "$PDNSRECURSOR" ]
+then
+       echo "Could not find an executable pdns_recursor at \"$PDNSRECURSOR\", check PDNSRECURSOR"
+       echo "Continuing with configuration anyhow"
+fi
+
+if [ \! -x "$PDNS" ]
+then
+       echo "Could not find an executable pdns_server at \"$PDNS\", check PDNS"
+       echo "Continuing with configuration anyhow"
+fi
+
+cat > run <<EOF
 #!/bin/sh
 $RECRUN
 EOF
-chmod +x recursor-service/run
+chmod +x run
 
-cat > recursor-service/hintfile << EOF
+cat > hintfile << EOF
 .                        3600 IN NS  ns.root.
 ns.root.                 3600 IN A   $PREFIX.8
 EOF
 
+cd ..
+
 SOA="ns.example.net. hostmaster.example.net. 1 3600 1800 1209600 300"
 
 ### fake root zone
@@ -453,7 +468,7 @@ zone "$realzone"{
 };
 EOF
     done
-    ln -s ../run-auth $dir/run
+    ln -s ../../run-auth $dir/run
 done
 
 cat > recursor-service/forward-zones-file << EOF
index d78f6d87b20d5494adc7369614b733a3e47df685..8de2909b47e0d531c6d575e1986272088ba41de0 100644 (file)
@@ -1,3 +1,5 @@
 PREFIX=10.0.3
+# PDNSRECURSOR=    # set to override default location
+# PDNS=            # set to override default location   
 AUTHRUN="exec authbind ${PDNS} --config-dir=. > logfile 2>&1"
 RECRUN="exec authbind ${PDNSRECURSOR} --config-dir=. --socket-dir=. --daemon=no --trace=yes --dont-query= --local-address=$PREFIX.9 --hint-file=hintfile --packetcache-ttl=0 --max-cache-ttl=15 --threads=1 > logfile 2>&1"