"Fossies" - the Fresh Open Source Software Archive

Member "pdns-auth-4.2.0/builder-support/debian/authoritative/debian-buster/tests/smoke-bind" (27 Aug 2019, 711 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/named.conf
    6 zone "example.org" { type master; file "/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 restart
   16 
   17 TMPFILE=$(mktemp)
   18 cleanup() {
   19   rm -f "$TMPFILE"
   20   service pdns stop
   21 }
   22 trap cleanup EXIT
   23 
   24 dig @127.0.0.1 smoke.example.org 2>&1 | tee "$TMPFILE"
   25 
   26 if grep -c '127\.0\.0\.123' "$TMPFILE"; then
   27     echo success
   28 else
   29     echo smoke could not be resolved
   30     exit 1
   31 fi
   32