]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Make sure pdns can be started and that it did indeed start
authorAki Tuomi <cmouse@desteem.org>
Mon, 10 Jun 2013 21:01:21 +0000 (00:01 +0300)
committerAki Tuomi <cmouse@desteem.org>
Mon, 10 Jun 2013 21:01:21 +0000 (00:01 +0300)
regression-tests/start-test-stop

index 108a618bf11126652ef5b1ed2a3e788db23e8b50..26bf533487a52983fea4f63183bd65356963b830 100755 (executable)
@@ -12,6 +12,7 @@ tosql ()
 
 bindwait ()
 {
+       check_process
        configname=$1
        domcount=$(grep -c zone named.conf)
        while sleep 10
@@ -45,6 +46,32 @@ securezone ()
        fi
 }
 
+check_process ()
+{
+   set +e
+   pids=$(cat pdns*.pid 2>/dev/null)
+   if [ -z "$pids" ]; then
+     echo "PowerDNS did not start"
+     exit 1
+   fi
+   kill -0 $pids >/dev/null 2>&1  
+   if [ $? -ne 0 ]; then
+     echo "PowerDNS did not start"
+     exit 1
+   fi
+   set -e
+}
+
+if [ ! -x $PDNS ]; then
+   echo "$PDNS is not executable binary"
+   exit 1
+fi
+
+if [ ! -x $PDNS2 ]; then
+   echo "$PDNS2 is not executable binary"
+   exit 1
+fi
+
 port=$1
 [ -z "$port" ] && port=5300
 context=$2
@@ -555,7 +582,9 @@ EOF
                        ./toxml $context
                        exit 1
 esac
-               
+
+check_process
+
 export port
 export context
 export extracontexts