"Fossies" - the Fresh Open Source Software Archive

Member "pdns-auth-4.2.0/builder-support/debian/recursor/ubuntu-trusty/tests/smoke" (27 Aug 2019, 682 Bytes) of package /linux/misc/dns/pdns-auth-4.2.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 exec 2>&1
    3 set -ex
    4 
    5 cat <<EOF >>/etc/powerdns/recursor.conf
    6 auth-zones=example.org=/etc/powerdns/example.org.zone
    7 EOF
    8 
    9 cat <<EOF >/etc/powerdns/example.org.zone
   10 example.org.           172800  IN      SOA     ns1.example.org. dns.example.org. 1 10800 3600 604800 3600
   11 example.org.           172800  IN      NS      ns1.example.org.
   12 smoke.example.org.     172800  IN      A       127.0.0.123
   13 EOF
   14 
   15 service pdns-recursor restart
   16 
   17 TMPFILE=$(mktemp)
   18 cleanup() {
   19   rm -f "$TMPFILE"
   20 }
   21 trap cleanup EXIT
   22 
   23 dig @127.0.0.1 smoke.example.org 2>&1 | tee "$TMPFILE"
   24 
   25 if grep -c '127\.0\.0\.123' "$TMPFILE"; then
   26     echo success
   27 else
   28     echo smoke could not be resolved
   29     exit 1
   30 fi
   31