diff options
author | Erlang/OTP <[email protected]> | 2009-11-20 14:54:40 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2009-11-20 14:54:40 +0000 |
commit | 84adefa331c4159d432d22840663c38f155cd4c1 (patch) | |
tree | bff9a9c66adda4df2106dfd0e5c053ab182a12bd /lib/kernel/test/inet_res_SUITE_data | |
download | otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2 otp-84adefa331c4159d432d22840663c38f155cd4c1.zip |
The R13B03 release.OTP_R13B03
Diffstat (limited to 'lib/kernel/test/inet_res_SUITE_data')
5 files changed, 264 insertions, 0 deletions
diff --git a/lib/kernel/test/inet_res_SUITE_data/otptest/0.0.0.0.f.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.zone b/lib/kernel/test/inet_res_SUITE_data/otptest/0.0.0.0.f.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.zone new file mode 100644 index 0000000000..81e14217ba --- /dev/null +++ b/lib/kernel/test/inet_res_SUITE_data/otptest/0.0.0.0.f.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.zone @@ -0,0 +1,12 @@ +$TTL 3600 +@ IN SOA ns.otptest. lsa.otptest. ( + 1 ; serial + 60 ; refresh + 10 ; retry + 300 ; expiry + 30 ) ; minimum + + IN NS ns.otptest. + IN MX 10 mx.otptest. + +c.1 IN PTR resolve.otptest. diff --git a/lib/kernel/test/inet_res_SUITE_data/otptest/0.0.127.in-addr.arpa.zone b/lib/kernel/test/inet_res_SUITE_data/otptest/0.0.127.in-addr.arpa.zone new file mode 100644 index 0000000000..bae50a9eec --- /dev/null +++ b/lib/kernel/test/inet_res_SUITE_data/otptest/0.0.127.in-addr.arpa.zone @@ -0,0 +1,27 @@ +$TTL 3600 +@ IN SOA ns.otptest. lsa.otptest. ( + 1 ; serial + 60 ; refresh + 10 ; retry + 300 ; expiry + 30 ) ; minimum + + IN NS ns.otptest. + IN MX 10 mx.otptest. + +1 IN PTR test1-78901234567890123456789012345678.otptest. +2 IN PTR test2-78901234567890123456789012345678.otptest. +10 IN PTR mx.otptest. +11 IN PTR ns1-5678901234567890123456789012345678.otptest. +12 IN PTR ns2-5678901234567890123456789012345678.otptest. +21 IN PTR mx1-5678901234567890123456789012345678.otptest. +22 IN PTR mx2-5678901234567890123456789012345678.otptest. +23 IN PTR mx3-5678901234567890123456789012345678.otptest. +24 IN PTR mx4-5678901234567890123456789012345678.otptest. +25 IN PTR mx5-5678901234567890123456789012345678.otptest. +26 IN PTR mx6-5678901234567890123456789012345678.otptest. +27 IN PTR mx7-5678901234567890123456789012345678.otptest. + +28 IN PTR resolve.otptest. + +254 IN PTR ns.otptest. diff --git a/lib/kernel/test/inet_res_SUITE_data/otptest/named_inc.conf b/lib/kernel/test/inet_res_SUITE_data/otptest/named_inc.conf new file mode 100644 index 0000000000..0b01b25204 --- /dev/null +++ b/lib/kernel/test/inet_res_SUITE_data/otptest/named_inc.conf @@ -0,0 +1,12 @@ +zone "." in { + type master; + file "root.zone"; +}; +zone "0.0.127.in-addr.arpa" in { + type master; + file "0.0.127.in-addr.arpa.zone"; +}; +zone "0.0.0.0.f.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" in { + type master; + file "0.0.0.0.f.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.zone"; +};
\ No newline at end of file diff --git a/lib/kernel/test/inet_res_SUITE_data/otptest/root.zone b/lib/kernel/test/inet_res_SUITE_data/otptest/root.zone new file mode 100644 index 0000000000..11cba18d45 --- /dev/null +++ b/lib/kernel/test/inet_res_SUITE_data/otptest/root.zone @@ -0,0 +1,50 @@ +$TTL 3600 +@ IN SOA ns.otptest lsa.otptest ( + 1 ; serial + 60 ; refresh + 10 ; retry + 300 ; expiry + 30 ) ; minimum + + IN NS ns.otptest + IN NS ns1-5678901234567890123456789012345678.otptest + IN NS ns2-5678901234567890123456789012345678.otptest +otptest IN MX 10 mx.otptest +otptest IN MX 20 mx1-5678901234567890123456789012345678.otptest +otptest IN MX 20 mx2-5678901234567890123456789012345678.otptest +otptest IN MX 20 mx3-5678901234567890123456789012345678.otptest +otptest IN MX 20 mx4-5678901234567890123456789012345678.otptest +otptest IN MX 20 mx5-5678901234567890123456789012345678.otptest +otptest IN MX 20 mx6-5678901234567890123456789012345678.otptest +otptest IN MX 20 mx7-5678901234567890123456789012345678.otptest + +test1-78901234567890123456789012345678.otptest IN A 127.0.0.1 +test2-78901234567890123456789012345678.otptest IN A 127.0.0.2 +ns1-5678901234567890123456789012345678.otptest IN A 127.0.0.11 +ns2-5678901234567890123456789012345678.otptest IN A 127.0.0.12 +mx.otptest IN A 127.0.0.10 +mx1-5678901234567890123456789012345678.otptest IN A 127.0.0.21 +mx2-5678901234567890123456789012345678.otptest IN A 127.0.0.22 +mx3-5678901234567890123456789012345678.otptest IN A 127.0.0.23 +mx4-5678901234567890123456789012345678.otptest IN A 127.0.0.24 +mx5-5678901234567890123456789012345678.otptest IN A 127.0.0.25 +mx6-5678901234567890123456789012345678.otptest IN A 127.0.0.26 +mx7-5678901234567890123456789012345678.otptest IN A 127.0.0.27 + +resolve.otptest IN A 127.0.0.28 +resolve.otptest IN AAAA ::127.0.0.28 +cname.resolve.otptest IN CNAME resolve.otptest +wks.resolve.otptest IN WKS 127.0.0.28 TCP ( telnet smtp ) +resolve.otptest IN HINFO "BEAM" "Erlang/OTP" +ns.resolve.otptest IN NS resolve.otptest +mx.resolve.otptest IN MX 10 resolve.otptest +_srv._tcp.resolve.otptest IN SRV 10 3 4711 resolve.otptest +naptr.resolve.otptest IN NAPTR 10 5 "S" "HTTP" "" _srv._tcp.resolve.otptest +txt.resolve.otptest IN TXT "Hej " "du " "glade " +txt.resolve.otptest IN TXT "ta " "en " "spade!" +mb.resolve.otptest IN MB mx.resolve.otptest +mg.resolve.otptest IN MG lsa.otptest +mr.resolve.otptest IN MR lsa.otptest +minfo.resolve.otptest IN MINFO minfo-owner.resolve.otptest minfo-bounce.resolve.otptest + +ns.otptest IN A 127.0.0.254 diff --git a/lib/kernel/test/inet_res_SUITE_data/run-named b/lib/kernel/test/inet_res_SUITE_data/run-named new file mode 100755 index 0000000000..b418607d48 --- /dev/null +++ b/lib/kernel/test/inet_res_SUITE_data/run-named @@ -0,0 +1,163 @@ +#! /bin/sh +## +## %CopyrightBegin% +## +## Copyright Ericsson AB 2009. All Rights Reserved. +## +## The contents of this file are subject to the Erlang Public License, +## Version 1.1, (the "License"); you may not use this file except in +## compliance with the License. You should have received a copy of the +## Erlang Public License along with this software. If not, it can be +## retrieved online at http://www.erlang.org/. +## +## Software distributed under the License is distributed on an "AS IS" +## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +## the License for the specific language governing rights and limitations +## under the License. +## +## %CopyrightEnd% +## +# + +# +## run-named +## +## $0 IPAddress PortNum SubDir +## +## * Create a work directory ./SubDir, create a named.conf there. +## * Locate named and check its version. +## * Zopy zone files from `dirname $0`/SubDir to ./SubDir. +## * Start named in ./SubDir with logging to named.log there. +## * Wait for "quit" on stdin. +## * Terminate named and wait for it. +## +## Prints status lines starting with tag and colon (think mail header): +## Error: have given up, no name server started +## Running: name server is running, waiting for "quit" +## Other tags: diagnostics info +# + +unset LDPATH CDPATH ENV BASH_ENV +IFS=' ' +PATH=/usr/sbin:/sbin:/usr/bin:/bin +SHELL=/bin/sh +export PATH SHELL + +CONF_FILE=named.conf +INC_FILE=named_inc.conf +PID_FILE=named.pid +LOG_FILE=named.log + +error () { + r=$? + echo "Error: $*" + exit $r +} + +# Check argument: IP address +test :"$1" != : || \ + error "Empty argument 1: IP address !" + +# Check argument: Port number +expr "0$2" + 0 '>' 0 '&' "0$2" + 0 '<' 65536 >/dev/null 2>&1 || \ + error "Invalid argument 2: port number !" + +# Check argument: Work/Zone subdir +test :"$3" != : || \ + error "Empty argument 3: Work/Zone subdir!" +SRCDIR="`dirname "$0"`/$3" +test -d "$SRCDIR" || \ + error "Missing zone directory $SRCDIR !" +test -f "$SRCDIR/$INC_FILE" || \ + error "Missing file: $SRCDIR/$INC_FILE !" + +# Locate named and check version +NAMED=named +for n in /usr/sbin/named /usr/sbin/in.named; do + test -x "$n" && NAMED="$n" +done +NAMED_VER="`"$NAMED" -v 2>&1`" || \ + error "Name server not found!" +NAMED_VER=`echo "$NAMED_VER" | ( read V1 V2 V3 IGNORED && \ + if test :"$V1" = :'in.named'; then + echo "$V2 $V3" + else + echo "$V1 $V2" + fi +)` +case :"$NAMED_VER" in + :'BIND '8.*) NAMED_FG='-f';; + :'BIND '9.*) NAMED_FG='-g';; + :*) error "Name server version is unknown: $NAMED_VER";; +esac + +# Create working directory and cd to it +mkdir "$3" >/dev/null 2>&1 +cd "$3" >/dev/null 2>&1 || \ + error "Can not cd: $3 !" + +# Create $CONF_FILE +cat >"$CONF_FILE" <<-CONF_FILE + # + # $CONF_FILE for $NAMED_VER + # Generated by $0. + # + # Copyright: see $0. + # + logging { + category default { + default_stderr; + }; + }; + CONF_FILE +case :"$NAMED_VER" in + :'BIND '8.*|:'BIND '9.[012]|:'BIND '9.[012].*) + cat >>"$CONF_FILE" <<-CONF_FILE + controls { + inet 127.0.0.1 port 0 allow { !0/32; }; + }; + options { + pid-file "$PID_FILE"; + listen-on port $2 { $1; }; + recursion no; + allow-query { $1; }; + }; + CONF_FILE + ;; + :*) + cat >>"$CONF_FILE" <<-CONF_FILE + controls { + }; + options { + pid-file none; + listen-on port $2 { $1; }; + recursion no; + allow-query { $1; }; + }; + CONF_FILE + ;; +esac +cat >>"$CONF_FILE" <<-CONF_FILE + include "$INC_FILE"; + CONF_FILE + +# Copy all subdir files +( cd "$SRCDIR" && ls -1 ) | while read f; do + cp -fp "$SRCDIR/$f" . +done + +# Start nameserver +echo "Cwd: `pwd`" +echo "Nameserver: $NAMED_VER" +echo "Port: $2" +echo "ZoneDir: $3" +$NAMED $NAMED_FG -c "$CONF_FILE" >"$LOG_FILE" 2>&1 </dev/null & +NAMED=$! +trap "kill -TERM $NAMED >/dev/null 2>&1; wait $NAMED >/dev/null 2>&1" \ + 0 1 2 3 15 +sleep 1 # Give name server time to load its zone files +echo "Running: Enter \`\`quit'' to terminate nameserver[$NAMED]..." +while read LINE; do + test :"$LINE" = :'quit' && break +done +echo "Closing: Terminating nameserver..." |