diff options
author | Internet Software Consortium, Inc <@isc.org> | 2013-06-12 10:32:09 -0600 |
---|---|---|
committer | Internet Software Consortium, Inc <@isc.org> | 2013-06-12 10:32:09 -0600 |
commit | 3f5a3d99feca79b1338646e936a2ee7a5862a43a (patch) | |
tree | 3ac8a23fe024c2dae875bcd9e4ab094a0d871d7c /bin/tests | |
parent | 13d2f77bdd91e5f11c19c7279f0a83672260ef34 (diff) | |
download | bind9-3f5a3d99feca79b1338646e936a2ee7a5862a43a.tar.gz |
9.9.3rc2
Diffstat (limited to 'bin/tests')
23 files changed, 315 insertions, 28 deletions
diff --git a/bin/tests/db_test.c b/bin/tests/db_test.c index d72bf4f3..d3d8b4a5 100644 --- a/bin/tests/db_test.c +++ b/bin/tests/db_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007-2009, 2011-2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -610,10 +610,11 @@ main(int argc, char *argv[]) { } else if (strstr(s, "!V") == s) { DBI_CHECK(dbi); v = atoi(&s[2]); - if (v >= dbi->rcount) { + if (v >= dbi->rcount || v < 0) { printf("unknown open version %d\n", v); continue; - } else if (dbi->rversions[v] == NULL) { + } + if (dbi->rversions[v] == NULL) { printf("version %d is not open\n", v); continue; } diff --git a/bin/tests/shutdown_test.c b/bin/tests/shutdown_test.c index 32ad5fed..e0d6ae76 100644 --- a/bin/tests/shutdown_test.c +++ b/bin/tests/shutdown_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2007, 2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2007, 2011, 2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -174,9 +174,13 @@ main(int argc, char *argv[]) { RUNTIME_CHECK(isc_app_start() == ISC_R_SUCCESS); - if (argc > 1) + if (argc > 1) { workers = atoi(argv[1]); - else + if (workers < 1) + workers = 1; + if (workers > 8192) + workers = 8192; + } else workers = 2; printf("%d workers\n", workers); diff --git a/bin/tests/sock_test.c b/bin/tests/sock_test.c index 8f33a7ed..82a7e775 100644 --- a/bin/tests/sock_test.c +++ b/bin/tests/sock_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2007, 2008, 2012 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2007, 2008, 2012, 2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -263,9 +263,13 @@ main(int argc, char *argv[]) { isc_result_t result; int pf; - if (argc > 1) + if (argc > 1) { workers = atoi(argv[1]); - else + if (workers < 1) + workers = 1; + if (workers > 8192) + workers = 8192; + } else workers = 2; printf("%d workers\n", workers); diff --git a/bin/tests/system/checkzone/tests.sh b/bin/tests/system/checkzone/tests.sh index 757ba2e9..2353c145 100644 --- a/bin/tests/system/checkzone/tests.sh +++ b/bin/tests/system/checkzone/tests.sh @@ -40,4 +40,18 @@ do status=`expr $status + $ret` done +echo "I:checking with spf warnings ($n)" +ret=0 +$CHECKZONE example zones/spf.db > test.out1.$n 2>&1 || ret=1 +$CHECKZONE -T ignore example zones/spf.db > test.out2.$n 2>&1 || ret=1 +grep "'x.example' found SPF/TXT" test.out1.$n > /dev/null || ret=1 +grep "'y.example' found SPF/SPF" test.out1.$n > /dev/null || ret=1 +grep "'example' found SPF/" test.out1.$n > /dev/null && ret=1 +grep "'x.example' found SPF/" test.out2.$n > /dev/null && ret=1 +grep "'y.example' found SPF/" test.out2.$n > /dev/null && ret=1 +grep "'example' found SPF/" test.out2.$n > /dev/null && ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + exit $status diff --git a/bin/tests/system/checkzone/zones/spf.db b/bin/tests/system/checkzone/zones/spf.db new file mode 100644 index 00000000..ffa850ad --- /dev/null +++ b/bin/tests/system/checkzone/zones/spf.db @@ -0,0 +1,21 @@ +; Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC") +; +; Permission to use, copy, modify, and/or distribute this software for any +; purpose with or without fee is hereby granted, provided that the above +; copyright notice and this permission notice appear in all copies. +; +; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +; PERFORMANCE OF THIS SOFTWARE. + +@ 0 IN SOA . . 0 0 0 0 0 +@ 0 IN NS . +@ 0 IN TXT "v=spf1 -all" +@ 0 IN SPF "v=spf1 -all" +x 0 IN TXT "v=spf1" +y 0 IN SPF "v=spf1" +y 0 IN TXT "a non spf record" diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in index b8debdb8..2aadf9fc 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in @@ -63,7 +63,7 @@ SUBDIRS="acl additional allow_query addzone autosign builtin formerr forward glue gost ixfr inline limits logfileconfig lwresd masterfile masterformat metadata notify nsupdate pending pkcs11 redirect resolver rndc rpz rrsetorder rsabigexponent - sortlist smartsign staticstub stub tkey tsig tsiggss unknown + smartsign sortlist spf staticstub stub tkey tsig tsiggss unknown upforwd verify views wildcard xfer xferquota zonechecks" # PERL will be an empty string if no perl interpreter was found. diff --git a/bin/tests/system/dlz/tests.sh b/bin/tests/system/dlz/tests.sh index fd11048d..ce0a36a6 100644 --- a/bin/tests/system/dlz/tests.sh +++ b/bin/tests/system/dlz/tests.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2010-2012 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2010-2013 Internet Systems Consortium, Inc. ("ISC") # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -40,5 +40,35 @@ n=`expr $n + 1` if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` +echo "I:checking DLZ IXFR=2010062899 (less than serial) ($n)" +ret=0 +$DIG $DIGOPTS ixfr=2010062899 example.com @10.53.0.1 +all > dig.out.ns1.test$n +grep "example.com..*IN.IXFR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "example.com..*10.IN.DNAME.example.net." dig.out.ns1.test$n > /dev/null || ret=1 +grep "example.com..*10.IN.NS.example.com." dig.out.ns1.test$n > /dev/null || ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:checking DLZ IXFR=2010062900 (equal serial) ($n)" +ret=0 +$DIG $DIGOPTS ixfr=2010062900 example.com @10.53.0.1 +all > dig.out.ns1.test$n +grep "example.com..*IN.IXFR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "example.com..*10.IN.DNAME.example.net." dig.out.ns1.test$n > /dev/null && ret=1 +grep "example.com..*10.IN.NS.example.com." dig.out.ns1.test$n > /dev/null && ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:checking DLZ IXFR=2010062901 (greater than serial) ($n)" +ret=0 +$DIG $DIGOPTS ixfr=2010062901 example.com @10.53.0.1 +all > dig.out.ns1.test$n +grep "example.com..*IN.IXFR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "example.com..*10.IN.DNAME.example.net." dig.out.ns1.test$n > /dev/null && ret=1 +grep "example.com..*10.IN.NS.example.com." dig.out.ns1.test$n > /dev/null && ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + echo "I:exit status: $status" exit $status diff --git a/bin/tests/system/dlzexternal/tests.sh b/bin/tests/system/dlzexternal/tests.sh index 062a49e1..e8caddcd 100644 --- a/bin/tests/system/dlzexternal/tests.sh +++ b/bin/tests/system/dlzexternal/tests.sh @@ -66,6 +66,7 @@ for i in 0 1 2 3 4 5 6 7 8 9; do ret=0 grep 'dlz_example: shutting down zone example.nil' ns1/named.run > /dev/null 2>&1 || ret=1 [ "$ret" -eq 0 ] && break + sleep 1 done [ "$ret" -eq 0 ] || echo "I:failed" status=`expr $status + $ret` diff --git a/bin/tests/system/redirect/clean.sh b/bin/tests/system/redirect/clean.sh index f043095c..d9648bd4 100644 --- a/bin/tests/system/redirect/clean.sh +++ b/bin/tests/system/redirect/clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2011-2013 Internet Systems Consortium, Inc. ("ISC") # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -25,3 +25,5 @@ rm -f ns1/dsset-nsec3. rm -f */named.memstats rm -f */named.run rm -f dig.out.* random.data +rm -f ns2/*.db +rm -f rndc.out diff --git a/bin/tests/system/redirect/ns2/example.db.in b/bin/tests/system/redirect/ns2/example.db.in new file mode 100644 index 00000000..28cd6461 --- /dev/null +++ b/bin/tests/system/redirect/ns2/example.db.in @@ -0,0 +1,19 @@ +; Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC") +; +; Permission to use, copy, modify, and/or distribute this software for any +; purpose with or without fee is hereby granted, provided that the above +; copyright notice and this permission notice appear in all copies. +; +; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +; PERFORMANCE OF THIS SOFTWARE. + +$TTL 300 ; 5 minutes +@ IN SOA ns.example.net hostmaster.example.net 0 0 0 0 0 +@ NS ns2 +ns2 A 10.53.0.2 +a A 10.53.0.2 diff --git a/bin/tests/system/redirect/ns2/named.conf b/bin/tests/system/redirect/ns2/named.conf index e1d5334e..6f626445 100644 --- a/bin/tests/system/redirect/ns2/named.conf +++ b/bin/tests/system/redirect/ns2/named.conf @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2011, 2013 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -37,6 +37,15 @@ options { }; +key rndc_key { + secret "1234abcd8765"; + algorithm hmac-sha256; +}; + +controls { + inet 10.53.0.2 port 9953 allow { any; } keys { rndc_key; }; +}; + zone "." { type hint; file "../../common/root.hint"; @@ -47,3 +56,8 @@ zone "." { file "redirect.db"; allow-query { !10.53.0.4; any; }; }; + +zone "example.nil" { + type master; + file "example.db"; +}; diff --git a/bin/tests/system/redirect/ns2/redirect.db b/bin/tests/system/redirect/ns2/redirect.db.in index 23f21ea2..81426d7f 100644 --- a/bin/tests/system/redirect/ns2/redirect.db +++ b/bin/tests/system/redirect/ns2/redirect.db.in @@ -1,4 +1,4 @@ -; Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +; Copyright (C) 2011, 2013 Internet Systems Consortium, Inc. ("ISC") ; ; Permission to use, copy, modify, and/or distribute this software for any ; purpose with or without fee is hereby granted, provided that the above @@ -12,8 +12,6 @@ ; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR ; PERFORMANCE OF THIS SOFTWARE. -; $Id: redirect.db,v 1.3 2011/03/01 23:48:07 tbox Exp $ - $TTL 300 @ IN SOA ns.example.net hostmaster.example.net 0 0 0 0 0 @ IN NS ns.example.net diff --git a/bin/tests/system/redirect/setup.sh b/bin/tests/system/redirect/setup.sh index 4a8927ad..94512ec6 100644 --- a/bin/tests/system/redirect/setup.sh +++ b/bin/tests/system/redirect/setup.sh @@ -1,6 +1,6 @@ #!/bin/sh -e # -# Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2011-2013 Internet Systems Consortium, Inc. ("ISC") # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -20,4 +20,6 @@ sh clean.sh ../../../tools/genrandom 400 random.data +cp ns2/redirect.db.in ns2/redirect.db +cp ns2/example.db.in ns2/example.db cd ns1 && sh sign.sh diff --git a/bin/tests/system/redirect/tests.sh b/bin/tests/system/redirect/tests.sh index 5315a064..a51f58b3 100644 --- a/bin/tests/system/redirect/tests.sh +++ b/bin/tests/system/redirect/tests.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2011-2013 Internet Systems Consortium, Inc. ("ISC") # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -332,5 +332,21 @@ n=`expr $n + 1` if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` +echo "I:checking that redirect zones reload correctly" +ret=0 +sed -e 's/0 0 0 0 0/1 0 0 0 0/' < ns2/example.db.in > ns2/example.db +sed -e 's/0 0 0 0 0/1 0 0 0 0/' -e 's/\.1$/.2/' < ns2/redirect.db.in > ns2/redirect.db +$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload > rndc.out || ret=1 +sed 's/^/I:ns2 /' rndc.out +$DIG $DIGOPTS +short @10.53.0.2 soa example.nil > dig.out.ns1.test$n || ret=1 +set -- `cat dig.out.ns1.test$n` +[ $3 = 1 ] || ret=1 +$DIG $DIGOPTS nonexist. @10.53.0.2 -b 10.53.0.2 a > dig.out.ns2.test$n || ret=1 +grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 +grep "100.100.100.2" dig.out.ns2.test$n > /dev/null || ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + echo "I:exit status: $status" exit $status diff --git a/bin/tests/system/spf/clean.sh b/bin/tests/system/spf/clean.sh new file mode 100644 index 00000000..2e3a0eeb --- /dev/null +++ b/bin/tests/system/spf/clean.sh @@ -0,0 +1,16 @@ +# Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +rm -f ns1/named.run +rm -f ns1/named.memstats diff --git a/bin/tests/system/spf/ns1/named.conf b/bin/tests/system/spf/ns1/named.conf new file mode 100644 index 00000000..7d5dcfb0 --- /dev/null +++ b/bin/tests/system/spf/ns1/named.conf @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC") + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +controls { /* empty */ }; + +options { + query-source address 10.53.0.1; + notify-source 10.53.0.1; + transfer-source 10.53.0.1; + port 5300; + pid-file "named.pid"; + listen-on { 10.53.0.1; }; + listen-on-v6 { none; }; + recursion no; + notify yes; + ixfr-from-differences yes; +}; + +zone "spf" { + type master; + file "spf.db"; +}; + +zone "warn" { + type master; + file "spf.db"; + check-spf warn; +}; + +zone "nowarn" { + type master; + file "spf.db"; + check-spf ignore; +}; diff --git a/bin/tests/system/spf/ns1/spf.db b/bin/tests/system/spf/ns1/spf.db new file mode 100644 index 00000000..ffa850ad --- /dev/null +++ b/bin/tests/system/spf/ns1/spf.db @@ -0,0 +1,21 @@ +; Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC") +; +; Permission to use, copy, modify, and/or distribute this software for any +; purpose with or without fee is hereby granted, provided that the above +; copyright notice and this permission notice appear in all copies. +; +; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +; PERFORMANCE OF THIS SOFTWARE. + +@ 0 IN SOA . . 0 0 0 0 0 +@ 0 IN NS . +@ 0 IN TXT "v=spf1 -all" +@ 0 IN SPF "v=spf1 -all" +x 0 IN TXT "v=spf1" +y 0 IN SPF "v=spf1" +y 0 IN TXT "a non spf record" diff --git a/bin/tests/system/spf/tests.sh b/bin/tests/system/spf/tests.sh new file mode 100644 index 00000000..6acd2836 --- /dev/null +++ b/bin/tests/system/spf/tests.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +SYSTEMTESTTOP=.. +. $SYSTEMTESTTOP/conf.sh + +n=1 +status=0 + +echo "I:checking that SPF warnings have been correctly generated ($n)" +ret=0 + +grep "zone spf/IN: loaded serial 0" ns1/named.run > /dev/null || ret=1 +grep "'x.spf' found SPF/TXT" ns1/named.run > /dev/null || ret=1 +grep "'y.spf' found SPF/SPF" ns1/named.run > /dev/null || ret=1 +grep "'spf' found SPF/" ns1/named.run > /dev/null && ret=1 + +grep "zone warn/IN: loaded serial 0" ns1/named.run > /dev/null || ret=1 +grep "'x.warn' found SPF/TXT" ns1/named.run > /dev/null || ret=1 +grep "'y.warn' found SPF/SPF" ns1/named.run > /dev/null || ret=1 +grep "'warn' found SPF/" ns1/named.run > /dev/null && ret=1 + +grep "zone nowarn/IN: loaded serial 0" ns1/named.run > /dev/null || ret=1 +grep "'x.nowarn' found SPF/" ns1/named.run > /dev/null && ret=1 +grep "'y.nowarn' found SPF/" ns1/named.run > /dev/null && ret=1 +grep "'nowarn' found SPF/" ns1/named.run > /dev/null && ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:exit status: $status" +exit $status diff --git a/bin/tests/system/unknown/clean.sh b/bin/tests/system/unknown/clean.sh index 22be4cbc..d86a869b 100644 --- a/bin/tests/system/unknown/clean.sh +++ b/bin/tests/system/unknown/clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2007, 2012, 2013 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2000, 2001 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any @@ -17,7 +17,7 @@ # $Id: clean.sh,v 1.7 2007/09/26 03:22:44 marka Exp $ -rm -f dig.out +rm -f dig.out check.out rm -f */named.memstats rm -f */*.bk rm -f */*.bk.* diff --git a/bin/tests/system/unknown/tests.sh b/bin/tests/system/unknown/tests.sh index 69d78715..55c7ca6d 100644 --- a/bin/tests/system/unknown/tests.sh +++ b/bin/tests/system/unknown/tests.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2004, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2007, 2011-2013 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2000, 2001 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any @@ -179,12 +179,21 @@ echo '"#" "2" "0145"' | diff - dig.out || ret=1 [ $ret = 0 ] || echo "I: failed" status=`expr $status + $ret` -echo "I:check that '"'TXT \# text'"' is not treated as the unknown escape sequence" +echo "I:check that 'TXT \# text' is not treated as the unknown escape sequence" ret=0 $DIG $DIGOPTS @10.53.0.1 +tcp +short txt9.example txt > dig.out echo '"#" "text"' | diff - dig.out || ret=1 [ $ret = 0 ] || echo "I: failed" status=`expr $status + $ret` +echo "I:check that 'TYPE353 \# cat' produces 'not a valid number'" +ret=0 +$CHECKZONE nan.bad zones/nan.bad > check.out 2>&1 +grep "not a valid number" check.out > /dev/null || ret=1 +[ $ret = 0 ] || echo "I: failed" +status=`expr $status + $ret` + + + echo "I:exit status: $status" exit $status diff --git a/bin/tests/system/unknown/zones/nan.bad b/bin/tests/system/unknown/zones/nan.bad new file mode 100644 index 00000000..26d9f37f --- /dev/null +++ b/bin/tests/system/unknown/zones/nan.bad @@ -0,0 +1,15 @@ +; Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC") +; +; Permission to use, copy, modify, and/or distribute this software for any +; purpose with or without fee is hereby granted, provided that the above +; copyright notice and this permission notice appear in all copies. +; +; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +; PERFORMANCE OF THIS SOFTWARE. + +@ 0 IN TYPE353 \# cat 010101010101010101 diff --git a/bin/tests/task_test.c b/bin/tests/task_test.c index e3ff26b5..4a22ca48 100644 --- a/bin/tests/task_test.c +++ b/bin/tests/task_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2007, 2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -69,9 +69,13 @@ main(int argc, char *argv[]) { isc_timer_t *ti1, *ti2; struct isc_interval interval; - if (argc > 1) + if (argc > 1) { workers = atoi(argv[1]); - else + if (workers < 1) + workers = 1; + if (workers > 8192) + workers = 8192; + } else workers = 2; printf("%d workers\n", workers); diff --git a/bin/tests/timer_test.c b/bin/tests/timer_test.c index 2825dc58..06205b7d 100644 --- a/bin/tests/timer_test.c +++ b/bin/tests/timer_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2007, 2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -102,9 +102,13 @@ main(int argc, char *argv[]) { isc_time_t expires, now; isc_interval_t interval; - if (argc > 1) + if (argc > 1) { workers = atoi(argv[1]); - else + if (workers < 1) + workers = 1; + if (workers > 8192) + workers = 8192; + } else workers = 2; printf("%d workers\n", workers); |