diff --git a/CHANGES b/CHANGES
index 2d2b85e6a2..3a250caa29 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4913. [test] Re-implemented older unit tests in bin/tests as ATF,
+ removed the lib/tests unit testing library. [GL #115]
+
4912. [test] Improved the reliability of the 'cds' system test.
[GL #136]
diff --git a/bin/Makefile.in b/bin/Makefile.in
index 835f5f19d7..f0c504a17e 100644
--- a/bin/Makefile.in
+++ b/bin/Makefile.in
@@ -7,14 +7,12 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
-# $Id: Makefile.in,v 1.29 2009/10/05 12:07:08 fdupont Exp $
-
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
-SUBDIRS = named rndc dig delv dnssec tools tests nsupdate \
- check confgen @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@
+SUBDIRS = named rndc dig delv dnssec tools nsupdate check confgen \
+ @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ tests
TARGETS =
@BIND9_MAKE_RULES@
diff --git a/bin/tests/.gitignore b/bin/tests/.gitignore
index cb5d4521d5..fe9052ac52 100644
--- a/bin/tests/.gitignore
+++ b/bin/tests/.gitignore
@@ -3,25 +3,11 @@ genrandom
headerdep_test.sh
nxtify
sdig
-t_journal
*_test
-t_atomic
-t_db
gsstest
-t_dst
-t_hashes
-t_master
-t_mem
-t_names
-t_net
-t_rbt
-t_resolver
-t_sockaddr
conf.sh
dlopen
keycreate
keydelete
gssapi_krb
-t_tasks
-t_timers
makejournal
diff --git a/bin/tests/Makefile.in b/bin/tests/Makefile.in
index 6e312887a2..cf2e1bf0d4 100644
--- a/bin/tests/Makefile.in
+++ b/bin/tests/Makefile.in
@@ -32,238 +32,35 @@ ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
LIBS = @LIBS@
-SUBDIR = atomic db dst master mem hashes names net rbt resolver \
- sockaddr tasks timers system @PKCS11_TOOLS@
-
+SUBDIRS = system @PKCS11_TOOLS@
TESTDIRS = system
# Test programs that are built by default:
# cfg_test is needed for regenerating doc/misc/options
# makejournal is needed by system tests
+# wire_test is needed for fuzz testing
+# other opptional test programs have been moved to ./optional
# Alphabetically
-TARGETS = @XTARGETS@ cfg_test@EXEEXT@ makejournal@EXEEXT@ \
- wire_test@EXEEXT@
+XTARGETS = all_tests
+TARGETS = cfg_test@EXEEXT@ makejournal@EXEEXT@ \
+ wire_test@EXEEXT@ @XTARGETS@
-# All the other tests are optional and not built by default.
-
-# Alphabetically
-XTARGETS = adb_test@EXEEXT@ \
- byaddr_test@EXEEXT@ \
- backtrace_test@EXEEXT@ \
- backtrace_test_nosymtbl@EXEEXT@ \
- byname_test@EXEEXT@ \
- db_test@EXEEXT@ \
- entropy_test@EXEEXT@ \
- entropy2_test@EXEEXT@ \
- hash_test@EXEEXT@ \
- fsaccess_test@EXEEXT@ \
- inter_test@EXEEXT@ \
- keyboard_test@EXEEXT@ \
- lex_test@EXEEXT@ \
- lfsr_test@EXEEXT@ \
- log_test@EXEEXT@ \
- master_test@EXEEXT@ \
- mempool_test@EXEEXT@ \
- name_test@EXEEXT@ \
- nsecify@EXEEXT@ \
- ratelimiter_test@EXEEXT@ \
- rbt_test@EXEEXT@ \
- rwlock_test@EXEEXT@ \
- serial_test@EXEEXT@ \
- shutdown_test@EXEEXT@ \
- sig0_test@EXEEXT@ \
- sock_test@EXEEXT@ \
- sym_test@EXEEXT@ \
- task_test@EXEEXT@ \
- timer_test@EXEEXT@ \
- wire_test@EXEEXT@ \
- zone_test@EXEEXT@
-
-# Alphabetically
-SRCS = cfg_test.c makejournal.c wire_test.c ${XSRCS}
-
-XSRCS = adb_test.c \
- byaddr_test.c \
- backtrace_test.c \
- byname_test.c \
- db_test.c \
- entropy_test.c \
- entropy2_test.c \
- hash_test.c \
- fsaccess_test.c \
- inter_test.c \
- keyboard_test.c \
- lex_test.c \
- lfsr_test.c \
- log_test.c \
- master_test.c \
- mempool_test.c \
- name_test.c \
- nsecify.c \
- ratelimiter_test.c \
- rbt_test.c \
- rwlock_test.c \
- serial_test.c \
- shutdown_test.c \
- sig0_test.c \
- sock_test.c \
- sym_test.c \
- task_test.c \
- timer_test.c \
- wire_test.c \
- zone_test.c
+SRCS = cfg_test.c makejournal.c wire_test.c
@BIND9_MAKE_RULES@
-# disable optimization for backtrace test to get the expected result
-BTTEST_CFLAGS = ${BACKTRACECFLAGS} ${EXT_CFLAGS} ${ALL_CPPFLAGS} -g \
- ${ALWAYS_WARNINGS} ${STD_CWARNINGS} ${CWARNINGS}
+.NOTPARALLEL:
-all_tests: ${XTARGETS}
-
-adb_test@EXEEXT@: adb_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ adb_test.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
-backtrace_test_nosymtbl@EXEEXT@: ${srcdir}/backtrace_test.c ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${BTTEST_CFLAGS} ${LDFLAGS} -o $@ \
- ${srcdir}/backtrace_test.c ${ISCLIBS} ${LIBS}
-
-backtrace_test@EXEEXT@: ${srcdir}/backtrace_test.c backtrace_test_nosymtbl@EXEEXT@
- #first step: create a first symbol table
- rm -f symtbl.c
- if test X${MKSYMTBL_PROGRAM} != X; then \
- ${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
- backtrace_test_nosymtbl@EXEEXT@; else \
- cp ${top_srcdir}/lib/isc/backtrace-emptytbl.c symtbl.c; fi
- #second step: build a binary with the first symbol table
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${BTTEST_CFLAGS} ${LDFLAGS} \
- -o $@0 ${srcdir}/backtrace_test.c symtbl.c \
- ${ISCNOSYMLIBS} ${LIBS}
- rm -f symtbl.c
- #third step: create a second symbol table
- if test X${MKSYMTBL_PROGRAM} != X; then \
- ${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl $@0; else \
- cp ${top_srcdir}/lib/isc/backtrace-emptytbl.c symtbl.c; fi
- #fourth step: build the final binary
- rm -f $@0
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${BTTEST_CFLAGS} ${LDFLAGS} \
- -o $@ ${srcdir}/backtrace_test.c symtbl.c ${ISCNOSYMLIBS} ${LIBS}
- rm -f symtbl.c
-
-nsecify@EXEEXT@: nsecify.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ nsecify.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
-byaddr_test@EXEEXT@: byaddr_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ byaddr_test.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
-byname_test@EXEEXT@: byname_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ byname_test.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
-lex_test@EXEEXT@: lex_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ lex_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-lfsr_test@EXEEXT@: lfsr_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ lfsr_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-log_test@EXEEXT@: log_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ log_test.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
-name_test@EXEEXT@: name_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ name_test.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
-hash_test@EXEEXT@: hash_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ hash_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-entropy_test@EXEEXT@: entropy_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ entropy_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-entropy2_test@EXEEXT@: entropy2_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ entropy2_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-sock_test@EXEEXT@: sock_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ sock_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-sym_test@EXEEXT@: sym_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ sym_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-task_test@EXEEXT@: task_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ task_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-shutdown_test@EXEEXT@: shutdown_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ shutdown_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-timer_test@EXEEXT@: timer_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ timer_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-ratelimiter_test@EXEEXT@: ratelimiter_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ratelimiter_test.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
-rbt_test@EXEEXT@: rbt_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ rbt_test.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
-rwlock_test@EXEEXT@: rwlock_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ rwlock_test.@O@ \
- ${ISCLIBS} ${LIBS}
+.PHONY:
+all_tests:
+ echo "making depend in `pwd`/optional"; \
+ (cd optional; ${MAKE} ${MAKEDEFS} DESTDIR="${DESTDIR}" $@)
wire_test@EXEEXT@: wire_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ wire_test.@O@ \
${DNSLIBS} ${ISCLIBS} ${LIBS}
-master_test@EXEEXT@: master_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ master_test.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
-db_test@EXEEXT@: db_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ db_test.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
-mempool_test@EXEEXT@: mempool_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ mempool_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-serial_test@EXEEXT@: serial_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ serial_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-zone_test@EXEEXT@: zone_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zone_test.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
-fsaccess_test@EXEEXT@: fsaccess_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ fsaccess_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-inter_test@EXEEXT@: inter_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ inter_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-keyboard_test@EXEEXT@: keyboard_test.@O@ ${ISCDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ keyboard_test.@O@ \
- ${ISCLIBS} ${LIBS}
-
-sig0_test@EXEEXT@: sig0_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ sig0_test.@O@ \
- ${DNSLIBS} ${ISCLIBS} ${LIBS}
-
cfg_test@EXEEXT@: cfg_test.@O@ ${ISCCFGDEPLIBS} ${ISCDEPLIBS}
${LIBTOOL_MODE_LINK} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ cfg_test.@O@ \
${ISCCFGLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS}
@@ -276,9 +73,8 @@ distclean::
rm -f headerdep_test.sh
clean distclean::
- rm -f ${TARGETS} ${XTARGETS}
- rm -f t_journal
- rm -f backtrace_test_symtbl.c
+ rm -f ${TARGETS}
+ ( cd optional; $(MAKE) $@)
check: test
diff --git a/bin/tests/atomic/Makefile.in b/bin/tests/atomic/Makefile.in
deleted file mode 100644
index 932a77397d..0000000000
--- a/bin/tests/atomic/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = ${TEST_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES}
-
-CDEFINES =
-CWARNINGS =
-
-ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
-
-ISCDEPLIBS = ../../../lib/isc/libisc.@A@
-
-DEPLIBS = ${ISCDEPLIBS}
-
-LIBS = ${ISCLIBS} @LIBS@
-
-TLIB = ../../../lib/tests/libt_api.@A@
-
-TARGETS = t_atomic@EXEEXT@
-
-SRCS = t_atomic.c
-
-@BIND9_MAKE_RULES@
-
-t_atomic@EXEEXT@: t_atomic.@O@ ${DEPLIBS} ${TLIB}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ t_atomic.@O@ ${TLIB} ${LIBS}
-
-test: t_atomic@EXEEXT@
- -@./t_atomic@EXEEXT@ -c @top_srcdir@/t_config -b @srcdir@ -a
-
-testhelp:
- @./t_atomic@EXEEXT@ -h
-
-clean distclean::
- rm -f ${TARGETS}
diff --git a/bin/tests/atomic/win32/t_atomic.vcxproj.filters.in b/bin/tests/atomic/win32/t_atomic.vcxproj.filters.in
deleted file mode 100644
index 41df97cd0a..0000000000
--- a/bin/tests/atomic/win32/t_atomic.vcxproj.filters.in
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/bin/tests/atomic/win32/t_atomic.vcxproj.in b/bin/tests/atomic/win32/t_atomic.vcxproj.in
deleted file mode 100644
index eed1870a49..0000000000
--- a/bin/tests/atomic/win32/t_atomic.vcxproj.in
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
- Debug
- @PLATFORM@
-
-
- Release
- @PLATFORM@
-
-
-
- {EC6ECB35-58C0-48EC-BAC9-9A652D9406C9}
- Win32Proj
- t_atomic
-
-
-
- Application
- true
- MultiByte
-
-
- Application
- false
- true
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
- true
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
- false
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
-
-
-
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- true
- .\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
- Level3
-
-
- MaxSpeed
- true
- @INTRINSIC@
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- OnlyExplicitInline
- false
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- .\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- false
- true
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- Default
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
-
-
-
-
-
diff --git a/bin/tests/atomic/win32/t_atomic.vcxproj.user b/bin/tests/atomic/win32/t_atomic.vcxproj.user
deleted file mode 100644
index 695b5c78b9..0000000000
--- a/bin/tests/atomic/win32/t_atomic.vcxproj.user
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/bin/tests/b8t.mk b/bin/tests/b8t.mk
deleted file mode 100644
index 9b1a88251b..0000000000
--- a/bin/tests/b8t.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-# $Id: b8t.mk,v 1.11 2007/06/19 23:46:59 tbox Exp $
-
-#
-# bind 8 multi-host make
-# PLATFORM set in the environment by cron
-#
-
-MODULE = bind
-BASE = /build
-BDIR = $(BASE)/$(MODULE)
-RDIR = /proj/build-reports/bind8/hosts/$(PLATFORM)
-SDIR = $(HOME)/b8t/src
-CVSROOT = /proj/cvs/isc
-
-all: clobber populate config build
-
-clobber:
- @echo "CLOBBBER `date`"
- @if test ! -d $(BASE) ; then mkdir -p $(BASE) ; fi
- @rm -fr $(BDIR)
- @echo "DONE `date`"
-
-populate:
- @echo "POPULATE `date`"
- @( cd $(BASE) && tar -xvf $(SDIR)/$(MODULE).tar ) > $(RDIR)/.populate 2>&1
- @echo "DONE `date`"
-
-tarsrc:
- @echo "TARSRC `date`"
- @rm -fr $(SDIR)/$(MODULE)
- @( cd $(SDIR) && cvs -d $(CVSROOT) checkout $(MODULE) )
- @( cd $(SDIR) && tar -cvf $(MODULE).tar $(MODULE) )
- @echo "DONE `date`"
-
-config:
- @echo "CONFIG `date`"
- @( cd $(BDIR)/src && make SRC=$(BDIR)/src DST=$(BDIR)/dst links ) > $(RDIR)/.config 2>&1
- @echo "DONE `date`"
-
-build:
- @echo "BUILD `date`"
- @( cd $(BDIR)/dst && make -k clean depend all ) > $(RDIR)/.build 2>&1
- @echo "DONE `date`"
-
-test:
- @echo "TEST `date`"
- @touch $(RDIR)/.test
- @echo "DONE `date`"
diff --git a/bin/tests/b9t.mk b/bin/tests/b9t.mk
deleted file mode 100644
index 3bd2ae85d4..0000000000
--- a/bin/tests/b9t.mk
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-# $Id: b9t.mk,v 1.13 2007/06/19 23:46:59 tbox Exp $
-
-#
-# makefile to configure, build and test bind9
-# this is run by cron (user wpk) on aa, sol, irix, hp and aix
-# $PLATFORM is set in the environment by cron
-#
-
-BASE = /build
-BDIR = $(BASE)
-MODULE = bind9
-SDIR = $(HOME)/b9t/src
-
-# as it says
-CVSROOT = /proj/cvs/isc
-
-# where the config, build and test output goes
-RDIR = /proj/build-reports/$(MODULE)/hosts/$(PLATFORM)
-
-all: clobber populate config build test
-
-clobber:
- @echo "CLOBBBER `date`"
- @if test ! -d $(BDIR) ; then mkdir -p $(BDIR) > /dev/null 2>&1 ; fi
- @( cd $(BDIR) && rm -fr $(MODULE) )
- @echo "DONE `date`"
-
-populate:
- @echo "POPULATE `date`"
- @( cd $(BDIR) && tar -xvf $(SDIR)/$(MODULE).tar ) > $(RDIR)/.populate 2>&1
- @echo "DONE `date`"
-
-config:
- @echo "CONFIG `date`"
- @( cd $(BDIR)/$(MODULE) && ./configure ) > $(RDIR)/.config 2>&1
- @echo "DONE `date`"
-
-build:
- @echo "BUILD `date`"
- @( cd $(BDIR)/$(MODULE) && $(MAKE) -k all ) > $(RDIR)/.build 2>&1
- @echo "DONE `date`"
-
-test:
- @echo "TEST `date`"
- -@( cd $(BDIR)/$(MODULE)/bin/tests && $(MAKE) test ) > $(RDIR)/.test 2>&1
- @echo "DONE `date`"
-
-tarsrc:
- @echo "TARSRC `date`"
- @rm -fr $(SDIR)/$(MODULE)
- @( cd $(SDIR) && cvs -d $(CVSROOT) checkout $(MODULE) && tar -cvf $(MODULE).tar $(MODULE) )
- @echo "DONE `date`"
-
diff --git a/bin/tests/db/Makefile.in b/bin/tests/db/Makefile.in
deleted file mode 100644
index 3ec4b3542b..0000000000
--- a/bin/tests/db/Makefile.in
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = ${TEST_INCLUDES} ${DNS_INCLUDES} \
- ${ISC_INCLUDES} @DST_OPENSSL_INC@
-
-CDEFINES = @CRYPTO@
-CWARNINGS =
-
-DNSLIBS = ../../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
-ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
-ISCCFGLIBS = ../../../lib/isccfg/libisccfg.@A@
-
-DNSDEPLIBS = ../../../lib/dns/libdns.@A@
-ISCDEPLIBS = ../../../lib/isc/libisc.@A@
-ISCCFGDEPLIBS = ../../../lib/isccfg/libisccfg.@A@
-
-DEPLIBS = ${DNSDEPLIBS} ${ISCCFGDEPLIBS} ${ISCDEPLIBS}
-
-LIBS = ${DNSLIBS} ${ISCCFGLIBS} ${ISCLIBS} @LIBS@
-
-TLIB = ../../../lib/tests/libt_api.@A@
-
-SRCS = t_db.c
-
-TARGETS = t_db@EXEEXT@
-
-@BIND9_MAKE_RULES@
-
-t_db@EXEEXT@: t_db.@O@ ${DEPLIBS} ${TLIB}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ t_db.@O@ ${TLIB} ${LIBS}
-
-test: t_db@EXEEXT@
- -@./t_db@EXEEXT@ -c @top_srcdir@/t_config -b @srcdir@ -a
-
-testhelp:
- @./t_db -h
-
-clean distclean::
- rm -f ${TARGETS}
diff --git a/bin/tests/db/dns_db_class_1.data b/bin/tests/db/dns_db_class_1.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_class_1.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_class_data b/bin/tests/db/dns_db_class_data
deleted file mode 100644
index 55a0cf8fe6..0000000000
--- a/bin/tests/db/dns_db_class_data
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# test data for dns_db_class
-#
-# format:
-# filename class
-#
-#
-dns_db_class_1.data in
-# dns_db_class_1.data any
diff --git a/bin/tests/db/dns_db_closeversion_1.data b/bin/tests/db/dns_db_closeversion_1.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_closeversion_1.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_closeversion_1_data b/bin/tests/db/dns_db_closeversion_1_data
deleted file mode 100644
index 7bfd5b0fd6..0000000000
--- a/bin/tests/db/dns_db_closeversion_1_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_closeversion test 1
-#
-# format:
-# filename type origin class cache new_name new_type existing_name existing_type
-#
-dns_db_closeversion_1.data rbt vix.com. in zone a.b.c.vix.com. A a.vix.com. NS
diff --git a/bin/tests/db/dns_db_closeversion_2.data b/bin/tests/db/dns_db_closeversion_2.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_closeversion_2.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_closeversion_2_data b/bin/tests/db/dns_db_closeversion_2_data
deleted file mode 100644
index e5bcf4da7b..0000000000
--- a/bin/tests/db/dns_db_closeversion_2_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_closeversion test 2
-#
-# format:
-# filename type origin class cache new_name new_type existing_name existing_type
-#
-dns_db_closeversion_1.data rbt vix.com. in zone a.b.c.vix.com. A a.vix.com. NS
diff --git a/bin/tests/db/dns_db_currentversion.data b/bin/tests/db/dns_db_currentversion.data
deleted file mode 100644
index b7cb868bb1..0000000000
--- a/bin/tests/db/dns_db_currentversion.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a.b.c.vix.com. a 1.2.3.4
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_currentversion_data b/bin/tests/db/dns_db_currentversion_data
deleted file mode 100644
index e4a095e0e6..0000000000
--- a/bin/tests/db/dns_db_currentversion_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_currentversion
-#
-# format:
-# filename findname findtype
-#
-dns_db_currentversion.data rbt vix.com. IN zone a.b.c.vix.com. A
diff --git a/bin/tests/db/dns_db_expirenode.data b/bin/tests/db/dns_db_expirenode.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_expirenode.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_expirenode_data b/bin/tests/db/dns_db_expirenode_data
deleted file mode 100644
index f51858a297..0000000000
--- a/bin/tests/db/dns_db_expirenode_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_expirenode
-#
-# format:
-# filename type origin class existing_name existing_type
-#
-dns_db_expirenode.data rbt vix.com. in a.vix.com. 10000 0 ISC_R_NOTFOUND
diff --git a/bin/tests/db/dns_db_find_1.data b/bin/tests/db/dns_db_find_1.data
deleted file mode 100644
index 8cfc69cca2..0000000000
--- a/bin/tests/db/dns_db_find_1.data
+++ /dev/null
@@ -1,12 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
-a.b.c in ns b
diff --git a/bin/tests/db/dns_db_find_10.data b/bin/tests/db/dns_db_find_10.data
deleted file mode 100644
index ca1fc5e76b..0000000000
--- a/bin/tests/db/dns_db_find_10.data
+++ /dev/null
@@ -1,10 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-
-a.b.c in NS ns1.vix.com.
-a.b.c in A 1.2.3.4
diff --git a/bin/tests/db/dns_db_find_10_data b/bin/tests/db/dns_db_find_10_data
deleted file mode 100644
index d1ab1d3b5d..0000000000
--- a/bin/tests/db/dns_db_find_10_data
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# test data for dns_db_find expiration time handling
-#
-# format:
-# dbfile dbtype dborigin dbclass dbcache findname findtype findopts findtime expected_results
-#
-dns_db_find_10.data rbt vix.com. in cache a.b.c.vix.com. NS 0 1010 ISC_R_NOTFOUND
-dns_db_find_10.data rbt vix.com. in cache a.b.c.vix.com. NS 0 0 ISC_R_SUCCESS
diff --git a/bin/tests/db/dns_db_find_1_data b/bin/tests/db/dns_db_find_1_data
deleted file mode 100644
index e1664cfacd..0000000000
--- a/bin/tests/db/dns_db_find_1_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_find best match
-#
-# format:
-# dbfile dbtype dborigin dbclass dbcache findname findtype findopts findtime expected_results
-#
-dns_db_find_1.data rbt vix.com. in zone a.b.c.vix.com. NS DNS_DB_GLUEOK 0 DNS_R_DELEGATION
diff --git a/bin/tests/db/dns_db_find_2.data b/bin/tests/db/dns_db_find_2.data
deleted file mode 100644
index ab4b4356fb..0000000000
--- a/bin/tests/db/dns_db_find_2.data
+++ /dev/null
@@ -1,9 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-fx in ns a.fx.vix.com.
-a.fx in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_find_2_data b/bin/tests/db/dns_db_find_2_data
deleted file mode 100644
index 0e3ffca3b9..0000000000
--- a/bin/tests/db/dns_db_find_2_data
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# test data for dns_db_find DNS_R_GLUE
-#
-# format:
-# dbfile dbtype dborigin dbclass dbcache findname findtype findopts findtime expected_results
-#
-dns_db_find_2.data rbt vix.com. in zone a.fx.vix.com. A DNS_DBFIND_GLUEOK 0 DNS_R_GLUE
-dns_db_find_2.data rbt vix.com. in zone fx.vix.com. NS DNS_DBFIND_GLUEOK 0 DNS_R_GLUE
-dns_db_find_2.data rbt vix.com. in zone a.fx.vix.com. NS DNS_DBFIND_GLUEOK 0 DNS_R_DELEGATION
diff --git a/bin/tests/db/dns_db_find_3.data b/bin/tests/db/dns_db_find_3.data
deleted file mode 100644
index d126e91b96..0000000000
--- a/bin/tests/db/dns_db_find_3.data
+++ /dev/null
@@ -1,10 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a.b.c in ns b
-a.a.b.c in a 10.0.0.1
-b in a 10.0.0.2
diff --git a/bin/tests/db/dns_db_find_3_data b/bin/tests/db/dns_db_find_3_data
deleted file mode 100644
index a8e1223a29..0000000000
--- a/bin/tests/db/dns_db_find_3_data
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# test data for dns_db_find DNS_R_DELAGATION
-#
-# format:
-# dbfile dbtype dborigin dbclass dbcache findname findtype findopts findtime expected_results
-#
-dns_db_find_3.data rbt vix.com. in zone a.b.c.vix.com. NS DNS_DB_GLUEOK 0 DNS_R_DELEGATION
-dns_db_find_3.data rbt vix.com. in zone a.a.b.c.vix.com. NS DNS_DB_GLUEOK 0 DNS_R_DELEGATION
-dns_db_find_3.data rbt vix.com. in zone a.a.b.c.vix.com. A DNS_DB_GLUEOK 0 DNS_R_DELEGATION
diff --git a/bin/tests/db/dns_db_find_4.data b/bin/tests/db/dns_db_find_4.data
deleted file mode 100644
index 4c3b5e9e2e..0000000000
--- a/bin/tests/db/dns_db_find_4.data
+++ /dev/null
@@ -1,9 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a.b.c in ns b
-b.a.b.c in a 10.0.0.2
diff --git a/bin/tests/db/dns_db_find_4_data b/bin/tests/db/dns_db_find_4_data
deleted file mode 100644
index b0326a6985..0000000000
--- a/bin/tests/db/dns_db_find_4_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_find DNS_R_DELEGATION
-#
-# format:
-# dbfile dbtype dborigin dbclass dbcache findname findtype findopts findtime expected_results
-#
-dns_db_find_4.data rbt vix.com. in zone a.b.c.vix.com. ANY 0 0 DNS_R_DELEGATION
diff --git a/bin/tests/db/dns_db_find_5.data b/bin/tests/db/dns_db_find_5.data
deleted file mode 100644
index e33f631a36..0000000000
--- a/bin/tests/db/dns_db_find_5.data
+++ /dev/null
@@ -1,10 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a.b.c in DNAME x.y.z
-a.x.y.z in A 1.2.3.4
-
diff --git a/bin/tests/db/dns_db_find_5_data b/bin/tests/db/dns_db_find_5_data
deleted file mode 100644
index dab47c80f7..0000000000
--- a/bin/tests/db/dns_db_find_5_data
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# test data for dns_db_find DNS_R_DNAME
-#
-# format:
-# dbfile dbtype dborigin dbclass dbcache findname findtype findopts findtime expected_results
-#
-dns_db_find_5.data rbt vix.com. in zone x.a.b.c.vix.com. ANY 0 0 DNS_R_DNAME
-dns_db_find_5.data rbt vix.com. in zone a.a.b.c.vix.com. ANY 0 0 DNS_R_DNAME
diff --git a/bin/tests/db/dns_db_find_6.data b/bin/tests/db/dns_db_find_6.data
deleted file mode 100644
index 108f043ec0..0000000000
--- a/bin/tests/db/dns_db_find_6.data
+++ /dev/null
@@ -1,10 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-exploder in CNAME mx
-mx in A 1.2.3.4
-
diff --git a/bin/tests/db/dns_db_find_6_data b/bin/tests/db/dns_db_find_6_data
deleted file mode 100644
index 47de0e661c..0000000000
--- a/bin/tests/db/dns_db_find_6_data
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# test data for dns_db_find DNS_R_CNAME
-#
-# format:
-# dbfile dbtype dborigin dbclass dbcache findname findtype findopts findtime expected_results
-#
-dns_db_find_6.data rbt vix.com. in zone exploder.vix.com. A 0 0 DNS_R_CNAME
-dns_db_find_6.data rbt vix.com. in zone exploder.vix.com. ANY 0 0 ISC_R_SUCCESS
diff --git a/bin/tests/db/dns_db_find_7.data b/bin/tests/db/dns_db_find_7.data
deleted file mode 100644
index f0ec22bd7d..0000000000
--- a/bin/tests/db/dns_db_find_7.data
+++ /dev/null
@@ -1,12 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-
-a.b.c.d in A 1.2.3.4
-a.b in A 1.2.3.4
-a in NS ns1.vix.com.
-
diff --git a/bin/tests/db/dns_db_find_7_data b/bin/tests/db/dns_db_find_7_data
deleted file mode 100644
index 6592758a49..0000000000
--- a/bin/tests/db/dns_db_find_7_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_find DNS_R_NXDOMAIN
-#
-# format:
-# dbfile dbtype dborigin dbclass dbcache findname findtype findopts findtime expected_results
-#
-dns_db_find_7.data rbt vix.com. in zone a.b.c.vix.com. ANY 0 0 DNS_R_NXDOMAIN
diff --git a/bin/tests/db/dns_db_find_8.data b/bin/tests/db/dns_db_find_8.data
deleted file mode 100644
index 66e61ff3e6..0000000000
--- a/bin/tests/db/dns_db_find_8.data
+++ /dev/null
@@ -1,13 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-
-a.b.c.d in A 1.2.3.4
-a.b.c in A 1.2.3.4
-a.b in A 1.2.3.4
-a in NS ns1.vix.com.
-
diff --git a/bin/tests/db/dns_db_find_8_data b/bin/tests/db/dns_db_find_8_data
deleted file mode 100644
index 4ad0c83cbe..0000000000
--- a/bin/tests/db/dns_db_find_8_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_find DNS_R_NXRRSET
-#
-# format:
-# dbfile dbtype dborigin dbclass dbcache findname findtype findopts findtime expected_results
-#
-dns_db_find_8.data rbt vix.com. in zone a.b.c.vix.com. NS 0 0 DNS_R_NXRRSET
diff --git a/bin/tests/db/dns_db_find_9.data b/bin/tests/db/dns_db_find_9.data
deleted file mode 100644
index 54a6d5f160..0000000000
--- a/bin/tests/db/dns_db_find_9.data
+++ /dev/null
@@ -1,13 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-
-a.b.c.d in NS ns1.vix.com.
-a.b.c in A 1.2.3.4
-a.b in NS ns1.vix.com.
-a in NS ns1.vix.com.
-
diff --git a/bin/tests/db/dns_db_find_9_data b/bin/tests/db/dns_db_find_9_data
deleted file mode 100644
index d80795cf08..0000000000
--- a/bin/tests/db/dns_db_find_9_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_find ISC_R_NOTFOUND
-#
-# format:
-# dbfile dbtype dborigin dbclass dbcache findname findtype findopts findtime expected_results
-#
-dns_db_find_9.data rbt vix.com. in cache a.b.c.vix.com. NS 0 0 ISC_R_NOTFOUND
diff --git a/bin/tests/db/dns_db_findnode_1.data b/bin/tests/db/dns_db_findnode_1.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_findnode_1.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_findnode_1_data b/bin/tests/db/dns_db_findnode_1_data
deleted file mode 100644
index a73c42545b..0000000000
--- a/bin/tests/db/dns_db_findnode_1_data
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# test data for dns_db_findnode, case ISC_R_SUCCESS
-#
-# format:
-# filename type origin class cache existingname rdatatype
-#
-dns_db_findnode_1.data rbt vix.com. in zone a.vix.com. NS ISC_R_SUCCESS
-dns_db_findnode_1.data rbt vix.com. in zone b.vix.com. A ISC_R_SUCCESS
-dns_db_findnode_1.data rbt vix.com. in zone c.vix.com. A ISC_R_NOTFOUND
diff --git a/bin/tests/db/dns_db_findnode_2.data b/bin/tests/db/dns_db_findnode_2.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_findnode_2.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_findnode_2_data b/bin/tests/db/dns_db_findnode_2_data
deleted file mode 100644
index db69d209fc..0000000000
--- a/bin/tests/db/dns_db_findnode_2_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_findnode 2
-#
-# format:
-# filename type origin class cache newname
-#
-dns_db_findnode_2.data rbt vix.com. in zone a.b.c.vix.com.
diff --git a/bin/tests/db/dns_db_iscache_1.data b/bin/tests/db/dns_db_iscache_1.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_iscache_1.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_iscache_1_data b/bin/tests/db/dns_db_iscache_1_data
deleted file mode 100644
index af591f9a19..0000000000
--- a/bin/tests/db/dns_db_iscache_1_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_iscache test 1
-#
-# format:
-# filename db_type origin class
-#
-dns_db_iscache_1.data rbt . in
diff --git a/bin/tests/db/dns_db_iscache_2.data b/bin/tests/db/dns_db_iscache_2.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_iscache_2.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_iscache_2_data b/bin/tests/db/dns_db_iscache_2_data
deleted file mode 100644
index e859ef7ce5..0000000000
--- a/bin/tests/db/dns_db_iscache_2_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_iscache test 1
-#
-# format:
-# filename db_type origin class
-#
-dns_db_iscache_2.data rbt . in
diff --git a/bin/tests/db/dns_db_iszone_1.data b/bin/tests/db/dns_db_iszone_1.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_iszone_1.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_iszone_1_data b/bin/tests/db/dns_db_iszone_1_data
deleted file mode 100644
index 02862d710d..0000000000
--- a/bin/tests/db/dns_db_iszone_1_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_iszone test 1
-#
-# format:
-# filename db_type origin class
-#
-dns_db_iszone_1.data rbt . in
diff --git a/bin/tests/db/dns_db_iszone_2.data b/bin/tests/db/dns_db_iszone_2.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_iszone_2.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_iszone_2_data b/bin/tests/db/dns_db_iszone_2_data
deleted file mode 100644
index 02d3dc277f..0000000000
--- a/bin/tests/db/dns_db_iszone_2_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_iszone test 2
-#
-# format:
-# filename db_type origin class
-#
-dns_db_iszone_2.data rbt . in
diff --git a/bin/tests/db/dns_db_load_1.data b/bin/tests/db/dns_db_load_1.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_load_1.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_load_25.data b/bin/tests/db/dns_db_load_25.data
deleted file mode 100644
index 6e21bdacd4..0000000000
--- a/bin/tests/db/dns_db_load_25.data
+++ /dev/null
@@ -1,6 +0,0 @@
-$TTL 5
-@ IN SOA ns1 hostmaster 1 3600 1200 3600000 3600
-@ IN NS ns1
-ns1 IN A 10.0.0.1
-sub IN SOA ns2 hostmaster 1 3600 1200 3600000 3600
-ns2 IN A 10.0.0.2
diff --git a/bin/tests/db/dns_db_load_data b/bin/tests/db/dns_db_load_data
deleted file mode 100644
index 0684c625aa..0000000000
--- a/bin/tests/db/dns_db_load_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_load
-#
-# format:
-# filename type origin cache class findname expected_result
-#
-dns_db_load_1.data rbt . zone in ISC_R_SUCCESS a. A DNS_R_DELEGATION
diff --git a/bin/tests/db/dns_db_load_soa_not_top b/bin/tests/db/dns_db_load_soa_not_top
deleted file mode 100644
index fbb8dcc61d..0000000000
--- a/bin/tests/db/dns_db_load_soa_not_top
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_load_soa_not_top
-#
-# format:
-# filename type origin cache class findname expected_result
-#
-dns_db_load_25.data rbt . zone in DNS_R_NOTZONETOP a. A DNS_R_DELEGATION
diff --git a/bin/tests/db/dns_db_newversion.data b/bin/tests/db/dns_db_newversion.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_newversion.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_newversion_data b/bin/tests/db/dns_db_newversion_data
deleted file mode 100644
index be0c042974..0000000000
--- a/bin/tests/db/dns_db_newversion_data
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# test data for dns_db_newversion
-#
-# format:
-# filename type origin class cache newname newtype
-#
-dns_db_newversion.data rbt vix.com. in zone a.b.c.vix.com. A
diff --git a/bin/tests/db/dns_db_origin_1.data b/bin/tests/db/dns_db_origin_1.data
deleted file mode 100644
index ab61c9584c..0000000000
--- a/bin/tests/db/dns_db_origin_1.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2.vix.com.
-a in ns ns3.vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/db/dns_db_origin_data b/bin/tests/db/dns_db_origin_data
deleted file mode 100644
index 9c3b458782..0000000000
--- a/bin/tests/db/dns_db_origin_data
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# test data for dns_db_origin
-#
-# format:
-# filename origin
-#
-dns_db_origin_1.data .
-dns_db_origin_1.data vix.com.
diff --git a/bin/tests/db/t_db.c b/bin/tests/db/t_db.c
deleted file mode 100644
index 917fb902df..0000000000
--- a/bin/tests/db/t_db.c
+++ /dev/null
@@ -1,3143 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: t_db.c,v 1.41 2011/03/12 04:59:46 tbox Exp $ */
-
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-static isc_result_t
-t_create(const char *db_type, const char *origin, const char *classname,
- const char *model, isc_mem_t *mctx, dns_db_t **db)
-{
- int len;
- isc_result_t dns_result;
- dns_dbtype_t dbtype;
- isc_textregion_t region;
- isc_buffer_t origin_buffer;
- dns_fixedname_t dns_origin;
- dns_rdataclass_t rdataclass;
-
-
- dbtype = dns_dbtype_zone;
- if (strcasecmp(model, "cache") == 0)
- dbtype = dns_dbtype_cache;
-
- dns_fixedname_init(&dns_origin);
- len = strlen(origin);
- isc_buffer_constinit(&origin_buffer, origin, len);
- isc_buffer_add(&origin_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_origin),
- &origin_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- return(dns_result);
- }
-
- DE_CONST(classname, region.base);
- region.length = strlen(classname);
- dns_result = dns_rdataclass_fromtext(&rdataclass, ®ion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdataclass_fromtext failed %s\n",
- dns_result_totext(dns_result));
- return(dns_result);
- }
-
- dns_result = dns_db_create(mctx, db_type,
- dns_fixedname_name(&dns_origin),
- dbtype, rdataclass, 0, NULL, db);
- if (dns_result != ISC_R_SUCCESS)
- t_info("dns_db_create failed %s\n",
- dns_result_totext(dns_result));
-
- return(dns_result);
-
-}
-
-static int
-t_dns_db_load(char **av) {
- char *filename;
- char *db_type;
- char *origin;
- char *model;
- char *db_class;
- char *expected_load_result;
- char *findname;
- char *find_type;
- char *expected_find_result;
-
- int result;
- int len;
- dns_db_t *db;
- isc_result_t dns_result;
- isc_result_t isc_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_dbnode_t *nodep;
- isc_textregion_t textregion;
- isc_buffer_t findname_buffer;
- dns_fixedname_t dns_findname;
- dns_fixedname_t dns_foundname;
- dns_rdataset_t rdataset;
- dns_rdatatype_t rdatatype;
- dns_dbversion_t *versionp;
- isc_result_t exp_load_result;
- isc_result_t exp_find_result;
-
- db = NULL;
- mctx = NULL;
- ectx = NULL;
- filename = T_ARG(0);
- db_type = T_ARG(1);
- origin = T_ARG(2);
- model = T_ARG(3);
- db_class = T_ARG(4);
- expected_load_result = T_ARG(5);
- findname = T_ARG(6);
- find_type = T_ARG(7);
- expected_find_result = T_ARG(8);
-
- t_info("testing using file %s and name %s\n", filename, findname);
-
- exp_load_result = t_dns_result_fromtext(expected_load_result);
- exp_find_result = t_dns_result_fromtext(expected_find_result);
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
- if (dns_result != ISC_R_SUCCESS) {
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_load(db, filename);
- if (dns_result != exp_load_result) {
- t_info("dns_db_load returned %s, expected %s\n",
- dns_result_totext(dns_result),
- dns_result_totext(exp_load_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
- if (dns_result != ISC_R_SUCCESS) {
- result = T_PASS;
- goto cleanup_db;
- }
-
- dns_fixedname_init(&dns_findname);
- len = strlen(findname);
- isc_buffer_init(&findname_buffer, findname, len);
- isc_buffer_add(&findname_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_findname),
- &findname_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- textregion.base = find_type;
- textregion.length = strlen(find_type);
- dns_result = dns_rdatatype_fromtext(&rdatatype, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatatype_fromtext %s failed %s\n",
- find_type,
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- versionp = NULL;
- dns_fixedname_init(&dns_foundname);
- dns_rdataset_init(&rdataset);
- if (dns_db_iszone(db))
- dns_db_currentversion(db, &versionp);
- nodep = NULL;
-
- dns_result = dns_db_find(db,
- dns_fixedname_name(&dns_findname),
- versionp,
- rdatatype,
- DNS_DBFIND_GLUEOK,
- 0,
- &nodep,
- dns_fixedname_name(&dns_foundname),
- &rdataset, NULL);
-
- if (dns_result != exp_find_result) {
- t_info("dns_db_find returned %s, expected %s\n",
- dns_result_totext(dns_result),
- dns_result_totext(exp_find_result));
- result = T_FAIL;
- } else {
- result = T_PASS;
- }
-
- if (dns_result != ISC_R_NOTFOUND) {
- dns_db_detachnode(db, &nodep);
- if (dns_rdataset_isassociated(&rdataset))
- dns_rdataset_disassociate(&rdataset);
- }
-
- if (dns_db_iszone(db))
- dns_db_closeversion(db, &versionp, ISC_FALSE);
- cleanup_db:
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(result);
-}
-
-static const char *a1 =
- "A call to dns_db_load(db, filename) loads the contents of "
- "the database in filename into db.";
-
-static void
-t1(void) {
- int result;
-
- t_assert("dns_db_load", 1, T_REQUIRED, "%s", a1);
- result = t_eval("dns_db_load_data", t_dns_db_load, 9);
- t_result(result);
-}
-
-
-static const char *a2 =
- "When the database db has cache semantics, a call to "
- "dns_db_iscache(db) returns ISC_TRUE.";
-
-static int
-t_dns_db_zc_x(char *filename, char *db_type, char *origin, char *db_class,
- dns_dbtype_t dbtype, isc_boolean_t(*cf)(dns_db_t *),
- isc_boolean_t exp_result)
-{
- int result;
- int len;
- dns_db_t *db;
- isc_result_t dns_result;
- isc_result_t isc_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_rdataclass_t rdataclass;
- isc_textregion_t textregion;
- isc_buffer_t origin_buffer;
- dns_fixedname_t dns_origin;
-
- db = NULL;
- mctx = NULL;
- ectx = NULL;
-
- t_info("testing using file %s\n", filename);
-
- dns_fixedname_init(&dns_origin);
- len = strlen(origin);
- isc_buffer_init(&origin_buffer, origin, len);
- isc_buffer_add(&origin_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_origin),
- &origin_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- return(T_UNRESOLVED);
- }
-
- textregion.base = db_class;
- textregion.length = strlen(db_class);
- dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdataclass_fromtext failed %s\n",
- dns_result_totext(dns_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_create(mctx, db_type,
- dns_fixedname_name(&dns_origin),
- dbtype, rdataclass, 0, NULL, &db);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_create failed %s\n",
- dns_result_totext(dns_result));
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_load(db, filename);
- if (dns_result == ISC_R_SUCCESS) {
- if ((*cf)(db) == exp_result)
- result = T_PASS;
- else
- result = T_FAIL;
- } else {
- t_info("dns_db_load failed %s\n",
- dns_result_totext(dns_result));
- result = T_FAIL;
- }
-
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(result);
-}
-
-static int
-test_dns_db_zc_x(const char *filename, dns_dbtype_t dbtype,
- isc_boolean_t(*cf)(dns_db_t *), isc_boolean_t exp_result)
-{
-
- FILE *fp;
- char *p;
- int line;
- int cnt;
- int result;
- int nfails;
- int nprobs;
- char *tokens[T_MAXTOKS];
-
- nfails = 0;
- nprobs = 0;
-
- fp = fopen(filename, "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = t_bustline(p, tokens);
- if (cnt == 4) {
- result = t_dns_db_zc_x(tokens[0], /* file */
- tokens[1], /* type */
- tokens[2], /* origin */
- tokens[3], /* class */
- dbtype, /* cache */
- cf, /* check func */
- exp_result);/* expect */
- if (result != T_PASS) {
- if (result == T_FAIL)
- ++nfails;
- else
- ++nprobs;
- }
- } else {
- t_info("bad format in %s at line %d\n",
- filename, line);
- ++nprobs;
- }
-
- (void)free(p);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile %s\n", filename);
- ++nprobs;
- }
-
- result = T_UNRESOLVED;
-
- if (nfails == 0 && nprobs == 0)
- result = T_PASS;
- else if (nfails)
- result = T_FAIL;
-
- return(result);
-}
-
-static void
-t2(void) {
- int result;
-
- t_assert("dns_db_iscache", 2, T_REQUIRED, "%s", a2);
- result = test_dns_db_zc_x("dns_db_iscache_1_data",
- dns_dbtype_cache, dns_db_iscache, ISC_TRUE);
- t_result(result);
-}
-
-
-static const char *a3 =
- "When the database db has zone semantics, a call to "
- "dns_db_iscache(db) returns ISC_FALSE.";
-
-
-static void
-t3(void) {
- int result;
-
- t_assert("dns_db_iscache", 3, T_REQUIRED, "%s", a3);
- result = test_dns_db_zc_x("dns_db_iscache_2_data",
- dns_dbtype_zone, dns_db_iscache, ISC_FALSE);
- t_result(result);
-}
-
-
-static const char *a4 =
- "When the database db has zone semantics, a call to "
- "dns_db_iszone(db) returns ISC_TRUE.";
-
-
-static void
-t4(void) {
- int result;
-
- t_assert("dns_db_iszone", 4, T_REQUIRED, "%s", a4);
- result = test_dns_db_zc_x("dns_db_iszone_1_data",
- dns_dbtype_zone, dns_db_iszone, ISC_TRUE);
- t_result(result);
-}
-
-
-static const char *a5 =
- "When the database db has cache semantics, a call to "
- "dns_db_iszone(db) returns ISC_FALSE.";
-
-static void
-t5(void) {
- int result;
-
- t_assert("dns_db_iszone", 5, T_REQUIRED, "%s", a5);
- result = test_dns_db_zc_x("dns_db_iszone_2_data",
- dns_dbtype_cache, dns_db_iszone, ISC_FALSE);
- t_result(result);
-}
-
-static int
-t_dns_db_origin(char **av) {
-
- char *filename;
- char *origin;
-
- int result;
- int len;
- int order;
- isc_result_t dns_result;
- isc_result_t isc_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_db_t *db;
- dns_fixedname_t dns_origin;
- dns_fixedname_t dns_dborigin;
- isc_buffer_t origin_buffer;
-
- db = NULL;
- mctx = NULL;
- ectx = NULL;
-
- filename = T_ARG(0);
- origin = T_ARG(1);
-
- t_info("testing with database %s and origin %s\n",
- filename, origin);
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = t_create("rbt", origin, "in", "isc_true", mctx, &db);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("t_create failed %s\n",
- dns_result_totext(dns_result));
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
- dns_fixedname_init(&dns_origin);
- dns_fixedname_init(&dns_dborigin);
-
- len = strlen(origin);
- isc_buffer_init(&origin_buffer, origin, len);
- isc_buffer_add(&origin_buffer, len);
-
- dns_result = dns_db_load(db, filename);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_load failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_origin),
- &origin_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
- order = dns_name_compare(dns_fixedname_name(&dns_origin),
- dns_db_origin(db));
- if (order == 0) {
- result = T_PASS;
- } else {
- t_info("dns_name_compare returned %d\n", order);
- result = T_FAIL;
- }
-
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(result);
-
-}
-
-static const char *a6 =
- "A call to dns_db_origin(db) returns the origin of the database.";
-
-static void
-t6(void) {
- int result;
-
- t_assert("dns_db_origin", 6, T_REQUIRED, "%s", a6);
- result = t_eval("dns_db_origin_data", t_dns_db_origin, 2);
- t_result(result);
-}
-
-
-static const char *a7 =
- "A call to dns_db_class(db) returns the class of the database.";
-
-
-#define CLASSBUFLEN 256
-
-static int
-t_dns_db_class(char **av) {
-
- char *filename;
- char *db_class;
-
- int result;
- isc_result_t dns_result;
- isc_result_t isc_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_db_t *db;
- dns_rdataclass_t rdataclass;
- dns_rdataclass_t db_rdataclass;
- isc_textregion_t textregion;
-
- filename = T_ARG(0);
- db_class = T_ARG(1);
- db = NULL;
- mctx = NULL;
- ectx = NULL;
-
- t_info("testing with database %s and class %s\n",
- filename, db_class);
-
- textregion.base = db_class;
- textregion.length = strlen(db_class);
- dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdataclass_fromtext failed %s\n",
- dns_result_totext(dns_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = t_create("rbt", ".", db_class, "isc_true", mctx, &db);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("t_create failed %s\n",
- dns_result_totext(dns_result));
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_load(db, filename);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_load failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- db_rdataclass = dns_db_class(db);
- if (db_rdataclass == rdataclass)
- result = T_PASS;
- else {
- char classbuf[DNS_RDATACLASS_FORMATSIZE];
- dns_rdataclass_format(db_rdataclass,
- classbuf, sizeof(classbuf));
- t_info("dns_db_class returned %s, expected %s\n",
- classbuf, db_class);
- result = T_FAIL;
- }
-
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(result);
-
-}
-static void
-t7(void) {
- int result;
-
- t_assert("dns_db_class", 7, T_REQUIRED, "%s", a7);
- result = t_eval("dns_db_class_data", t_dns_db_class, 2);
- t_result(result);
-}
-
-
-static const char *a8 =
- "A call to dns_db_currentversion() opens the current "
- "version for reading.";
-
-static int
-t_dns_db_currentversion(char **av) {
- char *filename;
- char *db_type;
- char *origin;
- char *db_class;
- char *model;
- char *findname;
- char *findtype;
-
- int result;
- int len;
- dns_db_t *db;
- isc_result_t dns_result;
- isc_result_t isc_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_dbnode_t *nodep;
- isc_textregion_t textregion;
- isc_buffer_t findname_buffer;
- dns_fixedname_t dns_findname;
- dns_fixedname_t dns_foundname;
- dns_rdataset_t rdataset;
- dns_rdatatype_t rdatatype;
- dns_dbversion_t *cversionp;
- dns_dbversion_t *nversionp;
-
- filename = T_ARG(0);
- db_type = T_ARG(1);
- origin = T_ARG(2);
- db_class = T_ARG(3);
- model = T_ARG(4);
- findname = T_ARG(5);
- findtype = T_ARG(6);
- db = NULL;
- mctx = NULL;
- ectx = NULL;
-
- t_info("testing using file %s and name %s\n", filename, findname);
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
- if (dns_result != ISC_R_SUCCESS) {
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_load(db, filename);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_load returned %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_fixedname_init(&dns_findname);
- len = strlen(findname);
- isc_buffer_init(&findname_buffer, findname, len);
- isc_buffer_add(&findname_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_findname),
- &findname_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- textregion.base = findtype;
- textregion.length = strlen(findtype);
- dns_result = dns_rdatatype_fromtext(&rdatatype, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatatype_fromtext %s failed %s\n",
- findtype,
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * find a name we know is there
- */
-
- cversionp = NULL;
- dns_fixedname_init(&dns_foundname);
- dns_rdataset_init(&rdataset);
- dns_db_currentversion(db, &cversionp);
- nodep = NULL;
-
- dns_result = dns_db_find(db,
- dns_fixedname_name(&dns_findname),
- cversionp,
- rdatatype,
- 0,
- 0,
- &nodep,
- dns_fixedname_name(&dns_foundname),
- &rdataset, NULL);
-
- if (dns_result != ISC_R_SUCCESS) {
- t_info("unable to find %s using current version\n", findname);
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * create a new version
- * delete the found rdataset in the new version
- * attempt to find the rdataset again and expect the find to fail
- * close/commit the new version
- * attempt to find the rdataset in the current version and
- * expect the find to succeed
- */
-
- nversionp = NULL;
- dns_result = dns_db_newversion(db, &nversionp);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_newversion failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_rdataset_disassociate(&rdataset);
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * Delete the found rdataset in the new version.
- */
- dns_result = dns_db_deleterdataset(db, nodep, nversionp, rdatatype, 0);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_deleterdataset failed %s\n",
- dns_result_totext(dns_result));
- dns_rdataset_disassociate(&rdataset);
- dns_db_detachnode(db, &nodep);
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * Don't need these now.
- */
- dns_rdataset_disassociate(&rdataset);
- dns_db_detachnode(db, &nodep);
- nodep = NULL;
-
- /*
- * Find the deleted rdataset and expect it to fail.
- */
- dns_result = dns_db_find(db,
- dns_fixedname_name(&dns_findname),
- nversionp,
- rdatatype,
- 0,
- 0,
- &nodep,
- dns_fixedname_name(&dns_foundname),
- &rdataset, NULL);
-
- if ((dns_result != ISC_R_NOTFOUND) && (dns_result != DNS_R_NXDOMAIN)) {
- t_info("unexpectedly found %s using current version\n",
- findname);
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
-
- /*
- * Close/commit the new version.
- */
- dns_db_closeversion(db, &nversionp, ISC_TRUE);
-
- /*
- * Find the deleted rdata in the current version.
- */
- dns_result = dns_db_find(db, dns_fixedname_name(&dns_findname),
- cversionp, rdatatype, DNS_DBFIND_GLUEOK,
- 0, &nodep, dns_fixedname_name(&dns_foundname),
- &rdataset, NULL);
-
- /*
- * And expect it to succeed.
- */
- if (dns_result == ISC_R_SUCCESS) {
- result = T_PASS;
- } else {
- t_info("cound not find %s using current version\n", findname);
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- result = T_FAIL;
- }
-
- dns_db_detachnode(db, &nodep);
- dns_rdataset_disassociate(&rdataset);
-
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
-
- return(result);
-}
-
-static void
-t8(void) {
- int result;
-
- t_assert("dns_db_currentversion", 8, T_REQUIRED, "%s", a8);
- result = t_eval("dns_db_currentversion_data",
- t_dns_db_currentversion, 7);
- t_result(result);
-}
-
-static const char *a9 =
- "A call to dns_db_newversion() opens a new version for "
- "reading and writing.";
-
-static int
-t_dns_db_newversion(char **av) {
-
- char *filename;
- char *db_type;
- char *origin;
- char *db_class;
- char *model;
- char *newname;
- char *newtype;
-
- int result;
- int len;
- int rval;
- dns_db_t *db;
- isc_result_t dns_result;
- isc_result_t isc_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_dbnode_t *nodep;
- dns_dbnode_t *found_nodep;
- isc_textregion_t textregion;
- isc_buffer_t newname_buffer;
- dns_fixedname_t dns_newname;
- dns_fixedname_t dns_foundname;
- dns_rdata_t added_rdata = DNS_RDATA_INIT;
- const char * added_rdata_data;
- dns_rdataset_t added_rdataset;
- dns_rdata_t found_rdata = DNS_RDATA_INIT;
- dns_rdataset_t found_rdataset;
- dns_rdatatype_t rdatatype;
- dns_rdataclass_t rdataclass;
- dns_dbversion_t *nversionp;
- dns_rdatalist_t rdatalist;
-
- filename = T_ARG(0);
- db_type = T_ARG(1);
- origin = T_ARG(2);
- db_class = T_ARG(3);
- model = T_ARG(4);
- newname = T_ARG(5);
- newtype = T_ARG(6);
- db = NULL;
- mctx = NULL;
- ectx = NULL;
-
- /*
- * Open a new version, add some data, commit it,
- * close it, open a new version, and check that changes
- * are present.
- */
-
- t_info("testing using file %s and name %s\n", filename, newname);
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
- if (dns_result != ISC_R_SUCCESS) {
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_load(db, filename);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_load returned %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * Add a new name.
- */
-
- dns_fixedname_init(&dns_newname);
- len = strlen(newname);
- isc_buffer_init(&newname_buffer, newname, len);
- isc_buffer_add(&newname_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_newname),
- &newname_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- nodep = NULL;
- dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_newname),
- ISC_TRUE, &nodep);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_findnode failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * Open a new version and associate some rdata with the new name.
- */
-
- textregion.base = newtype;
- textregion.length = strlen(newtype);
- dns_result = dns_rdatatype_fromtext(&rdatatype, &textregion);
-
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatatype_fromtext %s failed %s\n",
- newtype,
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- textregion.base = db_class;
- textregion.length = strlen(db_class);
- dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdataclass_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_rdata_init(&added_rdata);
- added_rdata_data = "\x10\x00\x00\x01";
- DE_CONST(added_rdata_data, added_rdata.data);
- added_rdata.length = 4;
- added_rdata.rdclass = rdataclass;
- added_rdata.type = rdatatype;
-
- dns_rdatalist_init(&rdatalist);
- rdatalist.type = rdatatype;
- rdatalist.rdclass = rdataclass;
- ISC_LIST_APPEND(rdatalist.rdata, &added_rdata, link);
-
- dns_rdataset_init(&added_rdataset);
- dns_result = dns_rdatalist_tordataset(&rdatalist, &added_rdataset);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatalist_tordataset failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- nversionp = NULL;
- dns_result = dns_db_newversion(db, &nversionp);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_newversion failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_addrdataset(db, nodep, nversionp, 0,
- &added_rdataset, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_addrdataset failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * Close and commit the version.
- */
- dns_db_closeversion(db, &nversionp, ISC_TRUE);
- dns_db_detachnode(db, &nodep);
- if (dns_rdataset_isassociated(&added_rdataset))
- dns_rdataset_disassociate(&added_rdataset);
- nodep = NULL;
-
- /*
- * Open a new version and find the data we added.
- */
- dns_fixedname_init(&dns_foundname);
- dns_rdataset_init(&found_rdataset);
- nversionp = NULL;
- found_nodep = NULL;
- dns_db_newversion(db, &nversionp);
-
- /*
- * Find the recently added name and rdata.
- */
- dns_result = dns_db_find(db, dns_fixedname_name(&dns_newname),
- nversionp, rdatatype, 0, 0, &found_nodep,
- dns_fixedname_name(&dns_foundname),
- &found_rdataset, NULL);
-
- if (dns_result != ISC_R_SUCCESS) {
- /* XXXWPK - NXRRSET ??? reference counts ??? */
- t_info("dns_db_find failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detachnode(db, &found_nodep);
- if (dns_rdataset_isassociated(&found_rdataset))
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
-
- dns_result = dns_rdataset_first(&found_rdataset);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdataset_first failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- if (dns_rdataset_isassociated(&found_rdataset))
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
-
- /*
- * Now make sure its what we expect.
- */
- dns_rdata_init(&found_rdata);
- dns_rdataset_current(&found_rdataset, &found_rdata);
- rval = dns_rdata_compare(&added_rdata, &found_rdata);
- if (rval == 0) {
- result = T_PASS;
- } else {
- t_info("dns_rdata_compare returned %d\n", rval);
- result = T_FAIL;
- }
-
- /*
- * Don't need these now.
- */
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- if (dns_rdataset_isassociated(&found_rdataset))
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_detachnode(db, &found_nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
-
- return(result);
-}
-
-static void
-t9(void) {
- int result;
-
- t_assert("dns_db_newversion", 9, T_REQUIRED, "%s", a9);
- result = t_eval("dns_db_newversion_data", t_dns_db_newversion, 7);
- t_result(result);
-}
-
-static const char *a10 =
- "When versionp points to a read-write version and commit is "
- "ISC_TRUE, a call to dns_db_closeversion(db, versionp, commit) "
- "causes all changes made in the version to take effect, "
- "and returns ISC_R_SUCCESS.";
-
-static int
-t_dns_db_closeversion_1(char **av) {
- char *filename;
- char *db_type;
- char *origin;
- char *db_class;
- char *model;
- char *new_name;
- char *new_type;
- char *existing_name;
- char *existing_type;
-
- int result;
- int len;
- int rval;
- int nfails;
- dns_db_t *db;
- isc_result_t dns_result;
- isc_result_t isc_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_dbnode_t *nodep;
- isc_textregion_t textregion;
- isc_buffer_t name_buffer;
- dns_fixedname_t dns_newname;
- dns_fixedname_t dns_foundname;
- dns_fixedname_t dns_existingname;
- dns_rdata_t added_rdata = DNS_RDATA_INIT;
- const char * added_rdata_data;
- dns_rdataset_t added_rdataset;
- dns_rdata_t found_rdata = DNS_RDATA_INIT;
- dns_rdataset_t found_rdataset;
- dns_rdatatype_t new_rdatatype;
- dns_rdatatype_t existing_rdatatype;
- dns_rdataclass_t rdataclass;
- dns_dbversion_t *nversionp;
- dns_dbversion_t *cversionp;
- dns_rdatalist_t rdatalist;
-
- filename = T_ARG(0);
- db_type = T_ARG(1);
- origin = T_ARG(2);
- db_class = T_ARG(3);
- model = T_ARG(4);
- new_name = T_ARG(5);
- new_type = T_ARG(6);
- existing_name = T_ARG(7);
- existing_type = T_ARG(8);
-
- nfails = 0;
- db = NULL;
- mctx = NULL;
- ectx = NULL;
-
- /*
- * Open a new version, add some data,
- * remove some data, close with commit, open the current
- * version and check that changes are present.
- */
-
- t_info("testing using file %s and name %s\n", filename, new_name);
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
- if (dns_result != ISC_R_SUCCESS) {
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_load(db, filename);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_load returned %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * Remove all rdata for an existing name.
- */
-
- dns_fixedname_init(&dns_existingname);
- len = strlen(existing_name);
- isc_buffer_init(&name_buffer, existing_name, len);
- isc_buffer_add(&name_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_existingname),
- &name_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- textregion.base = existing_type;
- textregion.length = strlen(existing_type);
- dns_result = dns_rdatatype_fromtext(&existing_rdatatype, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatatype_fromtext %s failed %s\n",
- existing_type,
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- nodep = NULL;
- dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_existingname),
- ISC_FALSE, &nodep);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_findnode %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /* open a new version */
- nversionp = NULL;
- dns_result = dns_db_newversion(db, &nversionp);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_newversion failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_deleterdataset(db, nodep, nversionp,
- existing_rdatatype, 0);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_deleterdataset failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * add a new name and associate some rdata with it
- */
-
- dns_db_detachnode(db, &nodep);
- nodep = NULL;
-
- dns_fixedname_init(&dns_newname);
- len = strlen(new_name);
- isc_buffer_init(&name_buffer, new_name, len);
- isc_buffer_add(&name_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_newname),
- &name_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_newname),
- ISC_TRUE, &nodep);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_findnode failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * associate some rdata with the new name
- */
-
- textregion.base = new_type;
- textregion.length = strlen(new_type);
- dns_result = dns_rdatatype_fromtext(&new_rdatatype, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatatype_fromtext %s failed %s\n",
- new_type,
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- textregion.base = db_class;
- textregion.length = strlen(db_class);
- dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdataclass_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_rdata_init(&added_rdata);
- added_rdata_data = "\x10\x00\x00\x01";
- DE_CONST(added_rdata_data, added_rdata.data);
- added_rdata.length = 4;
- added_rdata.rdclass = rdataclass;
- added_rdata.type = new_rdatatype;
-
- dns_rdatalist_init(&rdatalist);
- rdatalist.type = new_rdatatype;
- rdatalist.rdclass = rdataclass;
- ISC_LIST_APPEND(rdatalist.rdata, &added_rdata, link);
-
- dns_rdataset_init(&added_rdataset);
- dns_result = dns_rdatalist_tordataset(&rdatalist, &added_rdataset);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatalist_tordataset failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_addrdataset(db, nodep, nversionp, 0,
- &added_rdataset, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_addrdataset failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /* close and commit the version */
- dns_db_closeversion(db, &nversionp, ISC_TRUE);
- dns_db_detachnode(db, &nodep);
- nodep = NULL;
-
- /* open the current version and check changes */
- dns_fixedname_init(&dns_foundname);
- dns_rdataset_init(&found_rdataset);
- cversionp = NULL;
- dns_db_currentversion(db, &cversionp);
-
- /* find the recently added name and rdata */
- dns_result = dns_db_find(db,
- dns_fixedname_name(&dns_newname),
- cversionp,
- new_rdatatype,
- 0,
- 0,
- &nodep,
- dns_fixedname_name(&dns_foundname),
- &found_rdataset, NULL);
-
- if (dns_result != ISC_R_SUCCESS) {
- /* XXXWPK NXRRSET ??? reference counting ??? */
- t_info("dns_db_find failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detachnode(db, &nodep);
- if (dns_rdataset_isassociated(&found_rdataset))
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
-
- dns_result = dns_rdataset_first(&found_rdataset);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdataset_first failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- if (dns_rdataset_isassociated(&found_rdataset))
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
-
- /*
- * Now make sure its what we expect.
- */
- dns_rdata_init(&found_rdata);
- dns_rdataset_current(&found_rdataset, &found_rdata);
- rval = dns_rdata_compare(&added_rdata, &found_rdata);
- if (rval != 0) {
- t_info("dns_rdata_compare returned %d\n", rval);
- ++nfails;
- }
-
- /*
- * Now check the rdata deletion.
- */
-
- if (dns_rdataset_isassociated(&found_rdataset))
- dns_rdataset_disassociate(&found_rdataset);
- dns_rdataset_init(&found_rdataset);
- dns_db_detachnode(db, &nodep);
- nodep = NULL;
- dns_fixedname_init(&dns_foundname);
-
- dns_result = dns_db_find(db, dns_fixedname_name(&dns_existingname),
- cversionp, existing_rdatatype,
- 0, 0, &nodep,
- dns_fixedname_name(&dns_foundname),
- &found_rdataset, NULL);
-
-
- if ((dns_result != ISC_R_NOTFOUND) && (dns_result != DNS_R_NXDOMAIN)) {
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_detachnode(db, &nodep);
- t_info("dns_db_find %s returned %s\n", existing_name,
- dns_result_totext(dns_result));
- ++nfails;
- }
-
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
-
- if (nfails == 0)
- result = T_PASS;
- else
- result = T_FAIL;
-
- return(result);
-}
-
-static void
-t10(void) {
- int result;
-
- t_assert("dns_db_closeversion", 10, T_REQUIRED, "%s", a10);
- result = t_eval("dns_db_closeversion_1_data",
- t_dns_db_closeversion_1, 9);
- t_result(result);
-}
-
-static const char *a11 =
- "When versionp points to a read-write version and commit is "
- "ISC_FALSE, a call to dns_db_closeversion(db, versionp, commit) "
- "causes all changes made in the version to to be rolled back, "
- "and returns ISC_R_SUCCESS.";
-
-static int
-t_dns_db_closeversion_2(char **av) {
- char *filename;
- char *db_type;
- char *origin;
- char *db_class;
- char *model;
- char *new_name;
- char *new_type;
- char *existing_name;
- char *existing_type;
-
- int result;
- int len;
- int rval;
- int nfails;
- dns_db_t *db;
- isc_result_t dns_result;
- isc_result_t isc_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_dbnode_t *nodep;
- isc_textregion_t textregion;
- isc_buffer_t name_buffer;
- dns_fixedname_t dns_newname;
- dns_fixedname_t dns_foundname;
- dns_fixedname_t dns_existingname;
- dns_rdata_t added_rdata = DNS_RDATA_INIT;
- const char * added_rdata_data;
- dns_rdataset_t added_rdataset;
- dns_rdata_t found_rdata = DNS_RDATA_INIT;
- dns_rdataset_t found_rdataset;
- dns_rdatatype_t new_rdatatype;
- dns_rdatatype_t existing_rdatatype;
- dns_rdataclass_t rdataclass;
- dns_dbversion_t *nversionp;
- dns_dbversion_t *cversionp;
- dns_rdatalist_t rdatalist;
-
- filename = T_ARG(0);
- db_type = T_ARG(1);
- origin = T_ARG(2);
- db_class = T_ARG(3);
- model = T_ARG(4);
- new_name = T_ARG(5);
- new_type = T_ARG(6);
- existing_name = T_ARG(7);
- existing_type = T_ARG(8);
-
- nfails = 0;
- db = NULL;
- mctx = NULL;
- ectx = NULL;
-
- /*
- * Open a new version, add some data,
- * remove some data, close with commit, open the current
- * version and check that changes are present.
- */
-
- t_info("testing using file %s and name %s\n", filename, new_name);
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
- if (dns_result != ISC_R_SUCCESS) {
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_load(db, filename);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_load returned %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * Remove all rdata for an existing name.
- */
-
- dns_fixedname_init(&dns_existingname);
- len = strlen(existing_name);
- isc_buffer_init(&name_buffer, existing_name, len);
- isc_buffer_add(&name_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_existingname),
- &name_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- textregion.base = existing_type;
- textregion.length = strlen(existing_type);
- dns_result = dns_rdatatype_fromtext(&existing_rdatatype, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatatype_fromtext %s failed %s\n",
- existing_type,
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- nodep = NULL;
- dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_existingname),
- ISC_FALSE, &nodep);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_findnode %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * Open a new version.
- */
- nversionp = NULL;
- dns_result = dns_db_newversion(db, &nversionp);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_newversion failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_deleterdataset(db, nodep, nversionp,
- existing_rdatatype, 0);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_deleterdataset failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * add a new name and associate some rdata with it
- */
-
- dns_db_detachnode(db, &nodep);
- nodep = NULL;
-
- dns_fixedname_init(&dns_newname);
- len = strlen(new_name);
- isc_buffer_init(&name_buffer, new_name, len);
- isc_buffer_add(&name_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_newname),
- &name_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_newname),
- ISC_TRUE, &nodep);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_findnode failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- textregion.base = new_type;
- textregion.length = strlen(new_type);
- dns_result = dns_rdatatype_fromtext(&new_rdatatype, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatatype_fromtext %s failed %s\n",
- new_type, dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- textregion.base = db_class;
- textregion.length = strlen(db_class);
- dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdataclass_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_rdata_init(&added_rdata);
- added_rdata_data = "\x10\x00\x00\x01";
- DE_CONST(added_rdata_data, added_rdata.data);
- added_rdata.length = 4;
- added_rdata.rdclass = rdataclass;
- added_rdata.type = new_rdatatype;
-
- dns_rdatalist_init(&rdatalist);
- rdatalist.type = new_rdatatype;
- rdatalist.rdclass = rdataclass;
- ISC_LIST_APPEND(rdatalist.rdata, &added_rdata, link);
-
- dns_rdataset_init(&added_rdataset);
- dns_result = dns_rdatalist_tordataset(&rdatalist, &added_rdataset);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatalist_tordataset failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_addrdataset(db, nodep, nversionp, 0,
- &added_rdataset, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_addrdataset failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * Check that our changes took.
- */
- dns_db_detachnode(db, &nodep);
- nodep = NULL;
- dns_fixedname_init(&dns_foundname);
- dns_rdataset_init(&found_rdataset);
-
- /*
- * Find the recently added name and rdata.
- */
- dns_result = dns_db_find(db, dns_fixedname_name(&dns_newname),
- nversionp, new_rdatatype, 0, 0, &nodep,
- dns_fixedname_name(&dns_foundname),
- &found_rdataset, NULL);
-
- if ((dns_result == ISC_R_NOTFOUND) ||
- (dns_result == DNS_R_NXDOMAIN) ||
- (dns_result == DNS_R_NXRRSET)) {
-
- t_info("dns_db_find failed %s\n",
- dns_result_totext(dns_result));
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detachnode(db, &nodep);
- if (dns_rdataset_isassociated(&found_rdataset))
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
-
- dns_result = dns_rdataset_first(&found_rdataset);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdataset_first failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- if (dns_rdataset_isassociated(&found_rdataset))
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
-
- /*
- * Now make sure its what we expect.
- */
- dns_rdata_init(&found_rdata);
- dns_rdataset_current(&found_rdataset, &found_rdata);
- rval = dns_rdata_compare(&added_rdata, &found_rdata);
- if (rval != 0) {
- t_info("dns_rdata_compare returned %d\n", rval);
- ++nfails;
- }
-
- /*
- * Now check the rdata deletion.
- */
- if (dns_rdataset_isassociated(&found_rdataset))
- dns_rdataset_disassociate(&found_rdataset);
- dns_rdataset_init(&found_rdataset);
- dns_db_detachnode(db, &nodep);
- nodep = NULL;
- dns_fixedname_init(&dns_foundname);
-
- dns_result = dns_db_find(db,
- dns_fixedname_name(&dns_existingname),
- nversionp,
- existing_rdatatype,
- 0,
- 0,
- &nodep,
- dns_fixedname_name(&dns_foundname),
- &found_rdataset, NULL);
-
-
- if ((dns_result != ISC_R_NOTFOUND) && (dns_result != DNS_R_NXDOMAIN)) {
- t_info("dns_db_find %s returned %s\n", existing_name,
- dns_result_totext(dns_result));
- if (dns_rdataset_isassociated(&found_rdataset))
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_detachnode(db, &nodep);
- ++nfails;
- }
-
-
- /*
- * Close the version without a commit.
- */
- dns_db_closeversion(db, &nversionp, ISC_FALSE);
-
- /*
- * Open the current version and check changes.
- */
- dns_fixedname_init(&dns_foundname);
- dns_rdataset_init(&found_rdataset);
- cversionp = NULL;
- dns_db_currentversion(db, &cversionp);
-
- /*
- * Find the recently added name and rdata.
- */
- dns_result = dns_db_find(db,
- dns_fixedname_name(&dns_newname),
- cversionp,
- new_rdatatype,
- 0,
- 0,
- &nodep,
- dns_fixedname_name(&dns_foundname),
- &found_rdataset, NULL);
-
- if ((dns_result != ISC_R_NOTFOUND) && (dns_result != DNS_R_NXDOMAIN)) {
- t_info("dns_db_find %s returned %s\n", new_name,
- dns_result_totext(dns_result));
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_detachnode(db, &nodep);
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
-
- /*
- * Now check the rdata deletion.
- */
- nodep = NULL;
- dns_rdataset_init(&found_rdataset);
- dns_fixedname_init(&dns_foundname);
-
- dns_result = dns_db_find(db, dns_fixedname_name(&dns_existingname),
- cversionp, existing_rdatatype, 0, 0,
- &nodep, dns_fixedname_name(&dns_foundname),
- &found_rdataset, NULL);
-
-
- if ((dns_result == ISC_R_NOTFOUND) ||
- (dns_result == DNS_R_NXDOMAIN) ||
- (dns_result == DNS_R_NXRRSET)) {
-
- t_info("dns_db_find %s returned %s\n", existing_name,
- dns_result_totext(dns_result));
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_detachnode(db, &nodep);
- ++nfails;
- }
-
- dns_db_detachnode(db, &nodep);
- dns_rdataset_disassociate(&found_rdataset);
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
-
- if (nfails == 0)
- result = T_PASS;
- else
- result = T_FAIL;
-
- return(result);
-}
-
-static void
-t11(void) {
- int result;
-
- t_assert("dns_db_closeversion", 11, T_REQUIRED, "%s", a11);
- result = t_eval("dns_db_closeversion_2_data",
- t_dns_db_closeversion_2, 9);
- t_result(result);
-}
-
-static const char *a12 =
- "A call to dns_db_expirenode() marks as stale all records at node "
- "which expire at or before 'now'. If 'now' is zero, then the current "
- "time will be used.";
-
-static int
-t_dns_db_expirenode(char **av) {
- char *filename;
- char *db_type;
- char *origin;
- char *db_class;
- char *existing_name;
- char *node_xtime;
- char *find_xtime;
- char *exp_find_result;
-
- int result;
- int len;
- dns_db_t *db;
- isc_result_t dns_result;
- isc_result_t exp_result;
- isc_result_t isc_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_dbnode_t *nodep;
- isc_buffer_t name_buffer;
- dns_fixedname_t dns_foundname;
- dns_fixedname_t dns_existingname;
- isc_stdtime_t node_expire_time;
- isc_stdtime_t find_expire_time;
- isc_stdtime_t now;
- dns_rdataset_t rdataset;
-
- filename = T_ARG(0);
- db_type = T_ARG(1);
- origin = T_ARG(2);
- db_class = T_ARG(3);
- existing_name = T_ARG(4);
- node_xtime = T_ARG(5);
- find_xtime = T_ARG(6);
- exp_find_result = T_ARG(7);
- mctx = NULL;
- ectx = NULL;
-
- /*
- * Find a node, mark it as stale, do a dns_db_find on the name and
- * expect it to fail.
- */
-
- t_info("testing using file %s and name %s\n", filename, existing_name);
-
- node_expire_time = (isc_stdtime_t) strtol(node_xtime, NULL, 10);
- find_expire_time = (isc_stdtime_t) strtol(find_xtime, NULL, 10);
- exp_result = t_dns_result_fromtext(exp_find_result);
-
- isc_stdtime_get(&now);
-
- dns_fixedname_init(&dns_existingname);
- len = strlen(existing_name);
- isc_buffer_init(&name_buffer, existing_name, len);
- isc_buffer_add(&name_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_existingname),
- &name_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- db = NULL;
- dns_result = t_create(db_type, origin, db_class, "cache", mctx, &db);
- if (dns_result != ISC_R_SUCCESS) {
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_load(db, filename);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_load returned %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- nodep = NULL;
-
- /*
- * Check that the node is there.
- */
- dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_existingname),
- ISC_FALSE, &nodep);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("unable to find %s\n", existing_name);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * Expire it.
- */
- if (node_expire_time != 0)
- node_expire_time += now;
-
- dns_result = dns_db_expirenode(db, nodep, node_expire_time);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_expirenode failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
-
- dns_fixedname_init(&dns_foundname);
- dns_rdataset_init(&rdataset);
- dns_db_detachnode(db, &nodep);
- nodep = NULL;
-
- if (find_expire_time != 0)
- find_expire_time += now;
-
- dns_result = dns_db_find(db,
- dns_fixedname_name(&dns_existingname),
- NULL,
- dns_rdatatype_any,
- 0,
- find_expire_time,
- &nodep,
- dns_fixedname_name(&dns_foundname),
- &rdataset, NULL);
-
- if (dns_result == exp_result) {
- result = T_PASS;
- } else {
- t_info("dns_db_find %s returned %s\n", existing_name,
- dns_result_totext(dns_result));
- result = T_FAIL;
- }
-
- if ((dns_result != ISC_R_NOTFOUND) &&
- (dns_result != DNS_R_NXDOMAIN) &&
- (dns_result != DNS_R_NXRRSET)) {
-
- /*
- * Don't need to disassociate the rdataset because
- * we're searching with dns_rdatatype_any.
- */
- dns_db_detachnode(db, &nodep);
- }
-
-
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
-
- return(result);
-}
-
-static void
-t12(void) {
- int result;
-
- t_assert("dns_db_expirenode", 12, T_REQUIRED, "%s", a12);
- result = t_eval("dns_db_expirenode_data", t_dns_db_expirenode, 8);
- t_result(result);
-}
-
-static const char *a13 =
- "If the node name exists, then a call to "
- "dns_db_findnode(db, name, ISC_FALSE, nodep) initializes nodep "
- "to point to the node and returns ISC_R_SUCCESS, otherwise "
- "it returns ISC_R_NOTFOUND.";
-
-static int
-t_dns_db_findnode_1(char **av) {
- char *filename;
- char *db_type;
- char *origin;
- char *db_class;
- char *model;
- char *find_name;
- char *find_type;
- char *expected_result;
-
- int result;
- int len;
- dns_db_t *db;
- isc_result_t dns_result;
- isc_result_t isc_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_dbnode_t *nodep;
- isc_buffer_t name_buffer;
- dns_rdataset_t rdataset;
- dns_rdatatype_t rdatatype;
- isc_textregion_t textregion;
- dns_fixedname_t dns_name;
- dns_dbversion_t *cversionp;
- isc_result_t exp_result;
-
- filename = T_ARG(0);
- db_type = T_ARG(1);
- origin = T_ARG(2);
- db_class = T_ARG(3);
- model = T_ARG(4);
- find_name = T_ARG(5);
- find_type = T_ARG(6);
- expected_result = T_ARG(7);
-
- db = NULL;
- mctx = NULL;
- ectx = NULL;
-
- t_info("testing using file %s and name %s\n", filename, find_name);
-
- exp_result = t_dns_result_fromtext(expected_result);
-
- textregion.base = find_type;
- textregion.length = strlen(find_type);
- dns_result = dns_rdatatype_fromtext(&rdatatype, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatatype_fromtext %s failed %s\n",
- find_type,
- dns_result_totext(dns_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
- if (dns_result != ISC_R_SUCCESS) {
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_load(db, filename);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_load returned %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- nodep = NULL;
- dns_fixedname_init(&dns_name);
-
- len = strlen(find_name);
- isc_buffer_init(&name_buffer, find_name, len);
- isc_buffer_add(&name_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_name),
- &name_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_name),
- ISC_FALSE, &nodep);
- if (dns_result != exp_result) {
- t_info("dns_db_findnode failed %s\n",
- dns_result_totext(dns_result));
- if (dns_result == ISC_R_SUCCESS)
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
-
- /*
- * if we're expecting the find to succeed and it did,
- * check that the node has been initialized
- * by checking for the specified type of rdata
- * and expecting the search to succeed
- */
-
- if (dns_result == ISC_R_SUCCESS) {
- cversionp = NULL;
- dns_db_currentversion(db, &cversionp);
- dns_rdataset_init(&rdataset);
-
- dns_result = dns_db_findrdataset(db, nodep, cversionp,
- rdatatype, 0,
- 0, &rdataset, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- dns_rdataset_disassociate(&rdataset);
- result = T_PASS;
- } else {
- t_info("dns_db_findrdataset failed %s\n",
- dns_result_totext(dns_result));
- result = T_FAIL;
- }
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detachnode(db, &nodep);
- } else {
- result = T_PASS;
- }
-
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
-
- return(result);
-}
-
-static void
-t13(void) {
- int result;
-
- t_assert("dns_db_findnode", 13, T_REQUIRED, "%s", a13);
- result = t_eval("dns_db_findnode_1_data", t_dns_db_findnode_1, 8);
- t_result(result);
-}
-
-static const char *a14 =
- "If the node name does not exist and create is ISC_TRUE, "
- "then a call to dns_db_findnode(db, name, create, nodep) "
- "creates the node, initializes nodep to point to the node, "
- "and returns ISC_R_SUCCESS.";
-
-static int
-t_dns_db_findnode_2(char **av) {
- char *filename;
- char *db_type;
- char *origin;
- char *db_class;
- char *model;
- char *newname;
-
- int nfails;
- int result;
- int len;
- dns_db_t *db;
- isc_result_t dns_result;
- isc_result_t isc_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_dbnode_t *nodep;
- dns_dbnode_t *newnodep;
- isc_buffer_t name_buffer;
- dns_rdataset_t rdataset;
- dns_fixedname_t dns_name;
- dns_fixedname_t dns_foundname;
- dns_dbversion_t *cversionp;
-
- filename = T_ARG(0);
- db_type = T_ARG(1);
- origin = T_ARG(2);
- db_class = T_ARG(3);
- model = T_ARG(4);
- newname = T_ARG(5);
-
- db = NULL;
- mctx = NULL;
- ectx = NULL;
- nfails = 0;
-
- t_info("testing using file %s and name %s\n", filename, newname);
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- dns_result = t_create(db_type, origin, db_class, model, mctx, &db);
- if (dns_result != ISC_R_SUCCESS) {
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_load(db, filename);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_load returned %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- nodep = NULL;
- dns_fixedname_init(&dns_name);
-
- /*
- * Make sure the name isn't there
- */
- len = strlen(newname);
- isc_buffer_init(&name_buffer, newname, len);
- isc_buffer_add(&name_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_name),
- &name_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext returned %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_name),
- ISC_FALSE, &nodep);
- if ((dns_result != ISC_R_NOTFOUND) &&
- (dns_result != DNS_R_NXDOMAIN) &&
- (dns_result != DNS_R_NXRRSET)) {
- t_info("dns_db_findnode %s\n",
- dns_result_totext(dns_result));
- dns_db_detachnode(db, &nodep);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- /*
- * Add it.
- */
- dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_name),
- ISC_TRUE, &nodep);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_findnode %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_FAIL);
- }
-
- /*
- * Check it.
- */
- newnodep = NULL;
- dns_rdataset_init(&rdataset);
- dns_fixedname_init(&dns_foundname);
- cversionp = NULL;
- dns_db_currentversion(db, &cversionp);
-
- /*
- * First try dns_db_find DNS_R_NXDOMAIN.
- */
- dns_result = dns_db_find(db,
- dns_fixedname_name(&dns_name),
- cversionp,
- dns_rdatatype_any,
- 0,
- 0,
- &newnodep,
- dns_fixedname_name(&dns_foundname),
- &rdataset, NULL);
- if ((dns_result != ISC_R_NOTFOUND) && (dns_result != DNS_R_NXDOMAIN)) {
- dns_db_detachnode(db, &newnodep);
- }
-
- if (dns_result != DNS_R_NXDOMAIN) {
- t_info("dns_db_find %s\n",
- dns_result_totext(dns_result));
- ++nfails;
- }
-
- /*
- * Then try dns_db_findnode ISC_R_SUCCESS.
- */
- dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_name),
- ISC_FALSE, &newnodep);
- t_info("dns_db_findnode %s\n", dns_result_totext(dns_result));
- if (dns_result == ISC_R_SUCCESS) {
- dns_db_detachnode(db, &newnodep);
- } else {
- t_info("dns_db_findnode %s failed %s\n", newname,
- dns_result_totext(dns_result));
- ++nfails;
- }
-
-
- dns_db_detachnode(db, &nodep);
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
-
- if (nfails == 0)
- result = T_PASS;
- else
- result = T_FAIL;
-
- return(result);
-}
-
-static void
-t14(void) {
- int result;
-
- t_assert("dns_db_findnode", 14, T_REQUIRED, "%s", a14);
- result = t_eval("dns_db_findnode_2_data", t_dns_db_findnode_2, 6);
- t_result(result);
-}
-
-static int
-t_dns_db_find_x(char **av) {
- char *dbfile;
- char *dbtype;
- char *dborigin;
- char *dbclass;
- char *dbmodel;
- char *findname;
- char *findtype;
- char *findopts;
- char *findtime;
- char *expected_result;
-
- int result;
- int len;
- int opts;
- dns_db_t *db;
- isc_result_t dns_result;
- isc_result_t isc_result;
- isc_stdtime_t ftime;
- isc_stdtime_t now;
- isc_result_t exp_result;
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- dns_dbnode_t *nodep;
- isc_textregion_t textregion;
- isc_buffer_t findname_buffer;
- dns_fixedname_t dns_findname;
- dns_fixedname_t dns_foundname;
- dns_rdataset_t rdataset;
- dns_rdatatype_t rdatatype;
- dns_dbversion_t *cversionp;
-
- dbfile = T_ARG(0);
- dbtype = T_ARG(1);
- dborigin = T_ARG(2);
- dbclass = T_ARG(3);
- dbmodel = T_ARG(4);
- findname = T_ARG(5);
- findtype = T_ARG(6);
- findopts = T_ARG(7);
- findtime = T_ARG(8);
- expected_result = T_ARG(9);
- db = NULL;
- mctx = NULL;
- ectx = NULL;
- opts = 0;
-
- t_info("testing using %s, name %s, type %s\n", dbfile, findname,
- findtype);
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_hash_create failed %s\n",
- isc_result_totext(isc_result));
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = t_create(dbtype, dborigin, dbclass, dbmodel, mctx, &db);
- if (dns_result != ISC_R_SUCCESS) {
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_db_load(db, dbfile);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_db_load returned %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- exp_result = t_dns_result_fromtext(expected_result);
-
- dns_fixedname_init(&dns_findname);
- len = strlen(findname);
- isc_buffer_init(&findname_buffer, findname, len);
- isc_buffer_add(&findname_buffer, len);
- dns_result = dns_name_fromtext(dns_fixedname_name(&dns_findname),
- &findname_buffer, NULL, 0, NULL);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- textregion.base = findtype;
- textregion.length = strlen(findtype);
- dns_result = dns_rdatatype_fromtext(&rdatatype, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdatatype_fromtext %s failed %s\n",
- findtype,
- dns_result_totext(dns_result));
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
- return(T_UNRESOLVED);
- }
-
- if (strstr(findopts, "DNS_DBFIND_GLUEOK"))
- opts |= DNS_DBFIND_GLUEOK;
- if (strstr(findopts, "DNS_DBFIND_VALIDATEGLUE"))
- opts |= DNS_DBFIND_VALIDATEGLUE;
-
- isc_stdtime_get(&now);
-
- ftime = strtol(findtime, NULL, 10);
- if (ftime != 0)
- ftime += now;
-
- cversionp = NULL;
- dns_fixedname_init(&dns_foundname);
- dns_rdataset_init(&rdataset);
- if (dns_db_iszone(db))
- dns_db_currentversion(db, &cversionp);
- nodep = NULL;
-
- dns_result = dns_db_find(db,
- dns_fixedname_name(&dns_findname),
- cversionp,
- rdatatype,
- opts,
- ftime,
- &nodep,
- dns_fixedname_name(&dns_foundname),
- &rdataset, NULL);
-
- if (dns_result != exp_result) {
- t_info("dns_db_find %s %s unexpectedly returned %s, "
- "expected %s\n",
- findname, findtype, dns_result_totext(dns_result),
- dns_result_totext(exp_result));
- result = T_FAIL;
- } else {
- result = T_PASS;
- }
-
- if ((dns_result != ISC_R_NOTFOUND) && (dns_result != DNS_R_NXDOMAIN)) {
-
- if ((dns_result != DNS_R_NXRRSET) &&
- (dns_result != DNS_R_ZONECUT))
- if (dns_rdataset_isassociated(&rdataset))
- dns_rdataset_disassociate(&rdataset);
- dns_db_detachnode(db, &nodep);
- }
-
- if (dns_db_iszone(db))
- dns_db_closeversion(db, &cversionp, ISC_FALSE);
- dns_db_detach(&db);
- isc_hash_destroy();
- isc_entropy_detach(&ectx);
- isc_mem_destroy(&mctx);
-
- return(result);
-}
-
-static const char *a15 =
- "A call to dns_db_find(db, name, version, type, options, now, ...) "
- "finds the best match for 'name' and 'type' in version 'version' "
- "of 'db'.";
-
-static void
-t15(void) {
- int result;
-
- t_assert("dns_db_find", 15, T_REQUIRED, "%s", a15);
- result = t_eval("dns_db_find_1_data", t_dns_db_find_x, 10);
- t_result(result);
-}
-
-
-static const char *a16 =
- "When the desired node and type were found, but are glue, "
- "and the DNS_DBFIND_GLUEOK option is set, a call to "
- "dns_db_find(db, name, version, type, options, now, ...) "
- "returns DNS_R_GLUE.";
-
-static void
-t16(void) {
- int result;
-
- t_assert("dns_db_find", 16, T_REQUIRED, "%s", a16);
- result = t_eval("dns_db_find_2_data", t_dns_db_find_x, 10);
- t_result(result);
-}
-
-static const char *a17 =
- "A call to dns_db_find() returns DNS_R_DELEGATION when the data "
- "requested is beneath a zone cut.";
-
-static void
-t17(void) {
- int result;
-
- t_assert("dns_db_find", 17, T_REQUIRED, "%s", a17);
- result = t_eval("dns_db_find_3_data", t_dns_db_find_x, 10);
- t_result(result);
-}
-
-static const char *a18 =
- "A call to dns_db_find() returns DNS_R_DELEGATION when type is "
- "dns_rdatatype_any and the desired node is a zone cut.";
-
-static void
-t18(void) {
- int result;
-
- t_assert("dns_db_find", 18, T_REQUIRED, "%s", a18);
- result = t_eval("dns_db_find_4_data", t_dns_db_find_x, 10);
- t_result(result);
-}
-
-static const char *a19 =
- "A call to dns_db_find() returns DNS_R_DNAME when the data "
- "requested is beneath a DNAME.";
-
-static void
-t19(void) {
- int result;
-
- t_assert("dns_db_find", 19, T_REQUIRED, "%s", a19);
- result = t_eval("dns_db_find_5_data", t_dns_db_find_x, 10);
- t_result(result);
-}
-
-static const char *a20 =
- "A call to dns_db_find() returns DNS_R_CNAME when the requested "
- "rdataset was not found but there is a CNAME at the desired name.";
-
-static void
-t20(void) {
- int result;
-
- t_assert("dns_db_find", 20, T_REQUIRED, "%s", a20);
- result = t_eval("dns_db_find_6_data", t_dns_db_find_x, 10);
- t_result(result);
-}
-
-static const char *a21 =
- "A call to dns_db_find() returns DNS_R_NXDOMAIN when name "
- "does not exist.";
-
-static void
-t21(void) {
- int result;
-
- t_assert("dns_db_find", 21, T_REQUIRED, "%s", a21);
- result = t_eval("dns_db_find_7_data", t_dns_db_find_x, 10);
- t_result(result);
-}
-
-static const char *a22 =
- "A call to dns_db_find() returns DNS_R_NXRRSET when "
- "the desired name exists, but the desired type does not.";
-
-static void
-t22(void) {
- int result;
-
- t_assert("dns_db_find", 22, T_REQUIRED, "%s", a22);
- result = t_eval("dns_db_find_8_data", t_dns_db_find_x, 10);
- t_result(result);
-}
-
-static const char *a23 =
- "When db is a cache database, a call to dns_db_find() "
- "returns ISC_R_NOTFOUND when the desired name does not exist, "
- "and no delegation could be found.";
-
-static void
-t23(void) {
- int result;
-
- t_assert("dns_db_find", 23, T_REQUIRED, "%s", a23);
- result = t_eval("dns_db_find_9_data", t_dns_db_find_x, 10);
- t_result(result);
-}
-
-static const char *a24 =
- "When db is a cache database, an rdataset will be found only "
- "if at least one rdataset at the found node expires after 'now'.";
-
-static void
-t24(void) {
- int result;
-
- t_assert("dns_db_find", 24, T_REQUIRED, "%s", a24);
- result = t_eval("dns_db_find_10_data", t_dns_db_find_x, 10);
- t_result(result);
-}
-
-static const char *a25 =
- "A call to dns_db_load(db, filename) returns DNS_R_NOTZONETOP "
- "when the zone data contains a SOA not at the zone apex.";
-
-static void
-t25(void) {
- int result;
-
- t_assert("dns_db_load", 25, T_REQUIRED, "%s", a25);
- result = t_eval("dns_db_load_soa_not_top", t_dns_db_load, 9);
- t_result(result);
-}
-
-testspec_t T_testlist[] = {
- { (PFV) t1, "dns_db_load" },
- { (PFV) t2, "dns_db_iscache" },
- { (PFV) t3, "dns_db_iscache" },
- { (PFV) t4, "dns_db_iszone" },
- { (PFV) t5, "dns_db_iszone" },
- { (PFV) t6, "dns_db_origin" },
- { (PFV) t7, "dns_db_class" },
- { (PFV) t8, "dns_db_currentversion" },
- { (PFV) t9, "dns_db_newversion" },
- { (PFV) t10, "dns_db_closeversion" },
- { (PFV) t11, "dns_db_closeversion" },
- { (PFV) t12, "dns_db_expirenode" },
- { (PFV) t13, "dns_db_findnode" },
- { (PFV) t14, "dns_db_findnode" },
- { (PFV) t15, "dns_db_find" },
- { (PFV) t16, "dns_db_find" },
- { (PFV) t17, "dns_db_find" },
- { (PFV) t18, "dns_db_find" },
- { (PFV) t19, "dns_db_find" },
- { (PFV) t20, "dns_db_find" },
- { (PFV) t21, "dns_db_find" },
- { (PFV) t22, "dns_db_find" },
- { (PFV) t23, "dns_db_find" },
- { (PFV) t24, "dns_db_find" },
- { (PFV) t25, "dns_db_load" },
- { (PFV) 0, NULL }
-};
-
-#ifdef WIN32
-int
-main(int argc, char **argv) {
- t_settests(T_testlist);
- return (t_main(argc, argv));
-}
-#endif
diff --git a/bin/tests/db/win32/t_db.vcxproj.filters.in b/bin/tests/db/win32/t_db.vcxproj.filters.in
deleted file mode 100644
index cc32b99ab3..0000000000
--- a/bin/tests/db/win32/t_db.vcxproj.filters.in
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/bin/tests/db/win32/t_db.vcxproj.in b/bin/tests/db/win32/t_db.vcxproj.in
deleted file mode 100644
index 1a5b1cd18b..0000000000
--- a/bin/tests/db/win32/t_db.vcxproj.in
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
- Debug
- @PLATFORM@
-
-
- Release
- @PLATFORM@
-
-
-
- {E6338E67-3224-4E66-9463-7AD719DA9346}
- Win32Proj
- t_db
-
-
-
- Application
- true
- MultiByte
-
-
- Application
- false
- true
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
- true
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
- false
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
-
-
-
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- true
- .\;..\..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\isccfg\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libdns.lib;libisccfg.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
- Level3
-
-
- MaxSpeed
- true
- @INTRINSIC@
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- OnlyExplicitInline
- false
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- .\;..\..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\isccfg\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- false
- true
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- Default
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libdns.lib;libisccfg.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
-
-
-
-
-
diff --git a/bin/tests/db/win32/t_db.vcxproj.user b/bin/tests/db/win32/t_db.vcxproj.user
deleted file mode 100644
index 695b5c78b9..0000000000
--- a/bin/tests/db/win32/t_db.vcxproj.user
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/bin/tests/dnssec-signzone/run-test.sh b/bin/tests/dnssec-signzone/run-test.sh
deleted file mode 100644
index 9a5d53e908..0000000000
--- a/bin/tests/dnssec-signzone/run-test.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-# $Id: run-test.sh,v 1.3 2009/06/04 02:56:47 tbox Exp $
-
-
-sign="../../dnssec/dnssec-signzone -f signed.zone -o example.com."
-
-signit() {
- rm -f signed.zone
- grep '^;' $zone
- $sign $zone
-}
-
-expect_success() {
- if ! test -f signed.zone ; then
- echo "Error: expected success, but sign failed for $zone."
- else
- echo "Success: Sign succeeded for $zone."
- fi
-}
-
-expect_failure() {
- if test -f signed.zone ; then
- echo "Error: expected failure, but sign succeeded for $zone."
- else
- echo "Success: Sign failed (expected) for $zone"
- fi
-}
-
-zone="test1.zone" ; signit ; expect_success
-zone="test2.zone" ; signit ; expect_failure
-zone="test3.zone" ; signit ; expect_failure
-zone="test4.zone" ; signit ; expect_success
-zone="test5.zone" ; signit ; expect_failure
-zone="test6.zone" ; signit ; expect_failure
-zone="test7.zone" ; signit ; expect_failure
-zone="test8.zone" ; signit ; expect_failure
diff --git a/bin/tests/dst/.gitignore b/bin/tests/dst/.gitignore
deleted file mode 100644
index a46cbd6f20..0000000000
--- a/bin/tests/dst/.gitignore
+++ /dev/null
@@ -1,16 +0,0 @@
-randomfile
-Kdh.+002+18602.key
-Kdh.+002+18602.private
-Kdh.+002+48957.key
-Kdh.+002+48957.private
-Ktest.+001+00002.key
-Ktest.+001+54622.key
-Ktest.+001+54622.private
-Ktest.+003+23616.key
-Ktest.+003+23616.private
-Ktest.+003+49667.key
-dst_2_data
-t2_data_1
-t2_data_2
-t2_dsasig
-t2_rsasig
diff --git a/bin/tests/dst/Kdh.+002+18602.key.in b/bin/tests/dst/Kdh.+002+18602.key.in
deleted file mode 100644
index 09b4cf56aa..0000000000
--- a/bin/tests/dst/Kdh.+002+18602.key.in
+++ /dev/null
@@ -1 +0,0 @@
-dh. IN KEY 0 2 2 AAEBAAAAYIHI/wjtOagNga9GILSoS02IVelgLilPE/TfhtvShsiDAXqb IfxQcj2JkuOnNLs5ttb2WZXWl5/jsSjIxHMwMF2XY4gwt/lwHBf/vgYH r7aIxnKXov1jk9rymTLHGKIOtg==
diff --git a/bin/tests/dst/Kdh.+002+18602.private.in b/bin/tests/dst/Kdh.+002+18602.private.in
deleted file mode 100644
index a2245bfa34..0000000000
--- a/bin/tests/dst/Kdh.+002+18602.private.in
+++ /dev/null
@@ -1,6 +0,0 @@
-Private-key-format: v1.2
-Algorithm: 2 (DH)
-Prime(p): ///////////JD9qiIWjCNMTGYouA3BzRKQJOCIpnzHQCC76mOxObIlFKCHmONATd75UZs806QxswKwpt8l8UN0/hNW1tUcJF5IW1dmJefsb0TELppjo2IP//////////
-Generator(g): Ag==
-Private_value(x): bpdsGQ1jbV3f2CGN/0Pk5KM1MlkFmMryPO1J1zoGn585fRmc9Ygw6l/HKmi2ViiDNorvd9/eV9uyYO6lYZC82R3D7rST1mAqCwbg/8gNE5dXBRbRIIq3qIl6GUYYs8mK
-Public_value(y): gcj/CO05qA2Br0YgtKhLTYhV6WAuKU8T9N+G29KGyIMBepsh/FByPYmS46c0uzm21vZZldaXn+OxKMjEczAwXZdjiDC3+XAcF/++BgevtojGcpei/WOT2vKZMscYog62
diff --git a/bin/tests/dst/Kdh.+002+48957.key.in b/bin/tests/dst/Kdh.+002+48957.key.in
deleted file mode 100644
index 98388295ef..0000000000
--- a/bin/tests/dst/Kdh.+002+48957.key.in
+++ /dev/null
@@ -1 +0,0 @@
-dh. IN KEY 0 2 2 AAEBAAAAYOuaKjyMXYame2F6/ZFdEmXv0a2edB+69PEZgrExA6SJlivn 4KqAsfBHr/+0BCb+7nfWeMDSh2BXnSzWkXF1wMaCHMuz9EleG1gKFKeV Q9gKli88Cb8/jbovWChrGBNp2w==
diff --git a/bin/tests/dst/Kdh.+002+48957.private.in b/bin/tests/dst/Kdh.+002+48957.private.in
deleted file mode 100644
index e191235c89..0000000000
--- a/bin/tests/dst/Kdh.+002+48957.private.in
+++ /dev/null
@@ -1,6 +0,0 @@
-Private-key-format: v1.2
-Algorithm: 2 (DH)
-Prime(p): ///////////JD9qiIWjCNMTGYouA3BzRKQJOCIpnzHQCC76mOxObIlFKCHmONATd75UZs806QxswKwpt8l8UN0/hNW1tUcJF5IW1dmJefsb0TELppjo2IP//////////
-Generator(g): Ag==
-Private_value(x): WJG0moh+QoZV+DYhqW7Z6O6TYpYGtSlN0Ym6JV6VRnzeH69OqMUFivqZorj3a3ofR/4zogNVyy5KLLj2NFTaLGP4Hcvt7uETJik6HrjLMhGf40QPXYgVK57Im0rv88Ca
-Public_value(y): 65oqPIxdhqZ7YXr9kV0SZe/RrZ50H7r08RmCsTEDpImWK+fgqoCx8Eev/7QEJv7ud9Z4wNKHYFedLNaRcXXAxoIcy7P0SV4bWAoUp5VD2AqWLzwJvz+Nui9YKGsYE2nb
diff --git a/bin/tests/dst/Makefile.in b/bin/tests/dst/Makefile.in
deleted file mode 100644
index c408d9a009..0000000000
--- a/bin/tests/dst/Makefile.in
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = ${TEST_INCLUDES} ${DNS_INCLUDES} \
- ${ISC_INCLUDES} @DST_OPENSSL_INC@ @DST_GSSAPI_INC@
-
-CDEFINES = @CRYPTO@ @USE_GSSAPI@
-CWARNINGS =
-
-DNSLIBS = ../../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
-ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
-
-DNSDEPLIBS = ../../../lib/dns/libdns.@A@
-ISCDEPLIBS = ../../../lib/isc/libisc.@A@
-
-DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
-
-LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
-
-TLIB = ../../../lib/tests/libt_api.@A@
-
-TARGETS = dst_test@EXEEXT@ t_dst@EXEEXT@ gsstest@EXEEXT@
-
-SRCS = dst_test.c t_dst.c gsstest.c
-
-@BIND9_MAKE_RULES@
-
-dst_test@EXEEXT@: dst_test.@O@ ${DEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- dst_test.@O@ ${LIBS}
-
-t_dst@EXEEXT@: t_dst.@O@ ${DEPLIBS} ${TLIB}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- t_dst.@O@ ${TLIB} ${LIBS}
-
-gsstest@EXEEXT@: gsstest.@O@ ${DEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- gsstest.@O@ ${LIBS}
-
-test: t_dst@EXEEXT@ randomfile
- ../../tools/genrandom@EXEEXT@ 100 randomfile
- -@ ./t_dst@EXEEXT@ -q 1800 -a
-
-randomfile:
- ../../tools/genrandom@EXEEXT@ 100 randomfile
-
-clean distclean::
- rm -f ${TARGETS} randomfile
-
-distclean::
- rm -f Kdh.+002+18602.key
- rm -f Kdh.+002+18602.private
- rm -f Kdh.+002+48957.key
- rm -f Kdh.+002+48957.private
- rm -f Ktest.+001+00002.key
- rm -f Ktest.+001+54622.key
- rm -f Ktest.+001+54622.private
- rm -f Ktest.+003+23616.key
- rm -f Ktest.+003+23616.private
- rm -f Ktest.+003+49667.key
- rm -f dst_2_data
- rm -f t2_data_1
- rm -f t2_data_2
- rm -f t2_dsasig
- rm -f t2_rsasig
diff --git a/bin/tests/dst/dst_2_data.in b/bin/tests/dst/dst_2_data.in
deleted file mode 100644
index a3030651b3..0000000000
--- a/bin/tests/dst/dst_2_data.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# data for signature verification test
-#
-# format:
-# datafile, sigpath, keyname, keyid, alg, exp_result
-#
-t2_data_1 t2_dsasig test. 23616 DST_ALG_DSA ISC_R_SUCCESS
-t2_data_1 t2_rsasig test. 54622 DST_ALG_RSAMD5 ISC_R_SUCCESS
-# wrong sig
-t2_data_1 t2_dsasig test. 54622 DST_ALG_RSAMD5 !ISC_R_SUCCESS
-# wrong key
-#t2_data_1 t2_dsasig test. 54622 DST_ALG_DSA !ISC_R_SUCCESS
-# wrong alg
-#t2_data_1 t2_dsasig test. 23616 DST_ALG_RSAMD5 !ISC_R_SUCCESS
-# wrong data
-t2_data_2 t2_dsasig test. 23616 DST_ALG_DSA !ISC_R_SUCCESS
diff --git a/bin/tests/dst/t_dst.c b/bin/tests/dst/t_dst.c
deleted file mode 100644
index b702e4c082..0000000000
--- a/bin/tests/dst/t_dst.c
+++ /dev/null
@@ -1,1045 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: t_dst.c,v 1.60 2011/03/17 23:47:29 tbox Exp $ */
-
-#include
-
-#include
-#include
-#include
-#include
-
-#ifndef WIN32
-#include /* XXX */
-#else
-#include
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-
-#include
-
-#ifndef PATH_MAX
-#define PATH_MAX 256
-#endif
-
-/*
- * Adapted from the original dst_test.c program.
- */
-
-static void
-cleandir(char *path) {
- isc_dir_t dir;
- char fullname[PATH_MAX + 1];
- size_t l;
- isc_result_t ret;
-
- isc_dir_init(&dir);
- ret = isc_dir_open(&dir, path);
- if (ret != ISC_R_SUCCESS) {
- t_info("isc_dir_open(%s) failed %s\n",
- path, isc_result_totext(ret));
- return;
- }
-
- while (isc_dir_read(&dir) == ISC_R_SUCCESS) {
- if (!strcmp(dir.entry.name, "."))
- continue;
- if (!strcmp(dir.entry.name, ".."))
- continue;
- (void)strlcpy(fullname, path, sizeof(fullname));
- (void)strlcat(fullname, "/", sizeof(fullname));
- l = strlcat(fullname, dir.entry.name, sizeof(fullname));
- if (l < sizeof(fullname)) {
- if (remove(fullname))
- t_info("remove(%s) failed %d\n", fullname,
- errno);
- } else
- t_info("unable to remove '%s/%s': path too long\n",
- path, dir.entry.name);
-
- }
- isc_dir_close(&dir);
- if (rmdir(path))
- t_info("rmdir(%s) failed %d\n", path, errno);
-
- return;
-}
-
-static void
-use(dst_key_t *key, isc_mem_t *mctx, isc_result_t exp_result, int *nfails) {
-
- isc_result_t ret;
- const char *data = "This is some data";
- unsigned char sig[512];
- isc_buffer_t databuf, sigbuf;
- isc_region_t datareg, sigreg;
- dst_context_t *ctx = NULL;
-
- isc_buffer_init(&sigbuf, sig, sizeof(sig));
- isc_buffer_constinit(&databuf, data, strlen(data));
- isc_buffer_add(&databuf, strlen(data));
- isc_buffer_usedregion(&databuf, &datareg);
-
- ret = dst_context_create3(key, mctx,
- DNS_LOGCATEGORY_GENERAL, ISC_TRUE, &ctx);
- if (ret != exp_result) {
- t_info("dst_context_create(%d) returned (%s) expected (%s)\n",
- dst_key_alg(key), dst_result_totext(ret),
- dst_result_totext(exp_result));
- ++*nfails;
- return;
- }
- if (exp_result != ISC_R_SUCCESS)
- return;
- ret = dst_context_adddata(ctx, &datareg);
- if (ret != ISC_R_SUCCESS) {
- t_info("dst_context_adddata(%d) returned (%s)\n",
- dst_key_alg(key), dst_result_totext(ret));
- ++*nfails;
- dst_context_destroy(&ctx);
- return;
- }
- ret = dst_context_sign(ctx, &sigbuf);
- if (ret != ISC_R_SUCCESS) {
- t_info("dst_context_sign(%d) returned (%s)\n",
- dst_key_alg(key), dst_result_totext(ret));
- ++*nfails;
- dst_context_destroy(&ctx);
- return;
- }
- dst_context_destroy(&ctx);
-
- isc_buffer_remainingregion(&sigbuf, &sigreg);
- ret = dst_context_create3(key, mctx,
- DNS_LOGCATEGORY_GENERAL, ISC_FALSE, &ctx);
- if (ret != ISC_R_SUCCESS) {
- t_info("dst_context_create(%d) returned (%s)\n",
- dst_key_alg(key), dst_result_totext(ret));
- ++*nfails;
- return;
- }
- ret = dst_context_adddata(ctx, &datareg);
- if (ret != ISC_R_SUCCESS) {
- t_info("dst_context_adddata(%d) returned (%s)\n",
- dst_key_alg(key), dst_result_totext(ret));
- ++*nfails;
- dst_context_destroy(&ctx);
- return;
- }
- ret = dst_context_verify(ctx, &sigreg);
- if (ret != exp_result) {
- t_info("dst_context_verify(%d) returned (%s) expected (%s)\n",
- dst_key_alg(key), dst_result_totext(ret),
- dst_result_totext(exp_result));
- ++*nfails;
- dst_context_destroy(&ctx);
- return;
- }
- dst_context_destroy(&ctx);
-}
-
-static void
-dh(dns_name_t *name1, int id1, dns_name_t *name2, int id2, isc_mem_t *mctx,
- isc_result_t exp_result, int *nfails, int *nprobs)
-{
- dst_key_t *key1 = NULL, *key2 = NULL;
- isc_result_t ret;
- char current[PATH_MAX + 1];
- char tmp[PATH_MAX + 1];
- char *p;
- int alg = DST_ALG_DH;
- int type = DST_TYPE_PUBLIC|DST_TYPE_PRIVATE|DST_TYPE_KEY;
- unsigned char array1[1024], array2[1024];
- isc_buffer_t b1, b2;
- isc_region_t r1, r2;
-
- UNUSED(exp_result);
-
- p = getcwd(current, PATH_MAX);;
- if (p == NULL) {
- t_info("getcwd failed %d\n", errno);
- ++*nprobs;
- goto cleanup;
- }
-
- ret = dst_key_fromfile(name1, id1, alg, type, current, mctx, &key1);
- if (ret != ISC_R_SUCCESS) {
- t_info("dst_key_fromfile(%d) returned: %s\n",
- alg, dst_result_totext(ret));
- ++*nfails;
- goto cleanup;
- }
-
- ret = dst_key_fromfile(name2, id2, alg, type, current, mctx, &key2);
- if (ret != ISC_R_SUCCESS) {
- t_info("dst_key_fromfile(%d) returned: %s\n",
- alg, dst_result_totext(ret));
- ++*nfails;
- goto cleanup;
- }
-
-#ifndef WIN32
- ret = isc_file_mktemplate("/tmp/", tmp, sizeof(tmp));
-#else
- ret = isc_file_mktemplate(getenv("TEMP"), tmp, sizeof(tmp));
-#endif
- if (ret != ISC_R_SUCCESS) {
- t_info("isc_file_mktemplate failed %s\n",
- isc_result_totext(ret));
- ++*nprobs;
- goto cleanup;
- }
-
- ret = isc_dir_createunique(tmp);
- if (ret != ISC_R_SUCCESS) {
- t_info("isc_dir_createunique failed %s\n",
- isc_result_totext(ret));
- ++*nprobs;
- goto cleanup;
- }
-
- ret = dst_key_tofile(key1, type, tmp);
- if (ret != 0) {
- t_info("dst_key_tofile(%d) returned: %s\n",
- alg, dst_result_totext(ret));
- ++*nfails;
- goto cleanup;
- }
-
- ret = dst_key_tofile(key2, type, tmp);
- if (ret != 0) {
- t_info("dst_key_tofile(%d) returned: %s\n",
- alg, dst_result_totext(ret));
- ++*nfails;
- goto cleanup;
- }
-
- cleandir(tmp);
-
- isc_buffer_init(&b1, array1, sizeof(array1));
- ret = dst_key_computesecret(key1, key2, &b1);
- if (ret != 0) {
- t_info("dst_computesecret() returned: %s\n",
- dst_result_totext(ret));
- ++*nfails;
- goto cleanup;
- }
-
- isc_buffer_init(&b2, array2, sizeof(array2));
- ret = dst_key_computesecret(key2, key1, &b2);
- if (ret != 0) {
- t_info("dst_computesecret() returned: %s\n",
- dst_result_totext(ret));
- ++*nfails;
- goto cleanup;
- }
-
- isc_buffer_usedregion(&b1, &r1);
- isc_buffer_usedregion(&b2, &r2);
- if (r1.length != r2.length || memcmp(r1.base, r2.base, r1.length) != 0)
- {
- t_info("computed secrets don't match\n");
- ++*nfails;
- goto cleanup;
- }
-
- cleanup:
- if (key1 != NULL)
- dst_key_free(&key1);
- if (key2 != NULL)
- dst_key_free(&key2);
-}
-
-static void
-io(dns_name_t *name, isc_uint16_t id, isc_uint16_t alg, int type,
- isc_mem_t *mctx, isc_result_t exp_result, int *nfails, int *nprobs)
-{
- dst_key_t *key = NULL;
- isc_result_t ret;
- char current[PATH_MAX + 1];
- char tmp[PATH_MAX + 1];
- char *p;
-
- p = getcwd(current, PATH_MAX);;
- if (p == NULL) {
- t_info("getcwd failed %d\n", errno);
- ++*nprobs;
- goto failure;
- }
-
- ret = dst_key_fromfile(name, id, alg, type, current, mctx, &key);
- if (ret != ISC_R_SUCCESS) {
- t_info("dst_key_fromfile(%d) returned: %s\n",
- alg, dst_result_totext(ret));
- ++*nfails;
- goto failure;
- }
-
- if (dst_key_id(key) != id) {
- t_info("key ID incorrect\n");
- ++*nfails;
- goto failure;
- }
-
- if (dst_key_alg(key) != alg) {
- t_info("key algorithm incorrect\n");
- ++*nfails;
- goto failure;
- }
-
- if (dst_key_getttl(key) != 0) {
- t_info("initial key TTL incorrect\n");
- ++*nfails;
- goto failure;
- }
-
-#ifndef WIN32
- ret = isc_file_mktemplate("/tmp/", tmp, sizeof(tmp));
-#else
- ret = isc_file_mktemplate(getenv("TEMP"), tmp, sizeof(tmp));
-#endif
- if (ret != ISC_R_SUCCESS) {
- t_info("isc_file_mktemplate failed %s\n",
- isc_result_totext(ret));
- ++*nprobs;
- goto failure;
- }
-
- ret = isc_dir_createunique(tmp);
- if (ret != ISC_R_SUCCESS) {
- t_info("mkdir failed %d\n", errno);
- ++*nprobs;
- goto failure;
- }
-
- ret = dst_key_tofile(key, type, tmp);
- if (ret != 0) {
- t_info("dst_key_tofile(%d) returned: %s\n",
- alg, dst_result_totext(ret));
- ++*nfails;
- goto failure;
- }
-
- if (dst_key_alg(key) != DST_ALG_DH)
- use(key, mctx, exp_result, nfails);
-
- /*
- * Skip the rest of this test if we weren't expecting
- * the read to be successful.
- */
- if (exp_result != ISC_R_SUCCESS)
- goto cleanup;
-
- dst_key_setttl(key, 3600);
- ret = dst_key_tofile(key, type, tmp);
- if (ret != 0) {
- t_info("dst_key_tofile(%d) returned: %s\n",
- alg, dst_result_totext(ret));
- ++*nfails;
- goto failure;
- }
-
- /* Reread key to confirm TTL was changed */
- dst_key_free(&key);
- ret = dst_key_fromfile(name, id, alg, type, tmp, mctx, &key);
- if (ret != ISC_R_SUCCESS) {
- t_info("dst_key_fromfile(%d) returned: %s\n",
- alg, dst_result_totext(ret));
- ++*nfails;
- goto failure;
- }
-
- if (dst_key_getttl(key) != 3600) {
- t_info("modified key TTL incorrect\n");
- ++*nfails;
- goto failure;
- }
-
- cleanup:
- cleandir(tmp);
-
- failure:
- if (key != NULL)
- dst_key_free(&key);
-}
-
-static void
-generate(int alg, isc_mem_t *mctx, int size, int *nfails) {
- isc_result_t ret;
- dst_key_t *key = NULL;
-
- ret = dst_key_generate(dns_rootname, alg, size, 0, 0, 0,
- dns_rdataclass_in, mctx, &key);
- if (ret != ISC_R_SUCCESS) {
- t_info("dst_key_generate(%d) returned: %s\n", alg,
- dst_result_totext(ret));
- ++*nfails;
- goto cleanup;
- }
-
- if (alg != DST_ALG_DH)
- use(key, mctx, ISC_R_SUCCESS, nfails);
- cleanup:
- if (key != NULL)
- dst_key_free(&key);
-}
-
-#define DBUFSIZ 25
-
-static const char *a1 =
- "the dst module provides the capability to "
- "generate, store and retrieve public and private keys, "
- "sign and verify data using the RSA, DSA and MD5 algorithms, "
- "and compute Diffie-Hellman shared secrets.";
-static void
-t1(void) {
- isc_mem_t *mctx;
- isc_entropy_t *ectx;
- int nfails;
- int nprobs;
- int result;
- isc_result_t isc_result;
- dns_fixedname_t fname;
- dns_name_t *name;
- isc_buffer_t b;
-
- t_assert("dst", 1, T_REQUIRED, "%s", a1);
-
- nfails = 0;
- nprobs = 0;
- mctx = NULL;
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- t_result(T_UNRESOLVED);
- return;
- }
- ectx = NULL;
- isc_result = isc_entropy_create(mctx, &ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- t_result(T_UNRESOLVED);
- return;
- }
- isc_result = isc_entropy_createfilesource(ectx, "randomfile");
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- t_result(T_UNRESOLVED);
- return;
- }
- isc_result = dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("dst_lib_init failed %s\n",
- isc_result_totext(isc_result));
- t_result(T_UNRESOLVED);
- return;
- }
-
- if (!dst_algorithm_supported(DST_ALG_RSAMD5)) {
- dst_lib_destroy();
- t_info("library built without crypto support\n");
- t_result(T_SKIPPED);
- return;
- }
-
- t_info("testing use of stored keys [1]\n");
-
- dns_fixedname_init(&fname);
- name = dns_fixedname_name(&fname);
- isc_buffer_constinit(&b, "test.", 5);
- isc_buffer_add(&b, 5);
- isc_result = dns_name_fromtext(name, &b, NULL, 0, NULL);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- isc_result_totext(isc_result));
- t_result(T_UNRESOLVED);
- return;
- }
- io(name, 23616, DST_ALG_DSA, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC,
- mctx, ISC_R_SUCCESS, &nfails, &nprobs);
- t_info("testing use of stored keys [2]\n");
- io(name, 54622, DST_ALG_RSAMD5, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC,
- mctx, ISC_R_SUCCESS, &nfails, &nprobs);
-
- t_info("testing use of stored keys [3]\n");
- io(name, 49667, DST_ALG_DSA, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC,
- mctx, DST_R_NULLKEY, &nfails, &nprobs);
- t_info("testing use of stored keys [4]\n");
- io(name, 2, DST_ALG_RSAMD5, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC,
- mctx, DST_R_NULLKEY, &nfails, &nprobs);
-
- isc_buffer_constinit(&b, "dh.", 3);
- isc_buffer_add(&b, 3);
- isc_result = dns_name_fromtext(name, &b, NULL, 0, NULL);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- isc_result_totext(isc_result));
- t_result(T_UNRESOLVED);
- return;
- }
-
- dh(name, 18602, name, 48957, mctx, ISC_R_SUCCESS, &nfails, &nprobs);
-
- t_info("testing use of generated keys\n");
- generate(DST_ALG_RSAMD5, mctx, 512, &nfails);
- generate(DST_ALG_DSA, mctx, 512, &nfails);
- generate(DST_ALG_DH, mctx, 512, &nfails);
- /*
- * This one uses a constant.
- */
- generate(DST_ALG_DH, mctx, 768, &nfails);
- generate(DST_ALG_HMACMD5, mctx, 512, &nfails);
-
- dst_lib_destroy();
-
- isc_entropy_detach(&ectx);
-
- isc_mem_destroy(&mctx);
-
- result = T_UNRESOLVED;
- if ((nfails == 0) && (nprobs == 0))
- result = T_PASS;
- else if (nfails)
- result = T_FAIL;
- t_result(result);
-
-}
-
-#define T_SIGMAX 512
-
-#undef NEWSIG /* Define NEWSIG to generate the original signature file. */
-
-#ifdef NEWSIG
-
-/*
- * Write a sig in buf to file at path.
- */
-static int
-sig_tofile(char *path, isc_buffer_t *buf) {
- int rval;
- int fd;
- int len;
- int nprobs;
- int cnt;
- unsigned char c;
- unsigned char val;
-
- cnt = 0;
- nprobs = 0;
- len = buf->used - buf->current;
-
- t_info("buf: current %d used %d len %d\n",
- buf->current, buf->used, len);
-
- fd = open(path, O_CREAT|O_TRUNC|O_WRONLY, S_IRWXU|S_IRWXO|S_IRWXG);
- if (fd < 0) {
- t_info("open %s failed %d\n", path, errno);
- return(1);
- }
-
- while (len) {
- c = (unsigned char) isc_buffer_getuint8(buf);
- val = ((c >> 4 ) & 0x0f);
- if ((0 <= val) && (val <= 9))
- val = '0' + val;
- else
- val = 'A' + val - 10;
- rval = write(fd, &val, 1);
- if (rval != 1) {
- ++nprobs;
- t_info("write failed %d %d\n", rval, errno);
- break;
- }
- val = (c & 0x0f);
- if ((0 <= val) && (val <= 9))
- val = '0' + val;
- else
- val = 'A' + val - 10;
- rval = write(fd, &val, 1);
- if (rval != 1) {
- ++nprobs;
- t_info("write failed %d %d\n", rval, errno);
- break;
- }
- --len;
- ++cnt;
- if ((cnt % 16) == 0) {
- val = '\n';
- rval = write(fd, &val, 1);
- if (rval != 1) {
- ++nprobs;
- t_info("write failed %d %d\n", rval, errno);
- break;
- }
- }
- }
- val = '\n';
- rval = write(fd, &val, 1);
- if (rval != 1) {
- ++nprobs;
- t_info("write failed %d %d\n", rval, errno);
- }
- (void) close(fd);
- return(nprobs);
-}
-
-#endif /* NEWSIG */
-
-/*
- * Read sig in file at path to buf.
- */
-static int
-sig_fromfile(char *path, isc_buffer_t *iscbuf) {
- size_t rval;
- size_t len;
- FILE *fp;
- unsigned char val;
- char *p;
- char *buf;
- isc_result_t isc_result;
- off_t size;
-
- isc_result = isc_stdio_open(path, "rb", &fp);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("open failed, result: %s\n",
- isc_result_totext(isc_result));
- return(1);
- }
-
- isc_result = isc_file_getsizefd(fileno(fp), &size);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("stat %s failed, result: %s\n",
- path, isc_result_totext(isc_result));
- isc_stdio_close(fp);
- return(1);
- }
-
- buf = (char *) malloc((size + 1) * sizeof(char));
- if (buf == NULL) {
- t_info("malloc failed, errno == %d\n", errno);
- isc_stdio_close(fp);
- return(1);
- }
-
- len = (size_t)size;
- p = buf;
- while (len != 0U) {
- isc_result = isc_stdio_read(p, 1, len, fp, &rval);
- if (isc_result == ISC_R_SUCCESS) {
- len -= rval;
- p += rval;
- } else {
- t_info("read failed %d, result: %s\n",
- (int)rval, isc_result_totext(isc_result));
- (void) free(buf);
- (void) isc_stdio_close(fp);
- return(1);
- }
- }
- isc_stdio_close(fp);
-
- p = buf;
- len = size;
- while (len > 0U) {
- if ((*p == '\r') || (*p == '\n')) {
- ++p;
- --len;
- continue;
- } else if (len < 2U)
- goto err;
- if (('0' <= *p) && (*p <= '9'))
- val = *p - '0';
- else if (('A' <= *p) && (*p <= 'F'))
- val = *p - 'A' + 10;
- else
- goto err;
- ++p;
- val <<= 4;
- --len;
- if (('0' <= *p) && (*p <= '9'))
- val |= (*p - '0');
- else if (('A' <= *p) && (*p <= 'F'))
- val |= (*p - 'A' + 10);
- else
- goto err;
- ++p;
- --len;
- isc_buffer_putuint8(iscbuf, val);
- }
- (void) free(buf);
- return(0);
-
- err:
- (void) free(buf);
- return (1);
-}
-
-static void
-t2_sigchk(char *datapath, char *sigpath, char *keyname,
- int id, int alg, int type,
- isc_mem_t *mctx, char *expected_result,
- int *nfails, int *nprobs)
-{
- size_t rval;
- size_t len;
- FILE *fp;
- int exp_res;
- dst_key_t *key = NULL;
- unsigned char sig[T_SIGMAX];
- unsigned char *p;
- unsigned char *data;
- off_t size;
- isc_result_t isc_result;
- isc_buffer_t databuf;
- isc_buffer_t sigbuf;
- isc_region_t datareg;
- isc_region_t sigreg;
- dns_fixedname_t fname;
- dns_name_t *name;
- isc_buffer_t b;
- dst_context_t *ctx = NULL;
-
- /*
- * Read data from file in a form usable by dst_verify.
- */
- isc_result = isc_stdio_open(datapath, "rb", &fp);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("t2_sigchk: open failed %s\n",
- isc_result_totext(isc_result));
- ++*nprobs;
- return;
- }
-
- isc_result = isc_file_getsizefd(fileno(fp), &size);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("t2_sigchk: stat (%s) failed %s\n",
- datapath, isc_result_totext(isc_result));
- ++*nprobs;
- isc_stdio_close(fp);
- return;
- }
-
- data = (unsigned char *) malloc(size * sizeof(unsigned char));
- if (data == NULL) {
- t_info("t2_sigchk: malloc failed %d\n", errno);
- ++*nprobs;
- isc_stdio_close(fp);
- return;
- }
-
- p = data;
- len = (size_t)size;
- do {
- isc_result = isc_stdio_read(p, 1, len, fp, &rval);
- if (isc_result == ISC_R_SUCCESS) {
- len -= rval;
- p += rval;
- }
- } while (len);
- (void) isc_stdio_close(fp);
-
- /*
- * Read key from file in a form usable by dst_verify.
- */
- dns_fixedname_init(&fname);
- name = dns_fixedname_name(&fname);
- isc_buffer_constinit(&b, keyname, strlen(keyname));
- isc_buffer_add(&b, strlen(keyname));
- isc_result = dns_name_fromtext(name, &b, dns_rootname, 0, NULL);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- isc_result_totext(isc_result));
- (void) free(data);
- ++*nprobs;
- return;
- }
- isc_result = dst_key_fromfile(name, id, alg, type, NULL, mctx, &key);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("dst_key_fromfile failed %s\n",
- isc_result_totext(isc_result));
- (void) free(data);
- ++*nprobs;
- return;
- }
-
- isc_buffer_init(&databuf, data, (unsigned int)size);
- isc_buffer_add(&databuf, (unsigned int)size);
- isc_buffer_usedregion(&databuf, &datareg);
-
-#ifdef NEWSIG
-
- /*
- * If we're generating a signature for the first time,
- * sign the data and save the signature to a file
- */
-
- memset(sig, 0, sizeof(sig));
- isc_buffer_init(&sigbuf, sig, sizeof(sig));
-
- isc_result = dst_context_create3(key, mctx,
- DNS_LOGCATEGORY_GENERAL,
- ISC_TRUE, &ctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("dst_context_create(%d) failed %s\n",
- dst_result_totext(isc_result));
- (void) free(data);
- dst_key_free(&key);
- ++*nprobs;
- return;
- }
- isc_result = dst_context_adddata(ctx, &datareg);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("dst_context_adddata(%d) failed %s\n",
- dst_result_totext(isc_result));
- (void) free(data);
- dst_key_free(&key);
- dst_context_destroy(&ctx);
- ++*nprobs;
- return;
- }
- isc_result = dst_context_sign(ctx, &sigbuf);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("dst_sign(%d) failed %s\n",
- dst_result_totext(isc_result));
- (void) free(data);
- dst_key_free(&key);
- dst_context_destroy(&ctx);
- ++*nprobs;
- return;
- }
- dst_context_destroy(&ctx);
-
- rval = sig_tofile(sigpath, &sigbuf);
- if (rval != 0) {
- t_info("sig_tofile failed\n");
- ++*nprobs;
- (void) free(data);
- dst_key_free(&key);
- return;
- }
-
-#endif /* NEWSIG */
-
- memset(sig, 0, sizeof(sig));
- isc_buffer_init(&sigbuf, sig, sizeof(sig));
-
- /*
- * Read precomputed signature from file in a form usable by dst_verify.
- */
- rval = sig_fromfile(sigpath, &sigbuf);
- if (rval != 0U) {
- t_info("sig_fromfile failed\n");
- (void) free(data);
- dst_key_free(&key);
- ++*nprobs;
- return;
- }
-
- /*
- * Verify that the key signed the data.
- */
- isc_buffer_remainingregion(&sigbuf, &sigreg);
-
- exp_res = 0;
- if (strstr(expected_result, "!"))
- exp_res = 1;
-
- isc_result = dst_context_create3(key, mctx,
- DNS_LOGCATEGORY_GENERAL,
- ISC_FALSE, &ctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("dst_context_create returned %s\n",
- isc_result_totext(isc_result));
- (void) free(data);
- dst_key_free(&key);
- ++*nfails;
- return;
- }
- isc_result = dst_context_adddata(ctx, &datareg);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("dst_context_adddata returned %s\n",
- isc_result_totext(isc_result));
- (void) free(data);
- dst_context_destroy(&ctx);
- dst_key_free(&key);
- ++*nfails;
- return;
- }
- isc_result = dst_context_verify(ctx, &sigreg);
- if ( ((exp_res == 0) && (isc_result != ISC_R_SUCCESS)) ||
- ((exp_res != 0) && (isc_result == ISC_R_SUCCESS))) {
-
- t_info("dst_context_verify returned %s, expected %s\n",
- isc_result_totext(isc_result),
- expected_result);
- ++*nfails;
- }
-
- (void) free(data);
- dst_context_destroy(&ctx);
- dst_key_free(&key);
- return;
-}
-
-/*
- * The astute observer will note that t1() signs then verifies data
- * during the test but that t2() verifies data that has been
- * signed at some earlier time, possibly with an entire different
- * version or implementation of the DSA and RSA algorithms
- */
-
-isc_mem_t *t2_mctx = NULL;
-isc_entropy_t *t2_ectx = NULL;
-
-static int
-t2_vfy_init(void) {
- isc_result_t isc_result;
-
- t2_mctx = NULL;
- isc_result = isc_mem_create(0, 0, &t2_mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- return(0);
- }
- t2_ectx = NULL;
- isc_result = isc_entropy_create(t2_mctx, &t2_ectx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- return(0);
- }
- isc_result = isc_entropy_createfilesource(t2_ectx, "randomfile");
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_entropy_create failed %s\n",
- isc_result_totext(isc_result));
- return(0);
- }
- isc_result = dst_lib_init(t2_mctx, t2_ectx, ISC_ENTROPY_BLOCKING);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("dst_lib_init failed %s\n",
- isc_result_totext(isc_result));
- return(0);
- }
- return(1);
-}
-
-/*
- * av == datafile, sigpath, keyname, keyid, alg, exp_result.
- */
-static int
-t2_vfy(char **av) {
- char *datapath;
- char *sigpath;
- char *keyname;
- char *key;
- int keyid;
- char *alg;
- int algid;
- char *exp_result;
- int nfails;
- int nprobs;
- int result;
-
- datapath = *av++;
- sigpath = *av++;
- keyname = *av++;
- key = *av++;
- keyid = atoi(key);
- alg = *av++;
- exp_result = *av++;
- nfails = 0;
- nprobs = 0;
-
- if (! strcasecmp(alg, "DST_ALG_DSA"))
- algid = DST_ALG_DSA;
- else if (! strcasecmp(alg, "DST_ALG_RSAMD5"))
- algid = DST_ALG_RSAMD5;
- else {
- t_info("Unknown algorithm %s\n", alg);
- return(T_UNRESOLVED);
- }
-
- if (!dst_algorithm_supported(DST_ALG_RSAMD5)) {
- t_info("library built without crypto support\n");
- return (T_SKIPPED);
- }
-
- t_info("testing %s, %s, %s, %s, %s, %s\n",
- datapath, sigpath, keyname, key, alg, exp_result);
- t2_sigchk(datapath, sigpath, keyname, keyid,
- algid, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC,
- t2_mctx, exp_result,
- &nfails, &nprobs);
-
- result = T_UNRESOLVED;
- if (nfails)
- result = T_FAIL;
- else if ((nfails == 0) && (nprobs == 0))
- result = T_PASS;
-
- return(result);
-}
-
-static const char *a2 =
- "the dst module provides the capability to "
- "verify data signed with the RSA and DSA algorithms";
-
-static void
-t2(void) {
- int result;
- t_assert("dst", 2, T_REQUIRED, "%s", a2);
- if (!t2_vfy_init()) {
- result = T_UNRESOLVED;
- } else {
- result = t_eval("dst_2_data", t2_vfy, 6);
- dst_lib_destroy();
- }
- if (t2_ectx)
- isc_entropy_detach(&t2_ectx);
- if (t2_mctx)
- isc_mem_destroy(&t2_mctx);
- t_result(result);
-}
-
-testspec_t T_testlist[] = {
- { (PFV) t1, "basic dst module verification" },
- { (PFV) t2, "signature ineffability" },
- { (PFV) 0, NULL }
-};
-
-#ifdef WIN32
-int
-main(int argc, char **argv) {
- t_settests(T_testlist);
- return (t_main(argc, argv));
-}
-#endif
diff --git a/bin/tests/dst/win32/REQUIRE_EXTENDED_DIR b/bin/tests/dst/win32/REQUIRE_EXTENDED_DIR
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/bin/tests/dst/win32/t_dst.vcxproj.filters.in b/bin/tests/dst/win32/t_dst.vcxproj.filters.in
deleted file mode 100644
index d49779dbd6..0000000000
--- a/bin/tests/dst/win32/t_dst.vcxproj.filters.in
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/bin/tests/dst/win32/t_dst.vcxproj.in b/bin/tests/dst/win32/t_dst.vcxproj.in
deleted file mode 100644
index a1aeb00dd8..0000000000
--- a/bin/tests/dst/win32/t_dst.vcxproj.in
+++ /dev/null
@@ -1,148 +0,0 @@
-
-
-
-
- Debug
- @PLATFORM@
-
-
- Release
- @PLATFORM@
-
-
-
- {EE9B94CF-7C33-4F3B-A674-FB756D422C54}
- Win32Proj
- t_dst
-
-
-
- Application
- true
- MultiByte
-
-
- Application
- false
- true
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
- true
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
- false
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
-
-
-
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- true
- .\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
- cd ..
-copy "Kdh.+002+18602.key.in" "Kdh.+002+18602.key"
-copy "Kdh.+002+18602.private.in" "Kdh.+002+18602.private"
-copy "Kdh.+002+48957.key.in" "Kdh.+002+48957.key"
-copy "Kdh.+002+48957.private.in" "Kdh.+002+48957.private"
-copy "Ktest.+001+00002.key.in" "Ktest.+001+00002.key"
-copy "Ktest.+001+54622.key.in" "Ktest.+001+54622.key"
-copy "Ktest.+001+54622.private.in" "Ktest.+001+54622.private"
-copy "Ktest.+003+23616.key.in" "Ktest.+003+23616.key"
-copy "Ktest.+003+23616.private.in" "Ktest.+003+23616.private"
-copy "Ktest.+003+49667.key.in" "Ktest.+003+49667.key"
-copy dst_2_data.in dst_2_data
-copy t2_data_1.in t2_data_1
-copy t2_data_2.in t2_data_2
-copy t2_dsasig.in t2_dsasig
-copy t2_rsasig.in t2_rsasig
-
-
-
-
-
- Level3
-
-
- MaxSpeed
- true
- @INTRINSIC@
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- OnlyExplicitInline
- false
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- .\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- false
- true
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- Default
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
- cd ..
-copy "Kdh.+002+18602.key.in" "Kdh.+002+18602.key"
-copy "Kdh.+002+18602.private.in" "Kdh.+002+18602.private"
-copy "Kdh.+002+48957.key.in" "Kdh.+002+48957.key"
-copy "Kdh.+002+48957.private.in" "Kdh.+002+48957.private"
-copy "Ktest.+001+00002.key.in" "Ktest.+001+00002.key"
-copy "Ktest.+001+54622.key.in" "Ktest.+001+54622.key"
-copy "Ktest.+001+54622.private.in" "Ktest.+001+54622.private"
-copy "Ktest.+003+23616.key.in" "Ktest.+003+23616.key"
-copy "Ktest.+003+23616.private.in" "Ktest.+003+23616.private"
-copy "Ktest.+003+49667.key.in" "Ktest.+003+49667.key"
-copy dst_2_data.in dst_2_data
-copy t2_data_1.in t2_data_1
-copy t2_data_2.in t2_data_2
-copy t2_dsasig.in t2_dsasig
-copy t2_rsasig.in t2_rsasig
-
-
-
-
-
-
-
-
-
-
diff --git a/bin/tests/dst/win32/t_dst.vcxproj.user b/bin/tests/dst/win32/t_dst.vcxproj.user
deleted file mode 100644
index 695b5c78b9..0000000000
--- a/bin/tests/dst/win32/t_dst.vcxproj.user
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/bin/tests/hashes/Makefile.in b/bin/tests/hashes/Makefile.in
deleted file mode 100644
index a1276ff789..0000000000
--- a/bin/tests/hashes/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = ${TEST_INCLUDES} ${ISC_INCLUDES} @DST_OPENSSL_INC@
-
-CDEFINES = @CRYPTO@
-CWARNINGS =
-
-ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
-
-ISCDEPLIBS = ../../../lib/isc/libisc.@A@
-
-DEPLIBS = ${ISCDEPLIBS}
-
-LIBS = ${ISCLIBS} ${ISCLIBS} @LIBS@
-
-TLIB = ../../../lib/tests/libt_api.@A@
-
-TARGETS = t_hashes@EXEEXT@
-
-SRCS = t_hashes.c
-
-@BIND9_MAKE_RULES@
-
-t_hashes@EXEEXT@: t_hashes.@O@ ${DEPLIBS} ${TLIB}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ t_hashes.@O@ ${TLIB} ${LIBS}
-
-test: t_hashes@EXEEXT@
- -@./t_hashes@EXEEXT@ -c @top_srcdir@/t_config -b @srcdir@ -q 60 -a
-
-testhelp:
- @./t_hashes@EXEEXT@ -h
-
-clean distclean::
- rm -f ${TARGETS}
diff --git a/bin/tests/hashes/t_hashes.c b/bin/tests/hashes/t_hashes.c
deleted file mode 100644
index 279ccff0ad..0000000000
--- a/bin/tests/hashes/t_hashes.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: t_hashes.c,v 1.5 2010/10/04 22:27:41 marka Exp $ */
-
-/*
- * -d1 or larger shows hash or HMAC result even if correct
- */
-
-#include
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#include
-
-
-static int nprobs;
-
-typedef void(*HASH_INIT)(void *);
-typedef void(*HMAC_INIT)(void *, const unsigned char *, unsigned int);
-typedef void(*UPDATE)(void *, const unsigned char *, unsigned int);
-typedef void(*FINAL)(void *, const unsigned char *);
-typedef void(*SIGN)(void *, const unsigned char *, unsigned int);
-
-typedef struct {
- const char *name;
- const unsigned char *key;
- const unsigned int key_len;
- const unsigned char *str;
- const unsigned int str_len;
-} IN_;
-#define STR_INIT(s) (const unsigned char *)(s), sizeof(s)-1
-
-
-union {
- unsigned char b[1024];
-#ifndef PK11_MD5_DISABLE
- unsigned char md5[16];
-#endif
- unsigned char sha1[ISC_SHA1_DIGESTLENGTH];
- unsigned char sha224[ISC_SHA224_DIGESTLENGTH];
- unsigned char sha256[ISC_SHA256_DIGESTLENGTH];
- unsigned char sha384[ISC_SHA384_DIGESTLENGTH];
- unsigned char sha512[ISC_SHA512_DIGESTLENGTH];
-} dbuf;
-#define DIGEST_FILL 0xdf
-
-typedef struct {
- const char *str;
- const unsigned int digest_len;
-} OUT_;
-
-
-/*
- * two ad hoc hash examples
- */
-static IN_ abc = { "\"abc\"", NULL, 0, STR_INIT("abc")};
-static OUT_ abc_sha1 = {
- "a9993e364706816aba3e25717850c26c9cd0d89d",
- ISC_SHA1_DIGESTLENGTH};
-static OUT_ abc_sha224 = {
- "23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7",
- ISC_SHA224_DIGESTLENGTH};
-#ifndef PK11_MD5_DISABLE
-static OUT_ abc_md5 = {
- "900150983cd24fb0d6963f7d28e17f72",
- 16};
-#endif
-
-static IN_ abc_blah = { "\"abcdbc...\"", NULL, 0,
- STR_INIT("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq")};
-static OUT_ abc_blah_sha1 = {
- "84983e441c3bd26ebaae4aa1f95129e5e54670f1",
- ISC_SHA1_DIGESTLENGTH};
-static OUT_ abc_blah_sha224 = {
- "75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525",
- ISC_SHA224_DIGESTLENGTH};
-#ifndef PK11_MD5_DISABLE
-static OUT_ abc_blah_md5 = {
- "8215ef0796a20bcaaae116d3876c664a",
- 16};
-
-/*
- * three HMAC-md5 examples from RFC 2104
- */
-static const unsigned char rfc2104_1_key[16] = {
- 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
- 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b};
-static IN_ rfc2104_1 = {"RFC 2104 #1", rfc2104_1_key, sizeof(rfc2104_1_key),
- STR_INIT("Hi There")};
-static OUT_ rfc2104_1_hmac = {
- "9294727a3638bb1c13f48ef8158bfc9d",
- 16};
-
-static IN_ rfc2104_2 = {"RFC 2104 #2", STR_INIT("Jefe"),
- STR_INIT("what do ya want for nothing?")};
-static OUT_ rfc2104_2_hmac = {
- "750c783e6ab0b503eaa86e310a5db738",
- 16};
-
-static const unsigned char rfc2104_3_key[16] = {
- 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
- 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA};
-static const unsigned char rfc2104_3_s[50] = {
- 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
- 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
- 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
- 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
- 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
- 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
- 0xDD, 0xDD};
-static IN_ rfc2104_3 = {"RFC 2104 #3", rfc2104_3_key, sizeof(rfc2104_3_key),
- rfc2104_3_s, sizeof(rfc2104_3_s)};
-static OUT_ rfc2104_3_hmac = {
- "56be34521d144c88dbb8c733f0e8b3f6",
- 16};
-#endif
-
-/*
- * four three HMAC-SHA tests cut-and-pasted from RFC 4634 starting on page 86
- */
-static const unsigned char rfc4634_1_key[20] = {
- 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
- 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b
-};
-static IN_ rfc4634_1 = {"RFC 4634 #1", rfc4634_1_key, sizeof(rfc4634_1_key),
- STR_INIT("Hi There")};
-static OUT_ rfc4634_1_sha1 = {
- "B617318655057264E28BC0B6FB378C8EF146BE00",
- ISC_SHA1_DIGESTLENGTH};
-static OUT_ rfc4634_1_sha224 = {
- "896FB1128ABBDF196832107CD49DF33F47B4B1169912BA4F53684B22",
- ISC_SHA224_DIGESTLENGTH};
-static OUT_ rfc4634_1_sha256 = {
- "B0344C61D8DB38535CA8AFCEAF0BF12B881DC200C9833DA726E9376C2E32"
- "CFF7",
- ISC_SHA256_DIGESTLENGTH};
-static OUT_ rfc4634_1_sha384 = {
- "AFD03944D84895626B0825F4AB46907F15F9DADBE4101EC682AA034C7CEB"
- "C59CFAEA9EA9076EDE7F4AF152E8B2FA9CB6",
- ISC_SHA384_DIGESTLENGTH};
-static OUT_ rfc4634_1_sha512 = {
- "87AA7CDEA5EF619D4FF0B4241A1D6CB02379F4E2CE4EC2787AD0B30545E1"
- "7CDEDAA833B7D6B8A702038B274EAEA3F4E4BE9D914EEB61F1702E696C20"
- "3A126854",
- ISC_SHA512_DIGESTLENGTH};
-
-static IN_ rfc4634_2 = {"RFC 4634 #2", STR_INIT("Jefe"),
- STR_INIT("what do ya want for nothing?")};
-static OUT_ rfc4634_2_sha1 = {
- "EFFCDF6AE5EB2FA2D27416D5F184DF9C259A7C79",
- ISC_SHA1_DIGESTLENGTH};
-static OUT_ rfc4634_2_sha224 = {
- "A30E01098BC6DBBF45690F3A7E9E6D0F8BBEA2A39E6148008FD05E44",
- ISC_SHA224_DIGESTLENGTH};
-static OUT_ rfc4634_2_sha256 = {
- "5BDCC146BF60754E6A042426089575C75A003F089D2739839DEC58B964EC"
- "3843",
- ISC_SHA256_DIGESTLENGTH};
-static OUT_ rfc4634_2_sha384 = {
- "AF45D2E376484031617F78D2B58A6B1B9C7EF464F5A01B47E42EC3736322"
- "445E8E2240CA5E69E2C78B3239ECFAB21649",
- ISC_SHA384_DIGESTLENGTH};
-static OUT_ rfc4634_2_sha512 = {
- "164B7A7BFCF819E2E395FBE73B56E0A387BD64222E831FD610270CD7EA25"
- "05549758BF75C05A994A6D034F65F8F0E6FDCAEAB1A34D4A6B4B636E070A"
- "38BCE737",
- ISC_SHA512_DIGESTLENGTH};
-
-static const unsigned char rfc4634_3_key[20] = {
- 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
- 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa
-};
-static const unsigned char rfc4634_3_s[50] = {
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
- 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd
-};
-static IN_ rfc4634_3 = {"RFC 4634 #3", rfc4634_3_key, sizeof(rfc4634_3_key),
- rfc4634_3_s, sizeof(rfc4634_3_s)};
-static OUT_ rfc4634_3_sha1 = {
- "125D7342B9AC11CD91A39AF48AA17B4F63F175D3",
- ISC_SHA1_DIGESTLENGTH};
-static OUT_ rfc4634_3_sha224 = {
- "7FB3CB3588C6C1F6FFA9694D7D6AD2649365B0C1F65D69D1EC8333EA",
- ISC_SHA224_DIGESTLENGTH};
-static OUT_ rfc4634_3_sha256 = {
- "773EA91E36800E46854DB8EBD09181A72959098B3EF8C122D9635514CED5"
- "65FE",
- ISC_SHA256_DIGESTLENGTH};
-static OUT_ rfc4634_3_sha384 = {
- "88062608D3E6AD8A0AA2ACE014C8A86F0AA635D947AC9FEBE83EF4E55966"
- "144B2A5AB39DC13814B94E3AB6E101A34F27",
- ISC_SHA384_DIGESTLENGTH};
-static OUT_ rfc4634_3_sha512 = {
- "FA73B0089D56A284EFB0F0756C890BE9B1B5DBDD8EE81A3655F83E33B227"
- "9D39BF3E848279A722C806B485A47E67C807B946A337BEE8942674278859"
- "E13292FB",
- ISC_SHA512_DIGESTLENGTH};
-
-static const unsigned char rfc4634_4_key[25] = {
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
- 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14,
- 0x15, 0x16, 0x17, 0x18, 0x19
-};
-static const unsigned char rfc4634_4_s[50] = {
- 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
- 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
- 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
- 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
- 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd
-};
-static IN_ rfc4634_4 = {"RFC 4634 #3", rfc4634_4_key, sizeof(rfc4634_4_key),
- rfc4634_4_s, sizeof(rfc4634_4_s)};
-static OUT_ rfc4634_4_sha1 = {
- "4C9007F4026250C6BC8414F9BF50C86C2D7235DA",
- ISC_SHA1_DIGESTLENGTH};
-static OUT_ rfc4634_4_sha224 = {
- "6C11506874013CAC6A2ABC1BB382627CEC6A90D86EFC012DE7AFEC5A",
- ISC_SHA224_DIGESTLENGTH};
-static OUT_ rfc4634_4_sha256 = {
- "82558A389A443C0EA4CC819899F2083A85F0FAA3E578F8077A2E3FF46729"
- "665B",
- ISC_SHA256_DIGESTLENGTH};
-static OUT_ rfc4634_4_sha384 = {
- "3E8A69B7783C25851933AB6290AF6CA77A9981480850009CC5577C6E1F57"
- "3B4E6801DD23C4A7D679CCF8A386C674CFFB",
- ISC_SHA384_DIGESTLENGTH};
-static OUT_ rfc4634_4_sha512 = {
- "B0BA465637458C6990E5A8C5F61D4AF7E576D97FF94B872DE76F8050361E"
- "E3DBA91CA5C11AA25EB4D679275CC5788063A5F19741120C4F2DE2ADEBEB"
- "10A298DD",
- ISC_SHA512_DIGESTLENGTH};
-
-
-
-static const char *
-d2str(char *buf, unsigned int buf_len,
- const unsigned char *d, unsigned int d_len)
-{
- unsigned int i, l;
-
- l = 0;
- for (i = 0; i < d_len && l < buf_len-4; ++i) {
- l += snprintf(&buf[l], buf_len-l, "%02x", d[i]);
- }
- if (l >= buf_len-3) {
- REQUIRE(buf_len > sizeof("..."));
- strcpy(&buf[l-sizeof(" ...")], " ...");
- }
- return buf;
-}
-
-
-
-/*
- * Compare binary digest or HMAC to string of hex digits from an RFC
- */
-static void
-ck(const char *name, const IN_ *in, const OUT_ *out)
-{
- char buf[sizeof(dbuf)*2+1];
- const char *str_name;
- unsigned int l;
-
- d2str(buf, sizeof(buf), dbuf.b, out->digest_len);
- str_name = in->name != NULL ? in->name : (const char *)in->str;
-
- if (T_debug != 0)
- t_info("%s(%s) = %s\n", name, str_name, buf);
-
- if (strcasecmp(buf, out->str)) {
- t_info("%s(%s)\n%9s %s\n%9s %s\n",
- name, str_name,
- "is", buf,
- "should be", out->str);
- ++nprobs;
- return;
- }
-
- /*
- * check that the hash or HMAC is no longer than we think it is
- */
- for (l = out->digest_len; l < sizeof(dbuf); ++l) {
- if (dbuf.b[l] != DIGEST_FILL) {
- t_info("byte #%d after end of %s(%s) changed to %02x\n",
- l-out->digest_len, name, str_name, dbuf.b[l]);
- ++nprobs;
- break;
- }
- }
-}
-
-
-
-static void
-t_hash(const char *hname, HASH_INIT init, UPDATE update, FINAL final,
- IN_ *in, OUT_ *out)
-{
- union {
- unsigned char b[1024];
- isc_sha1_t sha1;
-#ifndef PK11_MD5_DISABLE
- isc_md5_t md5;
-#endif
- } ctx;
-
- init(&ctx);
- update(&ctx, in->str, in->str_len);
- memset(dbuf.b, DIGEST_FILL, sizeof(dbuf));
- final(&ctx, dbuf.b);
- ck(hname, in, out);
-}
-
-
-
-/*
- * isc_sha224_final has a different calling sequence
- */
-static void
-t_sha224(IN_ *in, OUT_ *out)
-{
- isc_sha224_t ctx;
-
- memset(dbuf.b, DIGEST_FILL, sizeof(dbuf));
- isc_sha224_init(&ctx);
- isc_sha224_update(&ctx, in->str, in->str_len);
- memset(dbuf.b, DIGEST_FILL, sizeof(dbuf));
- isc_sha224_final(dbuf.b, &ctx);
- ck("SHA224", in, out);
-}
-
-
-
-static void
-#ifndef PK11_MD5_DISABLE
-t_hashes(IN_ *in, OUT_ *out_sha1, OUT_ *out_sha224, OUT_ *out_md5)
-#else
-t_hashes(IN_ *in, OUT_ *out_sha1, OUT_ *out_sha224)
-#endif
-{
- t_hash("SHA1", (HASH_INIT)isc_sha1_init, (UPDATE)isc_sha1_update,
- (FINAL)isc_sha1_final, in, out_sha1);
- t_sha224(in, out_sha224);
-#ifndef PK11_MD5_DISABLE
- t_hash("md5", (HASH_INIT)isc_md5_init, (UPDATE)isc_md5_update,
- (FINAL)isc_md5_final, in, out_md5);
-#endif
-}
-
-
-#ifndef PK11_MD5_DISABLE
-/*
- * isc_hmacmd5_sign has a different calling sequence
- */
-static void
-t_md5hmac(IN_ *in, OUT_ *out)
-{
- isc_hmacmd5_t ctx;
-
- isc_hmacmd5_init(&ctx, in->key, in->key_len);
- isc_hmacmd5_update(&ctx, in->str, in->str_len);
- memset(dbuf.b, DIGEST_FILL, sizeof(dbuf));
- isc_hmacmd5_sign(&ctx, dbuf.b);
- ck("HMAC-md5", in, out);
-}
-#endif
-
-
-static void
-t_hmac(const char *hname, HMAC_INIT init, UPDATE update, SIGN sign,
- IN_ *in, OUT_ *out)
-{
- union {
- unsigned char b[1024];
-#ifndef PK11_MD5_DISABLE
- isc_hmacmd5_t hmacmd5;
-#endif
- isc_hmacsha1_t hmacsha1;
- isc_hmacsha224_t hmacsha224;
- isc_hmacsha256_t hmacsha256;
- isc_hmacsha384_t hmacsha384;
- isc_hmacsha512_t hmacsha512;
- } ctx;
-
- init(&ctx, in->key, in->key_len);
- update(&ctx, in->str, in->str_len);
- memset(dbuf.b, DIGEST_FILL, sizeof(dbuf));
- sign(&ctx, dbuf.b, out->digest_len);
- ck(hname, in, out);
-}
-
-
-
-static void
-t_hmacs(IN_ *in, OUT_ *out_sha1, OUT_ *out_sha224, OUT_ *out_sha256,
- OUT_ *out_sha384, OUT_ *out_sha512)
-{
- t_hmac("HMAC-SHA1", (HMAC_INIT)isc_hmacsha1_init,
- (UPDATE)isc_hmacsha1_update, (SIGN)isc_hmacsha1_sign,
- in, out_sha1);
- t_hmac("HMAC-SHA224", (HMAC_INIT)isc_hmacsha224_init,
- (UPDATE)isc_hmacsha224_update, (SIGN)isc_hmacsha224_sign,
- in, out_sha224);
- t_hmac("HMAC-SHA256", (HMAC_INIT)isc_hmacsha256_init,
- (UPDATE)isc_hmacsha256_update, (SIGN)isc_hmacsha256_sign,
- in, out_sha256);
- t_hmac("HMAC-SHA384", (HMAC_INIT)isc_hmacsha384_init,
- (UPDATE)isc_hmacsha384_update, (SIGN)isc_hmacsha384_sign,
- in, out_sha384);
- t_hmac("HMAC-SHA512", (HMAC_INIT)isc_hmacsha512_init,
- (UPDATE)isc_hmacsha512_update, (SIGN)isc_hmacsha512_sign,
- in, out_sha512);
-}
-
-
-
-/*
- * This will almost never fail, and so there is no need for the extra noise
- * that would come from breaking it into several tests.
- */
-static void
-t1(void)
-{
- /*
- * two ad hoc hash examples
- */
-#ifndef PK11_MD5_DISABLE
- t_hashes(&abc, &abc_sha1, &abc_sha224, &abc_md5);
- t_hashes(&abc_blah, &abc_blah_sha1, &abc_blah_sha224, &abc_blah_md5);
-#else
- t_hashes(&abc, &abc_sha1, &abc_sha224);
- t_hashes(&abc_blah, &abc_blah_sha1, &abc_blah_sha224);
-#endif
-
-#ifndef PK11_MD5_DISABLE
- /*
- * three HMAC-md5 examples from RFC 2104
- */
- t_md5hmac(&rfc2104_1, &rfc2104_1_hmac);
- t_md5hmac(&rfc2104_2, &rfc2104_2_hmac);
- t_md5hmac(&rfc2104_3, &rfc2104_3_hmac);
-#endif
-
- /*
- * four HMAC-SHA tests from RFC 4634 starting on page 86
- */
- t_hmacs(&rfc4634_1, &rfc4634_1_sha1, &rfc4634_1_sha224,
- &rfc4634_1_sha256, &rfc4634_1_sha384, &rfc4634_1_sha512);
- t_hmacs(&rfc4634_2, &rfc4634_2_sha1, &rfc4634_2_sha224,
- &rfc4634_2_sha256, &rfc4634_2_sha384, &rfc4634_2_sha512);
- t_hmacs(&rfc4634_3, &rfc4634_3_sha1, &rfc4634_3_sha224,
- &rfc4634_3_sha256, &rfc4634_3_sha384, &rfc4634_3_sha512);
- t_hmacs(&rfc4634_4, &rfc4634_4_sha1, &rfc4634_4_sha224,
- &rfc4634_4_sha256, &rfc4634_4_sha384, &rfc4634_4_sha512);
-
- if (nprobs != 0)
- t_result(T_FAIL);
- else
- t_result(T_PASS);
-}
-
-
-testspec_t T_testlist[] = {
- { (PFV) t1, "hashes" },
- { (PFV) 0, NULL }
-};
-
-#ifdef WIN32
-int
-main(int argc, char **argv) {
- t_settests(T_testlist);
- return (t_main(argc, argv));
-}
-#endif
diff --git a/bin/tests/hashes/win32/t_hashes.vcxproj.filters.in b/bin/tests/hashes/win32/t_hashes.vcxproj.filters.in
deleted file mode 100644
index 0f4bd9c4b2..0000000000
--- a/bin/tests/hashes/win32/t_hashes.vcxproj.filters.in
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/bin/tests/hashes/win32/t_hashes.vcxproj.in b/bin/tests/hashes/win32/t_hashes.vcxproj.in
deleted file mode 100644
index 6af5cb5176..0000000000
--- a/bin/tests/hashes/win32/t_hashes.vcxproj.in
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
- Debug
- @PLATFORM@
-
-
- Release
- @PLATFORM@
-
-
-
- {14071120-84F6-4A6F-BF23-90EC5D0372CE}
- Win32Proj
- t_hashes
-
-
-
- Application
- true
- MultiByte
-
-
- Application
- false
- true
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
- true
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
- false
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
-
-
-
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- true
- .\;..\..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
- Level3
-
-
- MaxSpeed
- true
- @INTRINSIC@
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- OnlyExplicitInline
- false
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- .\;..\..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- false
- true
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- Default
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
-
-
-
-
-
diff --git a/bin/tests/hashes/win32/t_hashes.vcxproj.user b/bin/tests/hashes/win32/t_hashes.vcxproj.user
deleted file mode 100644
index 695b5c78b9..0000000000
--- a/bin/tests/hashes/win32/t_hashes.vcxproj.user
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/bin/tests/master/Makefile.in b/bin/tests/master/Makefile.in
deleted file mode 100644
index 4764a113e6..0000000000
--- a/bin/tests/master/Makefile.in
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = ${TEST_INCLUDES} ${DNS_INCLUDES} \
- ${ISC_INCLUDES} @DST_OPENSSL_INC@
-
-CDEFINES = @CRYPTO@
-CWARNINGS =
-
-# Note that we do not want to use libtool for libt_api
-DNSLIBS = ../../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
-ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
-
-DNSDEPLIBS = ../../../lib/dns/libdns.@A@
-ISCDEPLIBS = ../../../lib/isc/libisc.@A@
-
-DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
-
-LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
-
-TLIB = ../../../lib/tests/libt_api.@A@
-
-TARGETS = t_master@EXEEXT@
-
-SRCS = t_master.c
-
-@BIND9_MAKE_RULES@
-
-t_master@EXEEXT@: t_master.@O@ ${DEPLIBS} ${TLIB}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ t_master.@O@ ${TLIB} ${LIBS}
-
-test: t_master@EXEEXT@
- -@ ./t_master@EXEEXT@ -c @top_srcdir@/t_config -b @srcdir@ -a
-
-testhelp:
- @ ./t_master@EXEEXT@ -h
-
-clean distclean::
- rm -f ${TARGETS}
diff --git a/bin/tests/master/dns_master_load_10_data b/bin/tests/master/dns_master_load_10_data
deleted file mode 100644
index cfaa3fb331..0000000000
--- a/bin/tests/master/dns_master_load_10_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_master_load test 9
-#
-# format is:
-# masterfile origin class expected_result
-# where
-# masterfile name is the name of a file containing master data
-# origin is the origin
-# class is the zone's class
-# expected_result is a text representation of a dns_result_t
-#
-master10.data test in ISC_R_SUCCESS
diff --git a/bin/tests/master/dns_master_load_11_data b/bin/tests/master/dns_master_load_11_data
deleted file mode 100644
index 7b667b273b..0000000000
--- a/bin/tests/master/dns_master_load_11_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_master_load test 11
-#
-# format is:
-# masterfile origin class expected_result
-# where
-# masterfile name is the name of a file containing master data
-# origin is the origin
-# class is the zone's class
-# expected_result is a text representation of a dns_result_t
-#
-master11.data test in ISC_R_SUCCESS
diff --git a/bin/tests/master/dns_master_load_1_data b/bin/tests/master/dns_master_load_1_data
deleted file mode 100644
index fc92c748a3..0000000000
--- a/bin/tests/master/dns_master_load_1_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_master_load test 1
-#
-# format is:
-# masterfile origin class expected_result
-# where
-# masterfile name is the name of a file containing master data
-# origin is the origin
-# class is the zone's class
-# expected_result is a text representation of a dns_result_t
-#
-master1.data test in ISC_R_SUCCESS
diff --git a/bin/tests/master/dns_master_load_2_data b/bin/tests/master/dns_master_load_2_data
deleted file mode 100644
index a6e44b34cc..0000000000
--- a/bin/tests/master/dns_master_load_2_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_master_load test 2
-#
-# format is:
-# masterfile origin class expected_result
-# where
-# masterfile name is the name of a file containing master data
-# origin is the origin
-# class is the zone's class
-# expected_result is a text representation of a dns_result_t
-#
-master2.data test in ISC_R_UNEXPECTEDEND
diff --git a/bin/tests/master/dns_master_load_3_data b/bin/tests/master/dns_master_load_3_data
deleted file mode 100644
index 9dbdfb20aa..0000000000
--- a/bin/tests/master/dns_master_load_3_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_master_load test 3
-#
-# format is:
-# masterfile origin class expected_result
-# where
-# masterfile name is the name of a file containing master data
-# origin is the origin
-# class is the zone's class
-# expected_result is a text representation of a dns_result_t
-#
-master3.data test in DNS_R_NOOWNER
diff --git a/bin/tests/master/dns_master_load_4_data b/bin/tests/master/dns_master_load_4_data
deleted file mode 100644
index 66ad1ff36a..0000000000
--- a/bin/tests/master/dns_master_load_4_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_master_load test 4
-#
-# format is:
-# masterfile origin class expected_result
-# where
-# masterfile name is the name of a file containing master data
-# origin is the origin
-# class is the zone's class
-# expected_result is a text representation of a dns_result_t
-#
-master4.data test in ISC_R_SUCCESS
diff --git a/bin/tests/master/dns_master_load_5_data b/bin/tests/master/dns_master_load_5_data
deleted file mode 100644
index 56e33ba7ad..0000000000
--- a/bin/tests/master/dns_master_load_5_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_master_load test 5
-#
-# format is:
-# masterfile origin class expected_result
-# where
-# masterfile name is the name of a file containing master data
-# origin is the origin
-# class is the zone's class
-# expected_result is a text representation of a dns_result_t
-#
-master5.data test in DNS_R_BADCLASS
diff --git a/bin/tests/master/dns_master_load_6_data b/bin/tests/master/dns_master_load_6_data
deleted file mode 100644
index d14aa88892..0000000000
--- a/bin/tests/master/dns_master_load_6_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_master_load test 6
-#
-# format is:
-# masterfile origin class expected_result
-# where
-# masterfile name is the name of a file containing master data
-# origin is the origin
-# class is the zone's class
-# expected_result is a text representation of a dns_result_t
-#
-master6.data test in ISC_R_SUCCESS
diff --git a/bin/tests/master/dns_master_load_7_data b/bin/tests/master/dns_master_load_7_data
deleted file mode 100644
index dbe7ef9a64..0000000000
--- a/bin/tests/master/dns_master_load_7_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_master_load test 7
-#
-# format is:
-# masterfile origin class expected_result
-# where
-# masterfile name is the name of a file containing master data
-# origin is the origin
-# class is the zone's class
-# expected_result is a text representation of a dns_result_t
-#
-master7.data test in ISC_R_SUCCESS
diff --git a/bin/tests/master/dns_master_load_8_data b/bin/tests/master/dns_master_load_8_data
deleted file mode 100644
index b109d43b8d..0000000000
--- a/bin/tests/master/dns_master_load_8_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_master_load test 8
-#
-# format is:
-# masterfile origin class expected_result
-# where
-# masterfile name is the name of a file containing master data
-# origin is the origin
-# class is the zone's class
-# expected_result is a text representation of a dns_result_t
-#
-master8.data test in DNS_R_SEENINCLUDE
diff --git a/bin/tests/master/dns_master_load_9_data b/bin/tests/master/dns_master_load_9_data
deleted file mode 100644
index af36072a8d..0000000000
--- a/bin/tests/master/dns_master_load_9_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_master_load test 9
-#
-# format is:
-# masterfile origin class expected_result
-# where
-# masterfile name is the name of a file containing master data
-# origin is the origin
-# class is the zone's class
-# expected_result is a text representation of a dns_result_t
-#
-master9.data test in DNS_R_BADCLASS
diff --git a/bin/tests/master/master1.data b/bin/tests/master/master1.data
deleted file mode 100644
index 9b8147407c..0000000000
--- a/bin/tests/master/master1.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2vix.com.
-a in ns ns3vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/master/master10.data b/bin/tests/master/master10.data
deleted file mode 100644
index 9ee052fca9..0000000000
--- a/bin/tests/master/master10.data
+++ /dev/null
@@ -1,7 +0,0 @@
-;
-; the following black line contains spaces
-
-;
-@ 300 IN A 10.0.0.1
- ;
-;
diff --git a/bin/tests/master/master11.data b/bin/tests/master/master11.data
deleted file mode 100644
index 0aaec25ecf..0000000000
--- a/bin/tests/master/master11.data
+++ /dev/null
@@ -1,6 +0,0 @@
-;
-; The following serial number contains a leading 0 and a 9 so the
-; we can catch cases where it is incorrectly treated as a octal
-; number.
-;
-@ 300 IN SOA ns hostmaster 00090000 1200 3600 604800 300
diff --git a/bin/tests/master/master2.data b/bin/tests/master/master2.data
deleted file mode 100644
index b8ca38dd0d..0000000000
--- a/bin/tests/master/master2.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns
-a in ns ns2vix.com.
-a in ns ns3vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/master/master3.data b/bin/tests/master/master3.data
deleted file mode 100644
index 7283af61b6..0000000000
--- a/bin/tests/master/master3.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
- in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
- in ns ns.vix.com
- in ns ns2vix.com.
-a in ns ns3vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/master/master4.data b/bin/tests/master/master4.data
deleted file mode 100644
index 3a694ea5e3..0000000000
--- a/bin/tests/master/master4.data
+++ /dev/null
@@ -1,11 +0,0 @@
-
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a in ns ns.vix.com.
-a in ns ns2vix.com.
-a in ns ns3vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/master/master5.data b/bin/tests/master/master5.data
deleted file mode 100644
index 95234bdafd..0000000000
--- a/bin/tests/master/master5.data
+++ /dev/null
@@ -1,11 +0,0 @@
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-a any ns ns.vix.com.
-a in ns ns2vix.com.
-a in ns ns3vix.com.
-b in a 1.2.3.4
diff --git a/bin/tests/master/master6.data b/bin/tests/master/master6.data
deleted file mode 100644
index a9a37bbf8e..0000000000
--- a/bin/tests/master/master6.data
+++ /dev/null
@@ -1,33 +0,0 @@
-
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-
-secure1 3600 IN DNSKEY (
- FLAG2|FLAG4|FLAG5|NTYP3|FLAG8|FLAG9|FLAG10|FLAG11|SIG15
- 3 3
- ArT0a8FtOZWEONG2YQVl9+RA34op30JPz4NPEroCxm2yImT2
- 2OYggnPIzrgayyepgKU1PfTTypnJDTwrSrtISyEsj7tjM7/n
- 03DP8VWSn0aLwpUuc7Sx9vtM1Wi+YeiA4Bv2Oz1VB9de4qql
- sIq+KLn8J4wz95bGnJ0mHUB7oTDJ3Hl1zeaCMdX69Kr46yAY
- AvGJJdGGDYxYgxzx2zNdzypkYSkxpdsNqUt38tabSfdvCn12
- pnmSWjlVJsjHhsaYnrPhouN5acOXMNbxNVbGU5LZ8Es6EYbV
- /7YMt8VUkA8/8UCszBBT7XAJ3OFjiMO8mvxrZZFzvwJlPBQ1
- oFq/TNZlSe+N )
-
-secure2 3600 in DNSKEY (
- flag2|flag4|flag5|ntyp3|flag8|flag9|flag10|flag11|sig15
- 3 3
- ArT0a8FtOZWEONG2YQVl9+RA34op30JPz4NPEroCxm2yImT2
- 2OYggnPIzrgayyepgKU1PfTTypnJDTwrSrtISyEsj7tjM7/n
- 03DP8VWSn0aLwpUuc7Sx9vtM1Wi+YeiA4Bv2Oz1VB9de4qql
- sIq+KLn8J4wz95bGnJ0mHUB7oTDJ3Hl1zeaCMdX69Kr46yAY
- AvGJJdGGDYxYgxzx2zNdzypkYSkxpdsNqUt38tabSfdvCn12
- pnmSWjlVJsjHhsaYnrPhouN5acOXMNbxNVbGU5LZ8Es6EYbV
- /7YMt8VUkA8/8UCszBBT7XAJ3OFjiMO8mvxrZZFzvwJlPBQ1
- oFq/TNZlSe+N )
-
diff --git a/bin/tests/master/master7.data b/bin/tests/master/master7.data
deleted file mode 100644
index 2638b5d77b..0000000000
--- a/bin/tests/master/master7.data
+++ /dev/null
@@ -1,17 +0,0 @@
-
-$TTL 1000
-@ in soa localhost. postmaster.localhost. (
- 1993050801 ;serial
- 3600 ;refresh
- 1800 ;retry
- 604800 ;expiration
- 3600 ) ;minimum
-
-secure1 3600 IN DNSKEY (
- NOKEY|FLAG2|FLAG4|FLAG5|NTYP3|FLAG8|FLAG9|FLAG10|FLAG11|SIG15
- 3 3 )
-
-secure2 3600 in DNSKEY (
- nokey|flag2|flag4|flag5|ntyp3|flag8|flag9|flag10|flag11|sig15
- 3 3 )
-
diff --git a/bin/tests/master/master8.data b/bin/tests/master/master8.data
deleted file mode 100644
index 58bded9583..0000000000
--- a/bin/tests/master/master8.data
+++ /dev/null
@@ -1,4 +0,0 @@
-;
-; master7.data contains a good zone file
-;
-$include master7.data
diff --git a/bin/tests/master/master9.data b/bin/tests/master/master9.data
deleted file mode 100644
index e7bcf7e2ef..0000000000
--- a/bin/tests/master/master9.data
+++ /dev/null
@@ -1,4 +0,0 @@
-;
-; master5.data is bad
-;
-$include master5.data
diff --git a/bin/tests/master/t_master.c b/bin/tests/master/t_master.c
deleted file mode 100644
index 96f1b40313..0000000000
--- a/bin/tests/master/t_master.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: t_master.c,v 1.41 2011/03/12 04:59:46 tbox Exp $ */
-
-#include
-
-#include
-#include
-
-#include
-#include
-#include /* Required for HP/UX (and others?) */
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#define BUFLEN 255
-#define BIGBUFLEN (64 * 1024)
-
-static isc_result_t
-t1_add_callback(void *arg, const dns_name_t *owner, dns_rdataset_t *dataset);
-
-isc_mem_t *T1_mctx;
-char *Tokens[T_MAXTOKS + 1];
-
-static isc_result_t
-t1_add_callback(void *arg, const dns_name_t *owner, dns_rdataset_t *dataset) {
- char buf[BIGBUFLEN];
- isc_buffer_t target;
- isc_result_t result;
-
- UNUSED(arg);
-
- isc_buffer_init(&target, buf, BIGBUFLEN);
- result = dns_rdataset_totext(dataset, owner, ISC_FALSE, ISC_FALSE,
- &target);
- if (result != ISC_R_SUCCESS)
- t_info("dns_rdataset_totext: %s\n", dns_result_totext(result));
-
- return(result);
-}
-
-static int
-test_master(char *testfile, char *origin, char *db_class,
- isc_result_t exp_result)
-{
- int result;
- int len;
- isc_result_t isc_result;
- isc_result_t dns_result;
- dns_name_t dns_origin;
- isc_buffer_t source;
- isc_buffer_t target;
- unsigned char name_buf[BUFLEN];
- dns_rdatacallbacks_t callbacks;
- dns_rdataclass_t rdataclass;
- isc_textregion_t textregion;
-
- if (T1_mctx == NULL)
- isc_result = isc_mem_create(0, 0, &T1_mctx);
- else
- isc_result = ISC_R_SUCCESS;
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %d\n", isc_result);
- return(T_UNRESOLVED);
- }
-
- len = strlen(origin);
- isc_buffer_init(&source, origin, len);
- isc_buffer_add(&source, len);
- isc_buffer_setactive(&source, len);
- isc_buffer_init(&target, name_buf, BUFLEN);
- dns_name_init(&dns_origin, NULL);
- dns_result = dns_name_fromtext(&dns_origin, &source, dns_rootname,
- 0, &target);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed %s\n",
- dns_result_totext(dns_result));
- return(T_UNRESOLVED);
- }
-
- dns_rdatacallbacks_init_stdio(&callbacks);
- callbacks.add = t1_add_callback;
-
- textregion.base = db_class;
- textregion.length = strlen(db_class);
-
- dns_result = dns_rdataclass_fromtext(&rdataclass, &textregion);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_rdataclass_fromtext failed %s\n",
- dns_result_totext(dns_result));
- return(T_UNRESOLVED);
- }
-
- dns_result = dns_master_loadfile( testfile,
- &dns_origin,
- &dns_origin,
- rdataclass,
- ISC_TRUE,
- &callbacks,
- T1_mctx);
-
- if (dns_result == exp_result)
- result = T_PASS;
- else {
- t_info("dns_master_loadfile: got %s, expected %s\n",
- dns_result_totext(dns_result),
- dns_result_totext(exp_result));
- result = T_FAIL;
- }
- return(result);
-}
-
-static int
-test_master_x(const char *filename) {
- FILE *fp;
- char *p;
- int line;
- int cnt;
- int result;
-
- result = T_UNRESOLVED;
-
- fp = fopen(filename, "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace(*p & 0xff)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- /*
- * Name of data file, origin, zclass, expected result.
- */
- cnt = t_bustline(p, Tokens);
- if (cnt == 4) {
- result = test_master(Tokens[0], Tokens[1],
- Tokens[2],
- t_dns_result_fromtext(Tokens[3]));
- } else {
- t_info("bad format in %s at line %d\n",
- filename, line);
- }
-
- (void)free(p);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile %s\n", filename);
- }
- return(result);
-}
-
-static const char *a1 = "dns_master_loadfile loads a valid master file and "
- "returns ISC_R_SUCCESS";
-static void
-t1(void) {
- int result;
- t_assert("dns_master_loadfile", 1, T_REQUIRED, "%s", a1);
- result = test_master_x("dns_master_load_1_data");
- t_result(result);
-}
-
-static const char *a2 =
- "dns_master_loadfile returns ISC_R_UNEXPECTEDEND when the "
- "masterfile input ends unexpectedly";
-
-static void
-t2(void) {
- int result;
- t_assert("dns_master_loadfile", 2, T_REQUIRED, "%s", a2);
- result = test_master_x("dns_master_load_2_data");
- t_result(result);
-}
-
-static const char *a3 = "dns_master_loadfile returns DNS_R_NOOWNER when the "
- "an ownername is not specified";
-
-static void
-t3() {
- int result;
- t_assert("dns_master_loadfile", 3, T_REQUIRED, "%s", a3);
- result = test_master_x("dns_master_load_3_data");
- t_result(result);
-}
-
-static const char *a4 = "dns_master_loadfile accepts broken zone files "
- "where the first record has an undefined TTL, "
- "as long as it is a SOA";
-
-static void
-t4() {
- int result;
- t_assert("dns_master_loadfile", 4, T_REQUIRED, "%s", a4);
- result = test_master_x("dns_master_load_4_data");
- t_result(result);
-}
-
-static const char *a5 = "dns_master_loadfile returns DNS_R_BADCLASS when the "
- "the record class did not match the zone class";
-
-static void
-t5() {
- int result;
-
- t_assert("dns_master_loadfile", 5, T_REQUIRED, "%s", a5);
- result = test_master_x("dns_master_load_5_data");
-
- t_result(result);
-}
-
-static const char *a6 =
- "dns_master_loadfile understands DNSKEY RR specifications "
- "containing key material";
-
-static void
-t6() {
- int result;
-
- t_assert("dns_master_loadfile", 6, T_REQUIRED, "%s", a6);
- result = test_master_x("dns_master_load_6_data");
-
- t_result(result);
-}
-
-static const char *a7 =
- "dns_master_loadfile understands DNSKEY RR specifications "
- "containing no key material";
-
-static void
-t7() {
- int result;
-
- t_assert("dns_master_loadfile", 7, T_REQUIRED, "%s", a7);
- result = test_master_x("dns_master_load_7_data");
-
- t_result(result);
-}
-
-static const char *a8 =
- "dns_master_loadfile understands $INCLUDE";
-
-static void
-t8() {
- int result;
-
- t_assert("dns_master_loadfile", 8, T_REQUIRED, "%s", a8);
- result = test_master_x("dns_master_load_8_data");
-
- t_result(result);
-}
-
-static const char *a9 =
- "dns_master_loadfile understands $INCLUDE with failure";
-
-static void
-t9() {
- int result;
-
- t_assert("dns_master_loadfile", 9, T_REQUIRED, "%s", a9);
- result = test_master_x("dns_master_load_9_data");
-
- t_result(result);
-}
-
-static const char *a10 =
- "dns_master_loadfile non-empty blank lines";
-
-static void
-t10() {
- int result;
-
- t_assert("dns_master_loadfile", 10, T_REQUIRED, "%s", a10);
- result = test_master_x("dns_master_load_10_data");
-
- t_result(result);
-}
-
-static const char *a11 =
- "dns_master_loadfile allow leading zeros in SOA";
-
-static void
-t11() {
- int result;
-
- t_assert("dns_master_loadfile", 11, T_REQUIRED, "%s", a11);
- result = test_master_x("dns_master_load_11_data");
-
- t_result(result);
-}
-
-
-testspec_t T_testlist[] = {
- { (PFV) t1, "ISC_R_SUCCESS" },
- { (PFV) t2, "ISC_R_UNEXPECTEDEND" },
- { (PFV) t3, "DNS_NOOWNER" },
- { (PFV) t4, "DNS_NOTTL" },
- { (PFV) t5, "DNS_BADCLASS" },
- { (PFV) t6, "DNSKEY RR 1" },
- { (PFV) t7, "DNSKEY RR 2" },
- { (PFV) t8, "$INCLUDE" },
- { (PFV) t9, "$INCLUDE w/ DNS_BADCLASS" },
- { (PFV) t10, "non empty blank lines" },
- { (PFV) t11, "leading zeros in serial" },
- { (PFV) 0, NULL }
-};
-
-#ifdef WIN32
-int
-main(int argc, char **argv) {
- t_settests(T_testlist);
- return (t_main(argc, argv));
-}
-#endif
diff --git a/bin/tests/master/win32/t_master.vcxproj.filters.in b/bin/tests/master/win32/t_master.vcxproj.filters.in
deleted file mode 100644
index b3a38285a1..0000000000
--- a/bin/tests/master/win32/t_master.vcxproj.filters.in
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/bin/tests/master/win32/t_master.vcxproj.in b/bin/tests/master/win32/t_master.vcxproj.in
deleted file mode 100644
index 2fb1bab813..0000000000
--- a/bin/tests/master/win32/t_master.vcxproj.in
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
- Debug
- @PLATFORM@
-
-
- Release
- @PLATFORM@
-
-
-
- {5DC2F8D3-9373-41BB-B3AB-78F2E12F1E5E}
- Win32Proj
- t_master
-
-
-
- Application
- true
- MultiByte
-
-
- Application
- false
- true
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
- true
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
- false
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
-
-
-
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- true
- .\;..\..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
- Level3
-
-
- MaxSpeed
- true
- @INTRINSIC@
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- OnlyExplicitInline
- false
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- .\;..\..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- false
- true
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- Default
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
-
-
-
-
-
diff --git a/bin/tests/master/win32/t_master.vcxproj.user b/bin/tests/master/win32/t_master.vcxproj.user
deleted file mode 100644
index 695b5c78b9..0000000000
--- a/bin/tests/master/win32/t_master.vcxproj.user
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/bin/tests/mem/Makefile.in b/bin/tests/mem/Makefile.in
deleted file mode 100644
index cd83865005..0000000000
--- a/bin/tests/mem/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = ${TEST_INCLUDES} ${ISC_INCLUDES}
-
-CDEFINES =
-CWARNINGS =
-
-ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
-TAPILIBS = ../../../lib/tests/libt_api.@A@
-
-ISCDEPLIBS = ../../../lib/isc/libisc.@A@
-TAPIDEPLIBS = ../../../lib/tests/libt_api.@A@
-
-DEPLIBS = ${TAPIDEPLIBS} ${ISCDEPLIBS}
-
-LIBS = ${TAPILIBS} ${ISCLIBS} @LIBS@
-
-TARGETS = t_mem@EXEEXT@
-
-SRCS = t_mem.c
-
-@BIND9_MAKE_RULES@
-
-t_mem@EXEEXT@: t_mem.@O@ ${DEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ t_mem.@O@ ${LIBS}
-
-test: t_mem@EXEEXT@
- -@./t_mem@EXEEXT@ -b @srcdir@ -q 450 -a
-
-testhelp:
- @./t_mem@EXEEXT@ -h
-
-clean distclean::
- rm -f ${TARGETS}
diff --git a/bin/tests/mem/t_mem.c b/bin/tests/mem/t_mem.c
deleted file mode 100644
index a6081aa287..0000000000
--- a/bin/tests/mem/t_mem.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: t_mem.c,v 1.15 2009/01/22 23:47:54 tbox Exp $ */
-
-#include
-
-#include
-
-#include
-
-/*
- * Adapted from the original mempool_test.c program.
- */
-isc_mem_t *mctx;
-
-#define MP1_FREEMAX 10
-#define MP1_FILLCNT 10
-#define MP1_MAXALLOC 30
-
-#define MP2_FREEMAX 25
-#define MP2_FILLCNT 25
-
-static int
-memtest(void) {
- int nfails;
- void *items1[50];
- void *items2[50];
- void *tmp;
- isc_mempool_t *mp1, *mp2;
- isc_result_t isc_result;
- unsigned int i, j;
- int rval;
-
-
- nfails = 0;
- mctx = NULL;
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed %s\n",
- isc_result_totext(isc_result));
- ++nfails;
- return(nfails);
- }
-
- mp1 = NULL;
- isc_result = isc_mempool_create(mctx, 24, &mp1);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mempool_create failed %s\n",
- isc_result_totext(isc_result));
- ++nfails;
- return(nfails);
- }
-
- mp2 = NULL;
- isc_result = isc_mempool_create(mctx, 31, &mp2);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mempool_create failed %s\n",
- isc_result_totext(isc_result));
- ++nfails;
- return(nfails);
- }
-
- if (T_debug)
- isc_mem_stats(mctx, stderr);
-
- t_info("setting freemax to %d\n", MP1_FREEMAX);
- isc_mempool_setfreemax(mp1, MP1_FREEMAX);
- t_info("setting fillcount to %d\n", MP1_FILLCNT);
- isc_mempool_setfillcount(mp1, MP1_FILLCNT);
- t_info("setting maxalloc to %d\n", MP1_MAXALLOC);
- isc_mempool_setmaxalloc(mp1, MP1_MAXALLOC);
-
- /*
- * Allocate MP1_MAXALLOC items from the pool. This is our max.
- */
- for (i = 0; i < MP1_MAXALLOC; i++) {
- items1[i] = isc_mempool_get(mp1);
- if (items1[i] == NULL) {
- t_info("isc_mempool_get unexpectedly failed\n");
- ++nfails;
- }
- }
-
- /*
- * Try to allocate one more. This should fail.
- */
- tmp = isc_mempool_get(mp1);
- if (tmp != NULL) {
- t_info("isc_mempool_get unexpectedly succeeded\n");
- ++nfails;
- }
-
- /*
- * Free the first 11 items. Verify that there are 10 free items on
- * the free list (which is our max).
- */
-
- for (i = 0; i < 11; i++) {
- isc_mempool_put(mp1, items1[i]);
- items1[i] = NULL;
- }
-
- rval = isc_mempool_getfreecount(mp1);
- if (rval != 10) {
- t_info("isc_mempool_getfreecount returned %d, expected %d\n",
- rval, MP1_FREEMAX);
- ++nfails;
- }
-
- rval = isc_mempool_getallocated(mp1);
- if (rval != 19) {
- t_info("isc_mempool_getallocated returned %d, expected %d\n",
- rval, MP1_MAXALLOC - 11);
- ++nfails;
- }
-
- if (T_debug)
- isc_mem_stats(mctx, stderr);
-
- /*
- * Now, beat up on mp2 for a while. Allocate 50 items, then free
- * them, then allocate 50 more, etc.
- */
-
- t_info("setting freemax to %d\n", MP2_FREEMAX);
- isc_mempool_setfreemax(mp2, 25);
- t_info("setting fillcount to %d\n", MP2_FILLCNT);
- isc_mempool_setfillcount(mp2, 25);
-
- t_info("exercising the memory pool\n");
- for (j = 0; j < 500000; j++) {
- for (i = 0; i < 50; i++) {
- items2[i] = isc_mempool_get(mp2);
- if (items2[i] == NULL) {
- t_info("items2[%d] is unexpectedly null\n", i);
- ++nfails;
- }
- }
- for (i = 0; i < 50; i++) {
- isc_mempool_put(mp2, items2[i]);
- items2[i] = NULL;
- }
- if (j % 50000 == 0)
- t_info("...\n");
- }
-
- /*
- * Free all the other items and blow away this pool.
- */
- for (i = 11; i < MP1_MAXALLOC; i++) {
- isc_mempool_put(mp1, items1[i]);
- items1[i] = NULL;
- }
-
- isc_mempool_destroy(&mp1);
-
- if (T_debug)
- isc_mem_stats(mctx, stderr);
-
- isc_mempool_destroy(&mp2);
-
- if (T_debug)
- isc_mem_stats(mctx, stderr);
-
- isc_mem_destroy(&mctx);
-
- return(nfails);
-}
-
-static const char *a1 =
- "the memory module supports the creation of memory contexts "
- "and the management of memory pools.";
-static void
-t1(void) {
- int rval;
- int result;
-
- t_assert("mem", 1, T_REQUIRED, "%s", a1);
-
- rval = memtest();
-
- if (rval == 0)
- result = T_PASS;
- else
- result = T_FAIL;
- t_result(result);
-}
-
-testspec_t T_testlist[] = {
- { (PFV) t1, "basic memory subsystem" },
- { (PFV) 0, NULL }
-};
-
-#ifdef WIN32
-int
-main(int argc, char **argv) {
- t_settests(T_testlist);
- return (t_main(argc, argv));
-}
-#endif
diff --git a/bin/tests/mem/win32/t_mem.vcxproj.filters.in b/bin/tests/mem/win32/t_mem.vcxproj.filters.in
deleted file mode 100644
index fc1bf6f77d..0000000000
--- a/bin/tests/mem/win32/t_mem.vcxproj.filters.in
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/bin/tests/mem/win32/t_mem.vcxproj.in b/bin/tests/mem/win32/t_mem.vcxproj.in
deleted file mode 100644
index c4815f1228..0000000000
--- a/bin/tests/mem/win32/t_mem.vcxproj.in
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
- Debug
- @PLATFORM@
-
-
- Release
- @PLATFORM@
-
-
-
- {627F32A9-267F-41CA-827C-1FD04DE20A56}
- Win32Proj
- t_mem
-
-
-
- Application
- true
- MultiByte
-
-
- Application
- false
- true
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
- true
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
- false
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
-
-
-
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- true
- .\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
- Level3
-
-
- MaxSpeed
- true
- @INTRINSIC@
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- OnlyExplicitInline
- false
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- .\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- false
- true
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- Default
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
-
-
-
-
-
diff --git a/bin/tests/mem/win32/t_mem.vcxproj.user b/bin/tests/mem/win32/t_mem.vcxproj.user
deleted file mode 100644
index 695b5c78b9..0000000000
--- a/bin/tests/mem/win32/t_mem.vcxproj.user
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/bin/tests/names/Makefile.in b/bin/tests/names/Makefile.in
deleted file mode 100644
index 27fc124cdd..0000000000
--- a/bin/tests/names/Makefile.in
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = ${TEST_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES}
-
-CDEFINES =
-CWARNINGS =
-
-# Note that we do not want to use libtool for libt_api
-DNSLIBS = ../../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
-ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
-
-DNSDEPLIBS = ../../../lib/dns/libdns.@A@
-ISCDEPLIBS = ../../../lib/isc/libisc.@A@
-
-DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
-
-LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
-
-TLIB = ../../../lib/tests/libt_api.@A@
-
-TARGETS = t_names@EXEEXT@
-
-SRCS = t_names.c
-
-@BIND9_MAKE_RULES@
-
-t_names@EXEEXT@: t_names.@O@ ${DEPLIBS} ${TLIB}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ t_names.@O@ ${TLIB} ${LIBS}
-
-test: t_names@EXEEXT@
- -@./t_names@EXEEXT@ -c @top_srcdir@/t_config -b @srcdir@ -a
-
-testhelp:
- @./t_names@EXEEXT@ -h
-
-clean distclean::
- rm -f ${TARGETS}
diff --git a/bin/tests/names/dns_name_compare_data b/bin/tests/names/dns_name_compare_data
deleted file mode 100644
index 0467fcfeb0..0000000000
--- a/bin/tests/names/dns_name_compare_data
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# test data for dns_name_compare
-# format:
-#
-# where: exp_order may be one of: -1, 0, 1
-#
-# and where: exp_nlabels and exp_nbits are not tested if < 0
-#
-c.d a.b.c.d -1
-a.b.c.d c.d 1
-a.b.c a.b.c 0
diff --git a/bin/tests/names/dns_name_countlabels_data b/bin/tests/names/dns_name_countlabels_data
deleted file mode 100644
index f11c3873f4..0000000000
--- a/bin/tests/names/dns_name_countlabels_data
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# test data for dns_name_countlabels
-# format:
-#
-#
-c.d 2
-c.d. 3
-a.b.c.d 4
-a.b.c 3
-. 1
diff --git a/bin/tests/names/dns_name_fromregion_data b/bin/tests/names/dns_name_fromregion_data
deleted file mode 100644
index 32b4220483..0000000000
--- a/bin/tests/names/dns_name_fromregion_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_name_fromregion
-# format:
-#
-# where: exp_order may be one of: -1, 0, 1
-#
-# and where: exp_nlabels and exp_nbits are not tested if < 0
-#
-a.b.c.d.
-a.b.c.d.[A].[aaa.
-Ba\x\aa.b.c\[\[o\\.Z
-Ba\x\aa.b.c\[\[o\\\..\.Z
diff --git a/bin/tests/names/dns_name_fromtext_data b/bin/tests/names/dns_name_fromtext_data
deleted file mode 100644
index 16554a5a59..0000000000
--- a/bin/tests/names/dns_name_fromtext_data
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# test data for dns_name_fromtext
-# format:
-#
-#
-a.b a.b.c.d C.d 1
-a.b a.b.c.d C.d 1
-a.b a.b.C.d C.d 0
-a.b. a.b. C.d 0
diff --git a/bin/tests/names/dns_name_fromwire_1_data b/bin/tests/names/dns_name_fromwire_1_data
deleted file mode 100644
index b7ae69bfd8..0000000000
--- a/bin/tests/names/dns_name_fromwire_1_data
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# test data for dns_name_fromwire_1
-# format:
-#
-#
-#
-# where msgfile contains a DNS message in hex form
-#
-# and where testname_offset is the byte offset in this message of
-# the start of a name
-#
-# and where downcase is 1 or 0
-#
-# and where dc_method is one of
-# DNS_COMPRESS_ALL
-# DNS_COMPRESS_GLOBAL14
-# DNS_COMPRESS_NONE
-#
-# and where exp_name is the expected name after any decompression
-# or case conversion
-#
-# and where exp_result may be one of
-# ISC_R_NOSPACE
-# DNS_R_BADLABELTYPE
-# DNS_R_DISALLOWED
-# DNS_R_BADPOINTER
-# ISC_R_UNEXPECTEDEND
-# DNS_R_TOOMANYHOPS
-#
-wire_test1.data 25 1 DNS_COMPRESS_ALL vix.com. ISC_R_SUCCESS
diff --git a/bin/tests/names/dns_name_fromwire_2_data b/bin/tests/names/dns_name_fromwire_2_data
deleted file mode 100644
index 90dfec4e71..0000000000
--- a/bin/tests/names/dns_name_fromwire_2_data
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# test data for dns_name_fromwire_2
-# format:
-#
-#
-#
-# where msgfile contains a DNS message in hex form
-#
-# and where testname_offset is the byte offset in this message of
-# the start of a name
-#
-# and where downcase is 1 or 0
-#
-# and where dc_method is one of
-# DNS_COMPRESS_ALL
-# DNS_COMPRESS_GLOBAL14
-# DNS_COMPRESS_NONE
-#
-# and where exp_name is the expected name after any decompression
-# or case conversion
-#
-# and where exp_result may be one of
-# ISC_R_NOSPACE
-# DNS_R_BADLABELTYPE
-# DNS_R_DISALLOWED
-# DNS_R_BADPOINTER
-# ISC_R_UNEXPECTEDEND
-# DNS_R_TOOMANYHOPS
-#
-wire_test2.data 25 1 DNS_COMPRESS_ALL vix.com. ISC_R_NOSPACE
diff --git a/bin/tests/names/dns_name_fromwire_3_data b/bin/tests/names/dns_name_fromwire_3_data
deleted file mode 100644
index f4253b475d..0000000000
--- a/bin/tests/names/dns_name_fromwire_3_data
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# test data for dns_name_fromwire_3
-# format:
-#
-#
-#
-# where msgfile contains a DNS message in hex form
-#
-# and where testname_offset is the byte offset in this message of
-# the start of a name
-#
-# and where downcase is 1 or 0
-#
-# and where dc_method is one of
-# DNS_COMPRESS_ALL
-# DNS_COMPRESS_GLOBAL14
-# DNS_COMPRESS_NONE
-#
-# and where exp_name is the expected name after any decompression
-# or case conversion
-#
-# and where exp_result may be one of
-# ISC_R_NOSPACE
-# DNS_R_BADLABELTYPE
-# DNS_R_DISALLOWED
-# DNS_R_BADPOINTER
-# ISC_R_UNEXPECTEDEND
-# DNS_R_TOOMANYHOPS
-#
-wire_test3_1.data 25 1 DNS_COMPRESS_ALL vix.com. DNS_R_BADLABELTYPE
-wire_test3_2.data 25 1 DNS_COMPRESS_ALL vix.com. DNS_R_BADLABELTYPE
diff --git a/bin/tests/names/dns_name_fromwire_4_data b/bin/tests/names/dns_name_fromwire_4_data
deleted file mode 100644
index b76b326dbc..0000000000
--- a/bin/tests/names/dns_name_fromwire_4_data
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# test data for dns_name_fromwire_4
-# format:
-#
-#
-#
-# where msgfile contains a DNS message in hex form
-#
-# and where testname_offset is the byte offset in this message of
-# the start of a name
-#
-# and where downcase is 1 or 0
-#
-# and where dc_method is one of
-# DNS_COMPRESS_ALL
-# DNS_COMPRESS_GLOBAL14
-# DNS_COMPRESS_NONE
-#
-# and where exp_name is the expected name after any decompression
-# or case conversion
-#
-# and where exp_result may be one of
-# ISC_R_NOSPACE
-# DNS_R_BADLABELTYPE
-# DNS_R_DISALLOWED
-# DNS_R_BADPOINTER
-# ISC_R_UNEXPECTEDEND
-# DNS_R_TOOMANYHOPS
-#
-wire_test4.data 550 1 DNS_COMPRESS_ALL vix.com. DNS_R_NAMETOOLONG
diff --git a/bin/tests/names/dns_name_fromwire_5_data b/bin/tests/names/dns_name_fromwire_5_data
deleted file mode 100644
index 1a4221b648..0000000000
--- a/bin/tests/names/dns_name_fromwire_5_data
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# test data for dns_name_fromwire_5
-# format:
-#
-#
-#
-# where msgfile contains a DNS message in hex form
-#
-# and where testname_offset is the byte offset in this message of
-# the start of a name
-#
-# and where downcase is 1 or 0
-#
-# and where dc_method is one of
-# DNS_COMPRESS_ALL
-# DNS_COMPRESS_GLOBAL14
-# DNS_COMPRESS_NONE
-#
-# and where exp_name is the expected name after any decompression
-# or case conversion
-#
-# and where exp_result may be one of
-# ISC_R_NOSPACE
-# DNS_R_BADLABELTYPE
-# DNS_R_DISALLOWED
-# DNS_R_BADPOINTER
-# ISC_R_UNEXPECTEDEND
-# DNS_R_TOOMANYHOPS
-#
-wire_test5.data 25 1 DNS_COMPRESS_NONE vix.com. DNS_R_DISALLOWED
diff --git a/bin/tests/names/dns_name_fromwire_6_data b/bin/tests/names/dns_name_fromwire_6_data
deleted file mode 100644
index e4460cea0c..0000000000
--- a/bin/tests/names/dns_name_fromwire_6_data
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# test data for dns_name_fromwire_6
-# format:
-#
-#
-#
-# where msgfile contains a DNS message in hex form
-#
-# and where testname_offset is the byte offset in this message of
-# the start of a name
-#
-# and where downcase is 1 or 0
-#
-# and where dc_method is one of
-# DNS_COMPRESS_ALL
-# DNS_COMPRESS_GLOBAL14
-# DNS_COMPRESS_NONE
-#
-# and where exp_name is the expected name after any decompression
-# or case conversion
-#
-# and where exp_result may be one of
-# ISC_R_NOSPACE
-# DNS_R_BADLABELTYPE
-# DNS_R_DISALLOWED
-# DNS_R_BADPOINTER
-# ISC_R_UNEXPECTEDEND
-# DNS_R_TOOMANYHOPS
-#
-wire_test6.data 25 1 DNS_COMPRESS_ALL vix.com. DNS_R_BADPOINTER
diff --git a/bin/tests/names/dns_name_fromwire_7_data b/bin/tests/names/dns_name_fromwire_7_data
deleted file mode 100644
index 5828bfc884..0000000000
--- a/bin/tests/names/dns_name_fromwire_7_data
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# test data for dns_name_fromwire_7
-# format:
-#
-#
-#
-# where msgfile contains a DNS message in hex form
-#
-# and where testname_offset is the byte offset in this message of
-# the start of a name
-#
-# and where downcase is 1 or 0
-#
-# and where dc_method is one of
-# DNS_COMPRESS_ALL
-# DNS_COMPRESS_GLOBAL14
-# DNS_COMPRESS_NONE
-#
-# and where exp_name is the expected name after any decompression
-# or case conversion
-#
-# and where exp_result may be one of
-# ISC_R_NOSPACE
-# DNS_R_BADLABELTYPE
-# DNS_R_DISALLOWED
-# DNS_R_BADPOINTER
-# ISC_R_UNEXPECTEDEND
-# DNS_R_TOOMANYHOPS
-#
-wire_test7.data 25 1 DNS_COMPRESS_ALL vix.com. ISC_R_UNEXPECTEDEND
diff --git a/bin/tests/names/dns_name_fromwire_8_data b/bin/tests/names/dns_name_fromwire_8_data
deleted file mode 100644
index 9ddd3f3da0..0000000000
--- a/bin/tests/names/dns_name_fromwire_8_data
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# test data for dns_name_fromwire_9
-# format:
-#
-#
-#
-# where msgfile contains a DNS message in hex form
-#
-# and where testname_offset is the byte offset in this message of
-# the start of a name
-#
-# and where downcase is 1 or 0
-#
-# and where dc_method is one of
-# DNS_COMPRESS_ALL
-# DNS_COMPRESS_GLOBAL14
-# DNS_COMPRESS_NONE
-#
-# and where exp_name is the expected name after any decompression
-# or case conversion
-#
-# and where exp_result may be one of
-# ISC_R_NOSPACE
-# DNS_R_BADLABELTYPE
-# DNS_R_DISALLOWED
-# DNS_R_BADPOINTER
-# ISC_R_UNEXPECTEDEND
-# DNS_R_TOOMANYHOPS
-#
-wire_test8.data 25 1 DNS_COMPRESS_ALL vix.com. ISC_R_NOSPACE
diff --git a/bin/tests/names/dns_name_fullcompare_data b/bin/tests/names/dns_name_fullcompare_data
deleted file mode 100644
index f40e7e6998..0000000000
--- a/bin/tests/names/dns_name_fullcompare_data
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# test data for dns_name_fullcompare
-# format:
-#
-# where: exp_reln may be one of:
-# none, equal, contains, subdomain, commonancestor
-# and where: exp_nlabels and exp_nbits are not tested if < 0
-#
-c.d a.b.c.d contains -1 2 0
-a.b.c.d c.d subdomain 1 2 0
diff --git a/bin/tests/names/dns_name_getlabel_data b/bin/tests/names/dns_name_getlabel_data
deleted file mode 100644
index d8dc880a09..0000000000
--- a/bin/tests/names/dns_name_getlabel_data
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# test data for dns_name_compare
-# format:
-#
-# where: label1_pos and label2_pos identify the label position of
-# the common label shared by name1 and name2 respectively
-#
-c.d 1 a.b.c.d 3
-a.b.c.d 3 c.d 1
-a.b.c. 3 a.b.c. 3
diff --git a/bin/tests/names/dns_name_getlabelsequence_data b/bin/tests/names/dns_name_getlabelsequence_data
deleted file mode 100644
index 339604afb0..0000000000
--- a/bin/tests/names/dns_name_getlabelsequence_data
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# test data for dns_name_getlabelsequence
-# format:
-#
-#
-#
-c.d 1 a.b.c.d 3 1
-a.b.c.d.e 2 c.d 0 2
-a.b.c 0 a.b.c 0 3
diff --git a/bin/tests/names/dns_name_hash_data b/bin/tests/names/dns_name_hash_data
deleted file mode 100644
index bf2fc79e4d..0000000000
--- a/bin/tests/names/dns_name_hash_data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# test data for dns_name_hash
-# format:
-#
-# where:
-# cshm is 0 if a case sensitive hash of testname1 should match a
-# case sensitive hash of testname2, otherwise cshm != 0
-# and:
-# cishm is 0 if a case insensitive hash of testname1 should match a
-# case insensitive hash of testname2, otherwise cishm != 0
-#
-a.b.c.d A.B.C.D 0 1
diff --git a/bin/tests/names/dns_name_isabsolute_data b/bin/tests/names/dns_name_isabsolute_data
deleted file mode 100644
index a17c9b8a19..0000000000
--- a/bin/tests/names/dns_name_isabsolute_data
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# test data for dns_name_isabsolute
-# format is:
-#
-#
-x. 1
-a.b.c.d 0
-x.z. 1
diff --git a/bin/tests/names/dns_name_issubdomain_data b/bin/tests/names/dns_name_issubdomain_data
deleted file mode 100644
index 102b0721f3..0000000000
--- a/bin/tests/names/dns_name_issubdomain_data
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# test data for dns_name_issubdomain
-# format:
-#
-# where: issubdomain is 0 if false, else non-zero
-#
-# and where: exp_nlabels and exp_nbits are not tested if < 0
-#
-c.d a.b.c.d 0
-a.b.c.d c.d 1
-a.b.c. a.b.c. 1
diff --git a/bin/tests/names/dns_name_rdatacompare_data b/bin/tests/names/dns_name_rdatacompare_data
deleted file mode 100644
index 7f0c6a2109..0000000000
--- a/bin/tests/names/dns_name_rdatacompare_data
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# test data for dns_name_rdatacompare
-# format:
-#
-# where: exp_order may be one of: -1, 0, 1
-#
-# and where: exp_nlabels and exp_nbits are not tested if < 0
-#
-c.d. a.b.c.d. 1
-a.b.c.d. c.d. -1
-a.b.c. a.b.c. 0
diff --git a/bin/tests/names/dns_name_toregion_data b/bin/tests/names/dns_name_toregion_data
deleted file mode 100644
index 00c10f49f9..0000000000
--- a/bin/tests/names/dns_name_toregion_data
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# test data for dns_name_toregion
-# format:
-#
-#
-a.b.c.d.
-a.b.c.d.[A].[aaa.
-Ba\x\aa.b.c\[\[o\\.Z
diff --git a/bin/tests/names/dns_name_totext_data b/bin/tests/names/dns_name_totext_data
deleted file mode 100644
index 9db22aad1e..0000000000
--- a/bin/tests/names/dns_name_totext_data
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# test data for dns_name_totext
-# format:
-#
-#
-a.b.c.d 1
-a.\\[\[.c.d 1
-a.b.C.d 0
-a.b. 0
diff --git a/bin/tests/names/dns_name_towire_1_data b/bin/tests/names/dns_name_towire_1_data
deleted file mode 100644
index a45d80a69f..0000000000
--- a/bin/tests/names/dns_name_towire_1_data
+++ /dev/null
@@ -1,17 +0,0 @@
-# test data for dns_name_towire_1
-# format:
-#
-#
-#
-# where testname is the test name to be converted to wire format
-#
-# and where dc_method is one of
-# DNS_COMPRESS_ALL
-# DNS_COMPRESS_GLOBAL14
-# DNS_COMPRESS_NONE
-#
-# and where exp_data is the expected wire format data in hex format
-# and where exp_data_len is the length of the expected data in decimal format
-# and where exp_result is the expected return value of dns_name_towire
-#
-a.vix.com. DNS_COMPRESS_NONE 01610376697803636f6d00 11 ISC_R_SUCCESS
diff --git a/bin/tests/names/dns_name_towire_2_data b/bin/tests/names/dns_name_towire_2_data
deleted file mode 100644
index 35479bea10..0000000000
--- a/bin/tests/names/dns_name_towire_2_data
+++ /dev/null
@@ -1,17 +0,0 @@
-# test data for dns_name_towire_1
-# format:
-#
-#
-#
-# where testname is the test name to be converted to wire format
-#
-# and where dc_method is one of
-# DNS_COMPRESS_ALL
-# DNS_COMPRESS_GLOBAL14
-# DNS_COMPRESS_NONE
-#
-# and where exp_data is the expected wire format data in hex format
-# and where exp_data_len is the length of the expected data in decimal format
-# and where exp_result is the expected return value of dns_name_towire
-#
-a.vix.com DNS_COMPRESS_NONE 01610376697803636f6d 10 ISC_R_NOSPACE
diff --git a/bin/tests/names/t_names.c b/bin/tests/names/t_names.c
deleted file mode 100644
index 59e396b36f..0000000000
--- a/bin/tests/names/t_names.c
+++ /dev/null
@@ -1,2379 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: t_names.c,v 1.52 2011/03/12 04:59:46 tbox Exp $ */
-
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-
-#define MAXTOKS 16
-#define BUFLEN 256
-#define BIGBUFLEN 4096
-
-static char *Tokens[MAXTOKS + 1];
-
-
-#ifdef NEED_PBUF
-
-/*%
- * get a hex formatted dns message from a data
- * file into an isc_buffer_t
- * caller supplies data storage and the isc_buffer
- * we read the file, convert, setup the buffer
- * and return the data length
- */
-
-static char *
-ctoh(unsigned char c) {
- int val;
- static char buf[3];
-
- val = (c >> 4) & 0x0f;
- if ((0 <= val) && (val <= 9))
- buf[0] = '0' + val;
- else if ((10 <= val) && (val <= 16))
- buf[0] = 'a' + val - 10;
- val = c & 0x0f;
- if ((0 <= val) && (val <= 9))
- buf[1] = '0' + val;
- else if ((10 <= val) && (val <= 16))
- buf[1] = 'a' + val - 10;
- buf[2] = '\0';
- return (buf);
-}
-
-static void
-pbuf(isc_buffer_t *pbuf) {
- size_t len;
- unsigned char *p;
-
- len = 0;
- p = pbuf->base;
- while (len < pbuf->length) {
- printf("%s", ctoh(*p));
- ++p;
- ++len;
- if ((len % 40) == 0)
- printf("\n");
- }
-}
-
-#endif /* NEED_PBUF */
-
-/*%
- * Compare data at buf with data in hex representation at exp_data,
- * of length exp_data_len, for equality.
- * Return 0 if equal, else non-zero.
- */
-
-static int
-chkdata(unsigned char *buf, size_t buflen, char *exp_data,
- size_t exp_data_len)
-{
- int result;
- unsigned char *p;
- unsigned char *v;
- char *q;
- unsigned char *data;
- size_t cnt;
-
- if (buflen == exp_data_len) {
- data = (unsigned char *)malloc(exp_data_len *
- sizeof(unsigned char));
- if (data == NULL) {
- t_info("malloc failed unexpectedly\n");
- return (-1);
- }
-
- /*
- * First convert exp_data from hex format.
- */
- p = data;
- q = exp_data;
- cnt = 0;
- while (cnt < exp_data_len) {
-
- if (('0' <= *q) && (*q <= '9'))
- *p = *q - '0';
- else if (('a' <= *q) && (*q <= 'f'))
- *p = *q - 'a' + 10;
- else if (('A' <= *q) && (*q <= 'F'))
- *p = *q - 'A' + 10;
- else {
- t_info("malformed comparison data\n");
- free(data);
- return (-1);
- }
- ++q;
-
- *p <<= 4;
-
- if (('0' <= *q) && (*q <= '9'))
- *p |= ((*q - '0') & 0x0f);
- else if (('a' <= *q) && (*q <= 'f'))
- *p |= ((*q - 'a' + 10) & 0x0f);
- else if (('A' <= *q) && (*q <= 'F'))
- *p |= ((*q - 'A' + 10) & 0x0f);
- else {
- t_info("malformed comparison data\n");
- free(data);
- return (-1);
- }
- ++p;
- ++q;
- ++cnt;
- }
-
- /*
- * Now compare data.
- */
- p = buf;
- v = data;
- for (cnt = 0; cnt < exp_data_len; ++cnt) {
- if (*p != *v)
- break;
- ++p;
- ++v;
- }
- if (cnt == exp_data_len)
- result = 0;
- else {
- t_info("bad data at position %lu, "
- "got 0x%.2x, expected 0x%.2x\n",
- (unsigned long)cnt, *p, *v);
- result = (int)cnt + 1;
- }
- (void)free(data);
- } else {
- t_info("data length error, expected %lu, got %lu\n",
- (unsigned long)exp_data_len, (unsigned long)buflen);
- result = (int)(exp_data_len - buflen);
- }
- return (result);
-}
-
-/*%
- * Get a hex formatted dns message from a data file into an isc_buffer_t.
- * Caller supplies data storage and the isc_buffer. We read the file, convert,
- * setup the buffer and return the data length.
- */
-static int
-getmsg(char *datafile_name, isc_buffer_t *pbuf)
-{
- int c;
- unsigned int len;
- unsigned int cnt;
- unsigned char *p;
- FILE *fp;
- unsigned int buflen;
-
- fp = fopen(datafile_name, "r");
- if (fp == NULL) {
- t_info("No such file %s\n", datafile_name);
- return (0);
- }
-
- p = isc_buffer_used(pbuf);
- buflen = isc_buffer_availablelength(pbuf);
- cnt = 0;
- len = 0;
- while ((c = getc(fp)) != EOF) {
- unsigned int val;
- if ( (c == ' ') || (c == '\t') ||
- (c == '\r') || (c == '\n'))
- continue;
- if (c == '#') {
- while ((c = getc(fp)) != '\n')
- ;
- continue;
- }
- if (('0' <= c) && (c <= '9'))
- val = c - '0';
- else if (('a' <= c) && (c <= 'f'))
- val = c - 'a' + 10;
- else if (('A' <= c) && (c <= 'F'))
- val = c - 'A'+ 10;
- else {
- (void)fclose(fp);
- t_info("Bad format in datafile\n");
- return (0);
- }
- if ((len % 2) == 0) {
- *p = (val << 4);
- } else {
- *p += val;
- ++p;
- ++cnt;
- if (cnt >= buflen) {
- /*
- * Buffer too small.
- */
- (void)fclose(fp);
- t_info("Buffer overflow error\n");
- return (0);
- }
- }
- ++len;
- }
- (void)fclose(fp);
-
- if (len % 2) {
- t_info("Bad format in %s\n", datafile_name);
- return (0);
- }
-
- *p = '\0';
- isc_buffer_add(pbuf, cnt);
- return (cnt);
-}
-
-static int
-bustline(char *line, char **toks) {
- int cnt;
- char *p;
-
- cnt = 0;
- if (line && *line) {
- while ((p = strtok(line, "\t")) && (cnt < MAXTOKS)) {
- *toks++ = p;
- line = NULL;
- ++cnt;
- }
- }
- return (cnt);
-}
-
-
-#ifdef NEED_HNAME_TO_TNAME
-
-/*%
- * convert a name from hex representation to text form
- * format of hex notation is:
- * %xXXXXXXXX
- */
-
-static int
-hname_to_tname(char *src, char *target, size_t len) {
- int i;
- int c;
- unsigned int val;
- size_t srclen;
- char *p;
- char *q;
-
- p = src;
- srclen = strlen(p);
- if ((srclen >= 2) && ((*p != '%') || (*(p+1) != 'x'))) {
- /*
- * No conversion needed.
- */
- if (srclen >= len)
- return (1);
- memmove(target, src, srclen + 1);
- return (0);
- }
-
- i = 0;
- p += 2;
- q = target;
- while (*p) {
- c = *p;
- if (('0' < c) && (c <= '9'))
- val = c - '0';
- else if (('a' <= c) && (c <= 'z'))
- val = c + 10 - 'a';
- else if (('A' <= c) && (c <= 'Z'))
- val = c + 10 - 'A';
- else {
- return (1);
- }
- if (i % 2) {
- *q |= val;
- ++q;
- } else
- *q = (val << 4);
- ++i;
- ++p;
- }
- if (i % 2) {
- return (1);
- } else {
- *q = '\0';
- return (0);
- }
-}
-
-#endif /* NEED_HNAME_TO_TNAME */
-
-static const char *a3 = "dns_name_init initializes 'name' to the empty name";
-
-static void
-t_dns_name_init(void) {
- int rval;
- int result;
- dns_name_t name;
- unsigned char offsets[1];
-
- rval = 0;
- t_assert("dns_name_init", 1, T_REQUIRED, "%s", a3);
-
- dns_name_init(&name, offsets);
- /* magic is hidden in name.c ...
- if (name.magic != NAME_MAGIC) {
- t_info("name.magic is not set to NAME_MAGIC\n");
- ++rval;
- }
- */
- if (name.ndata != NULL) {
- t_info("name.ndata is not NULL\n");
- ++rval;
- }
- if (name.length != 0) {
- t_info("name.length is not 0\n");
- ++rval;
- }
- if (name.labels != 0) {
- t_info("name.labels is not 0\n");
- ++rval;
- }
- if (name.attributes != 0) {
- t_info("name.attributes is not 0\n");
- ++rval;
- }
- if (name.offsets != offsets) {
- t_info("name.offsets is incorrect\n");
- ++rval;
- }
- if (name.buffer != NULL) {
- t_info("name.buffer is not NULL\n");
- ++rval;
- }
-
- if (rval == 0)
- result = T_PASS;
- else
- result = T_FAIL;
- t_result(result);
-}
-
-static const char *a4 = "dns_name_invalidate invalidates 'name'";
-
-static void
-t_dns_name_invalidate(void) {
- int rval;
- int result;
- dns_name_t name;
- unsigned char offsets[1];
-
- t_assert("dns_name_invalidate", 1, T_REQUIRED, "%s", a4);
-
- rval = 0;
- dns_name_init(&name, offsets);
- dns_name_invalidate(&name);
-
- /* magic is hidden in name.c ...
- if (name.magic != 0) {
- t_info("name.magic is not set to NAME_MAGIC\n");
- ++rval;
- }
- */
- if (name.ndata != NULL) {
- t_info("name.ndata is not NULL\n");
- ++rval;
- }
- if (name.length != 0) {
- t_info("name.length is not 0\n");
- ++rval;
- }
- if (name.labels != 0) {
- t_info("name.labels is not 0\n");
- ++rval;
- }
- if (name.attributes != 0) {
- t_info("name.attributes is not 0\n");
- ++rval;
- }
- if (name.offsets != NULL) {
- t_info("name.offsets is not NULL\n");
- ++rval;
- }
- if (name.buffer != NULL) {
- t_info("name.buffer is not NULL\n");
- ++rval;
- }
-
- if (rval == 0)
- result = T_PASS;
- else
- result = T_FAIL;
- t_result(result);
-}
-
-static const char *a5 = "dns_name_setbuffer dedicates a buffer for use "
- "with 'name'";
-
-static void
-t_dns_name_setbuffer(void) {
- int result;
- unsigned char junk[BUFLEN];
- dns_name_t name;
- isc_buffer_t buffer;
-
- t_assert("dns_name_setbuffer", 1, T_REQUIRED, "%s", a5);
-
- isc_buffer_init(&buffer, junk, BUFLEN);
- dns_name_init(&name, NULL);
- dns_name_setbuffer(&name, &buffer);
- if (name.buffer == &buffer)
- result = T_PASS;
- else
- result = T_FAIL;
-
- t_result(result);
-}
-
-static const char *a6 = "dns_name_hasbuffer returns ISC_TRUE if 'name' has a "
- "dedicated buffer, otherwise it returns ISC_FALSE";
-
-static void
-t_dns_name_hasbuffer(void) {
- int result;
- int rval;
- unsigned char junk[BUFLEN];
- dns_name_t name;
- isc_buffer_t buffer;
-
- t_assert("dns_name_hasbuffer", 1, T_REQUIRED, "%s", a6);
-
- rval = 0;
- isc_buffer_init(&buffer, junk, BUFLEN);
- dns_name_init(&name, NULL);
- if (dns_name_hasbuffer(&name) != ISC_FALSE)
- ++rval;
- dns_name_setbuffer(&name, &buffer);
- if (dns_name_hasbuffer(&name) != ISC_TRUE)
- ++rval;
- if (rval == 0)
- result = T_PASS;
- else
- result = T_FAIL;
-
- t_result(result);
-}
-
-static const char *a7 = "dns_name_isabsolute returns ISC_TRUE if 'name' ends "
- "in the root label";
-
-static int
-test_dns_name_isabsolute(char *test_name, isc_boolean_t expected) {
- dns_name_t name;
- isc_buffer_t buf;
- isc_buffer_t binbuf;
- unsigned char junk[BUFLEN];
- int len;
- int rval;
- isc_boolean_t isabs_p;
- isc_result_t result;
-
- rval = T_UNRESOLVED;
-
- t_info("testing name %s\n", test_name);
- len = strlen(test_name);
- isc_buffer_init(&buf, test_name, len);
- isc_buffer_add(&buf, len);
- isc_buffer_init(&binbuf, &junk[0], BUFLEN);
- dns_name_init(&name, NULL);
- dns_name_setbuffer(&name, &binbuf);
- result = dns_name_fromtext(&name, &buf, NULL, 0, NULL);
- if (result == ISC_R_SUCCESS) {
- isabs_p = dns_name_isabsolute(&name);
- if (isabs_p == expected)
- rval = T_PASS;
- else
- rval = T_FAIL;
- } else {
- t_info("dns_name_fromtext %s failed, result = %s\n",
- test_name, dns_result_totext(result));
- }
- return (rval);
-}
-
-static void
-t_dns_name_isabsolute(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_isabsolute", 1, T_REQUIRED, "%s", a7);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_isabsolute_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 2) {
- /*
- * label, bitpos, expected value.
- */
- result = test_dns_name_isabsolute(Tokens[0],
- atoi(Tokens[1])
- == 0 ?
- ISC_FALSE :
- ISC_TRUE);
- } else {
- t_info("bad datafile format at line %d\n",
- line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_isabsolute_data\n");
- t_result(result);
- }
-}
-
-static const char *a8 = "dns_name_hash(name, case_sensitive) returns "
- "a hash of 'name' which is case_sensitive if case_sensitive "
- "is true";
-
-/*%
- * a9 merged with a8.
- */
-
-static int
-test_dns_name_hash(char *test_name1, char *test_name2,
- isc_boolean_t csh_match, isc_boolean_t cish_match) {
- int rval;
- int failures;
- isc_boolean_t match;
- unsigned int hash1;
- unsigned int hash2;
- dns_fixedname_t fixed1;
- dns_fixedname_t fixed2;
- dns_name_t *dns_name1;
- dns_name_t *dns_name2;
- isc_result_t result;
-
- rval = T_UNRESOLVED;
- failures = 0;
-
- t_info("testing names %s and %s\n", test_name1, test_name2);
-
- dns_fixedname_init(&fixed1);
- dns_fixedname_init(&fixed2);
- dns_name1 = dns_fixedname_name(&fixed1);
- dns_name2 = dns_fixedname_name(&fixed2);
- result = dns_name_fromstring2(dns_name1, test_name1, NULL, 0, NULL);
- if (result == ISC_R_SUCCESS) {
- result = dns_name_fromstring2(dns_name2, test_name2, NULL,
- 0, NULL);
- if (result == ISC_R_SUCCESS) {
- hash1 = dns_name_hash(dns_name1, ISC_TRUE);
- hash2 = dns_name_hash(dns_name2, ISC_TRUE);
- match = ISC_FALSE;
- if (hash1 == hash2)
- match = ISC_TRUE;
- if (match != csh_match) {
- ++failures;
- t_info("hash mismatch when ISC_TRUE\n");
- }
- hash1 = dns_name_hash(dns_name1, ISC_FALSE);
- hash2 = dns_name_hash(dns_name2, ISC_FALSE);
- match = ISC_FALSE;
- if (hash1 == hash2)
- match = ISC_TRUE;
- if (match != cish_match) {
- ++failures;
- t_info("hash mismatch when ISC_FALSE\n");
- }
- if (failures == 0)
- rval = T_PASS;
- else
- rval = T_FAIL;
- } else {
- t_info("dns_name_fromstring2 %s failed, result = %s\n",
- test_name2, dns_result_totext(result));
- }
- } else {
- t_info("dns_name_fromstring2 %s failed, result = %s\n",
- test_name1, dns_result_totext(result));
- }
- return (rval);
-}
-
-static void
-t_dns_name_hash(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_hash", 1, T_REQUIRED, "%s", a8);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_hash_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 4) {
- /*
- * name1, name2, exp match value if
- * case_sensitive true,
- * exp match value of case_sensitive false
- */
- result = test_dns_name_hash(
- Tokens[0],
- Tokens[1],
- atoi(Tokens[2]) == 0 ?
- ISC_FALSE : ISC_TRUE,
- atoi(Tokens[3]) == 0 ?
- ISC_FALSE : ISC_TRUE);
- } else {
- t_info("bad datafile format at line %d\n",
- line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_hash_data\n");
- t_result(result);
- }
-}
-
-static const char *a10 =
- "dns_name_fullcompare(name1, name2, orderp, nlabelsp) "
- "returns the DNSSEC ordering relationship between name1 and "
- "name2, sets orderp to -1 if name1 < name2, to 0 if "
- "name1 == name2, or to 1 if name1 > name2, sets nlabelsp "
- "to the number of labels name1 and name2 have in common, "
- "and sets nbitsp to the number of bits name1 and name2 "
- "have in common";
-
-/*%
- * a11 thru a22 merged into a10.
- */
-static const char *
-dns_namereln_to_text(dns_namereln_t reln) {
- const char *p;
-
- if (reln == dns_namereln_contains)
- p = "contains";
- else if (reln == dns_namereln_subdomain)
- p = "subdomain";
- else if (reln == dns_namereln_equal)
- p = "equal";
- else if (reln == dns_namereln_none)
- p = "none";
- else if (reln == dns_namereln_commonancestor)
- p = "commonancestor";
- else
- p = "unknown";
-
- return (p);
-}
-
-static int
-test_dns_name_fullcompare(char *name1, char *name2,
- dns_namereln_t exp_dns_reln,
- int exp_order, int exp_nlabels)
-{
- int result;
- int nfails;
- int order;
- unsigned int nlabels;
- dns_fixedname_t fixed1;
- dns_fixedname_t fixed2;
- dns_name_t *dns_name1;
- dns_name_t *dns_name2;
- isc_result_t dns_result;
- dns_namereln_t dns_reln;
-
- nfails = 0;
- result = T_UNRESOLVED;
-
-
- t_info("testing names %s and %s for relation %s\n", name1, name2,
- dns_namereln_to_text(exp_dns_reln));
-
- dns_fixedname_init(&fixed1);
- dns_fixedname_init(&fixed2);
- dns_name1 = dns_fixedname_name(&fixed1);
- dns_name2 = dns_fixedname_name(&fixed2);
- dns_result = dns_name_fromstring2(dns_name1, name1, NULL, 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- dns_result = dns_name_fromstring2(dns_name2, name2, NULL,
- 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- dns_reln = dns_name_fullcompare(dns_name1, dns_name2,
- &order, &nlabels);
-
- if (dns_reln != exp_dns_reln) {
- ++nfails;
- t_info("expected relationship of %s, got %s\n",
- dns_namereln_to_text(exp_dns_reln),
- dns_namereln_to_text(dns_reln));
- }
- /*
- * Normalize order.
- */
- if (order < 0)
- order = -1;
- else if (order > 0)
- order = 1;
- if (order != exp_order) {
- ++nfails;
- t_info("expected ordering %d, got %d\n",
- exp_order, order);
- }
- if ((exp_nlabels >= 0) &&
- (nlabels != (unsigned int)exp_nlabels)) {
- ++nfails;
- t_info("expecting %d labels, got %d\n",
- exp_nlabels, nlabels);
- }
- if (nfails == 0)
- result = T_PASS;
- else
- result = T_FAIL;
- } else {
- t_info("dns_name_fromstring2 failed, result == %s\n",
- dns_result_totext(result));
- }
- } else {
- t_info("dns_name_fromstring2 failed, result == %s\n",
- dns_result_totext(result));
- }
-
- return (result);
-}
-
-static void
-t_dns_name_fullcompare(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
- dns_namereln_t reln;
-
- t_assert("dns_name_fullcompare", 1, T_REQUIRED, "%s", a10);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_fullcompare_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 6) {
- /*
- * name1, name2, exp_reln, exp_order,
- * exp_nlabels
- */
- if (!strcmp(Tokens[2], "none"))
- reln = dns_namereln_none;
- else if (!strcmp(Tokens[2], "contains"))
- reln = dns_namereln_contains;
- else if (!strcmp(Tokens[2], "subdomain"))
- reln = dns_namereln_subdomain;
- else if (!strcmp(Tokens[2], "equal"))
- reln = dns_namereln_equal;
- else if (!strcmp(Tokens[2], "commonancestor"))
- reln = dns_namereln_commonancestor;
- else {
- t_info("bad format at line %d\n", line);
- (void)free(p);
- continue;
- }
- result = test_dns_name_fullcompare(
- Tokens[0],
- Tokens[1],
- reln,
- atoi(Tokens[3]),
- atoi(Tokens[4]));
- } else {
- t_info("bad format at line %d\n", line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_fullcompare_data\n");
- t_result(result);
- }
-}
-
-static const char *a23 =
- "dns_name_compare(name1, name2) returns information about "
- "the relative ordering under the DNSSEC ordering relationship "
- "of name1 and name2";
-
-/*%
- * a24 thru a29 merged into a23.
- */
-
-static int
-test_dns_name_compare(char *name1, char *name2, int exp_order) {
- int result;
- int order;
- isc_result_t dns_result;
- dns_fixedname_t fixed1;
- dns_fixedname_t fixed2;
- dns_name_t *dns_name1;
- dns_name_t *dns_name2;
-
- result = T_UNRESOLVED;
-
- t_info("testing %s %s %s\n", name1,
- exp_order == 0 ? "==": (exp_order == -1 ? "<" : ">"),
- name2);
-
- dns_fixedname_init(&fixed1);
- dns_fixedname_init(&fixed2);
- dns_name1 = dns_fixedname_name(&fixed1);
- dns_name2 = dns_fixedname_name(&fixed2);
- dns_result = dns_name_fromstring2(dns_name1, name1, NULL, 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- dns_result = dns_name_fromstring2(dns_name2, name2, NULL,
- 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- order = dns_name_compare(dns_name1, dns_name2);
- /*
- * Normalize order.
- */
- if (order < 0)
- order = -1;
- else if (order > 0)
- order = 1;
- if (order != exp_order) {
- t_info("expected order of %d, got %d\n",
- exp_order, order);
- result = T_FAIL;
- } else
- result = T_PASS;
- } else {
- t_info("dns_name_fromstring2 failed, result == %s\n",
- dns_result_totext(result));
- }
- } else {
- t_info("dns_name_fromstring2 failed, result == %s\n",
- dns_result_totext(result));
- }
-
- return (result);
-}
-
-static void
-t_dns_name_compare(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_compare", 1, T_REQUIRED, "%s", a23);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_compare_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 3) {
- /*
- * name1, name2, order.
- */
- result = test_dns_name_compare(
- Tokens[0],
- Tokens[1],
- atoi(Tokens[2]));
- } else {
- t_info("bad datafile format at line %d\n",
- line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_compare_data\n");
- t_result(result);
- }
-}
-
-static const char *a30 =
- "dns_name_rdatacompare(name1, name2) returns information "
- "about the relative ordering of name1 and name2 as if they "
- "are part of rdata in DNSSEC canonical form";
-
-/*%
- * a31, a32 merged into a30.
- */
-
-static int
-test_dns_name_rdatacompare(char *name1, char *name2, int exp_order) {
- int result;
- int order;
- isc_result_t dns_result;
- dns_fixedname_t fixed1;
- dns_fixedname_t fixed2;
- dns_name_t *dns_name1;
- dns_name_t *dns_name2;
-
- result = T_UNRESOLVED;
-
- t_info("testing %s %s %s\n", name1,
- exp_order == 0 ? "==": (exp_order == -1 ? "<" : ">"), name2);
-
- dns_fixedname_init(&fixed1);
- dns_fixedname_init(&fixed2);
- dns_name1 = dns_fixedname_name(&fixed1);
- dns_name2 = dns_fixedname_name(&fixed2);
- dns_result = dns_name_fromstring2(dns_name1, name1, NULL, 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- dns_result = dns_name_fromstring2(dns_name2, name2, NULL,
- 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- order = dns_name_rdatacompare(dns_name1, dns_name2);
- /*
- * Normalize order.
- */
- if (order < 0)
- order = -1;
- else if (order > 0)
- order = 1;
- if (order != exp_order) {
- t_info("expected order of %d, got %d\n",
- exp_order, order);
- result = T_FAIL;
- } else
- result = T_PASS;
- } else {
- t_info("dns_name_fromstring2 failed, result == %s\n",
- dns_result_totext(result));
- }
- } else {
- t_info("dns_name_fromstring2 failed, result == %s\n",
- dns_result_totext(result));
- }
-
- return (result);
-}
-
-static void
-t_dns_name_rdatacompare(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_rdatacompare", 1, T_REQUIRED, "%s", a30);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_rdatacompare_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 3) {
- /*
- * name1, name2, order.
- */
- result = test_dns_name_rdatacompare(
- Tokens[0],
- Tokens[1],
- atoi(Tokens[2]));
- } else {
- t_info("bad datafile format at line %d\n",
- line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_rdatacompare_data\n");
- t_result(result);
- }
-}
-
-
-static const char *a33 =
- "when name1 is a subdomain of name2, "
- "dns_name_issubdomain(name1, name2) returns true, "
- "otherwise it returns false.";
-
-/*%
- * a34 merged into a33.
- */
-
-static int
-test_dns_name_issubdomain(char *name1, char *name2, isc_boolean_t exp_rval) {
- int result;
- isc_boolean_t rval;
- isc_result_t dns_result;
- dns_fixedname_t fixed1;
- dns_fixedname_t fixed2;
- dns_name_t *dns_name1;
- dns_name_t *dns_name2;
-
- result = T_UNRESOLVED;
-
- t_info("testing %s %s a subdomain of %s\n", name1,
- exp_rval == 0 ? "is not" : "is", name2);
-
- dns_fixedname_init(&fixed1);
- dns_fixedname_init(&fixed2);
- dns_name1 = dns_fixedname_name(&fixed1);
- dns_name2 = dns_fixedname_name(&fixed2);
- dns_result = dns_name_fromstring2(dns_name1, name1, NULL, 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- dns_result = dns_name_fromstring2(dns_name2, name2, NULL,
- 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- rval = dns_name_issubdomain(dns_name1, dns_name2);
-
- if (rval != exp_rval) {
- t_info("expected return value of %s, got %s\n",
- exp_rval == ISC_TRUE ? "true" : "false",
- rval == ISC_TRUE ? "true" : "false");
- result = T_FAIL;
- } else
- result = T_PASS;
- } else {
- t_info("dns_name_fromstring2 failed, result == %s\n",
- dns_result_totext(result));
- }
- } else {
- t_info("dns_name_fromstring2 failed, result == %s\n",
- dns_result_totext(result));
- }
-
- return (result);
-}
-
-static void
-t_dns_name_issubdomain(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_issubdomain", 1, T_REQUIRED, "%s", a33);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_issubdomain_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 3) {
- /*
- * name1, name2, issubdomain_p.
- */
- result = test_dns_name_issubdomain(
- Tokens[0],
- Tokens[1],
- atoi(Tokens[2]) == 0 ?
- ISC_FALSE : ISC_TRUE);
- } else {
- t_info("bad datafile format at line %d\n",
- line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_issubdomain_data\n");
- t_result(result);
- }
-}
-
-static const char *a35 =
- "dns_name_countlabels(name) returns the number "
- "of labels in name";
-
-static int
-test_dns_name_countlabels(char *test_name, unsigned int exp_nlabels) {
- int result;
- unsigned int nlabels;
- isc_result_t dns_result;
- dns_fixedname_t fixed;
- dns_name_t *dns_name;
-
- result = T_UNRESOLVED;
-
- t_info("testing %s\n", test_name);
-
- dns_fixedname_init(&fixed);
- dns_name = dns_fixedname_name(&fixed);
- dns_result = dns_name_fromstring2(dns_name, test_name, NULL, 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- nlabels = dns_name_countlabels(dns_name);
-
- if (nlabels != exp_nlabels) {
- t_info("expected %d, got %d\n", exp_nlabels, nlabels);
- result = T_FAIL;
- } else
- result = T_PASS;
- } else {
- t_info("dns_name_fromstring2 failed, result == %s\n",
- dns_result_totext(dns_result));
- }
-
- return (result);
-}
-
-static void
-t_dns_name_countlabels(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_countlabels", 1, T_REQUIRED, "%s", a35);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_countlabels_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 2) {
- /*
- * name, nlabels.
- */
- result = test_dns_name_countlabels(Tokens[0],
- atoi(Tokens[1]));
- } else {
- t_info("bad format at line %d\n", line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_countlabels_data\n");
- t_result(result);
- }
-}
-
-static const char *a36 =
- "when n is less than the number of labels in name, "
- "dns_name_getlabel(name, n, labelp) initializes labelp "
- "to point to the nth label in name";
-
-/*%
- * The strategy here is two take two dns names with a shared label in
- * different positions, get the two labels and compare them for equality.
- * If they don't match, dns_name_getlabel failed.
- */
-
-static int
-test_dns_name_getlabel(char *test_name1, int label1_pos, char *test_name2,
- int label2_pos)
-{
- int result;
- int nfails;
- unsigned int cnt;
- unsigned char *p;
- unsigned char *q;
- dns_fixedname_t fixed1;
- dns_fixedname_t fixed2;
- dns_name_t *dns_name1;
- dns_name_t *dns_name2;
- dns_label_t dns_label1;
- dns_label_t dns_label2;
- isc_result_t dns_result;
-
- nfails = 0;
- result = T_UNRESOLVED;
-
- t_info("testing with %s and %s\n", test_name1, test_name2);
-
- dns_fixedname_init(&fixed1);
- dns_fixedname_init(&fixed2);
- dns_name1 = dns_fixedname_name(&fixed1);
- dns_name2 = dns_fixedname_name(&fixed2);
- dns_result = dns_name_fromstring2(dns_name1, test_name1, NULL,
- 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- dns_result = dns_name_fromstring2(dns_name2, test_name2, NULL,
- 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- dns_name_getlabel(dns_name1, label1_pos, &dns_label1);
- dns_name_getlabel(dns_name2, label2_pos, &dns_label2);
- if (dns_label1.length != dns_label2.length) {
- t_info("label lengths differ\n");
- ++nfails;
- }
- p = dns_label1.base;
- q = dns_label2.base;
- for (cnt = 0; cnt < dns_label1.length; ++cnt) {
- if (*p++ != *q++) {
- t_info("labels differ at position %d",
- cnt);
- ++nfails;
- }
- }
- if (nfails == 0)
- result = T_PASS;
- else
- result = T_FAIL;
- } else {
- t_info("dns_name_fromstring2 failed, result == %s",
- dns_result_totext(result));
- }
- } else {
- t_info("dns_name_fromstring2 failed, result == %s",
- dns_result_totext(result));
- }
- return (result);
-}
-
-static void
-t_dns_name_getlabel(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_getlabel", 1, T_REQUIRED, "%s", a36);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_getlabel_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 4) {
- /*
- * name1, name2, nlabels.
- */
- result = test_dns_name_getlabel(Tokens[0],
- atoi(Tokens[1]),
- Tokens[2],
- atoi(Tokens[3]));
- } else {
- t_info("bad format at line %d\n", line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_getlabel_data\n");
- t_result(result);
- }
-}
-
-static const char *a37 =
- "when source contains at least first + n labels, "
- "dns_name_getlabelsequence(source, first, n, target) "
- "initializes target to point to the n label sequence of "
- "labels in source starting with first";
-
-/*%
- * We adopt a similiar strategy to that used by the dns_name_getlabel test.
- */
-
-static int
-test_dns_name_getlabelsequence(char *test_name1, int label1_start,
- char *test_name2, int label2_start, int range)
-{
- int result;
- int nfails;
- unsigned int cnt;
- unsigned char *p;
- unsigned char *q;
- dns_fixedname_t fixed1;
- dns_fixedname_t fixed2;
- dns_name_t *dns_name1;
- dns_name_t *dns_name2;
- dns_name_t dns_targetname1;
- dns_name_t dns_targetname2;
- isc_result_t dns_result;
- isc_buffer_t buffer1;
- isc_buffer_t buffer2;
- unsigned char junk1[BUFLEN];
- unsigned char junk2[BUFLEN];
-
- nfails = 0;
- result = T_UNRESOLVED;
- dns_fixedname_init(&fixed1);
- dns_fixedname_init(&fixed2);
- dns_name1 = dns_fixedname_name(&fixed1);
- dns_name2 = dns_fixedname_name(&fixed2);
- dns_result = dns_name_fromstring2(dns_name1, test_name1, NULL,
- 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- dns_result = dns_name_fromstring2(dns_name2, test_name2, NULL,
- 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- t_info("testing %s %s\n", test_name1, test_name2);
- dns_name_init(&dns_targetname1, NULL);
- dns_name_init(&dns_targetname2, NULL);
- dns_name_getlabelsequence(dns_name1, label1_start,
- range, &dns_targetname1);
- dns_name_getlabelsequence(dns_name2, label2_start,
- range, &dns_targetname2);
-
- /*
- * Now convert both targets to text for comparison.
- */
- isc_buffer_init(&buffer1, junk1, BUFLEN);
- isc_buffer_init(&buffer2, junk2, BUFLEN);
- dns_name_totext(&dns_targetname1, ISC_TRUE, &buffer1);
- dns_name_totext(&dns_targetname2, ISC_TRUE, &buffer2);
- if (buffer1.used == buffer2.used) {
- p = buffer1.base;
- q = buffer2.base;
- for (cnt = 0; cnt < buffer1.used; ++cnt) {
- if (*p != *q) {
- ++nfails;
- t_info("names differ at %d\n",
- cnt);
- break;
- }
- ++p; ++q;
- }
- } else {
- ++nfails;
- t_info("lengths differ\n");
- }
- if (nfails == 0)
- result = T_PASS;
- else
- result = T_FAIL;
- } else {
- t_info("dns_name_fromstring2 failed, result == %s",
- dns_result_totext(dns_result));
- }
- } else {
- t_info("dns_name_fromstring2 failed, result == %s",
- dns_result_totext(dns_result));
- }
- return (result);
-}
-
-static void
-t_dns_name_getlabelsequence(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_getlabelsequence", 1, T_REQUIRED, "%s", a37);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_getlabelsequence_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 5) {
- /*
- * name1, name2, nlabels.
- */
- result = test_dns_name_getlabelsequence(
- Tokens[0],
- atoi(Tokens[1]),
- Tokens[2],
- atoi(Tokens[3]),
- atoi(Tokens[4]));
- } else {
- t_info("bad format at line %d\n", line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_getlabelsequence_data\n");
- t_result(result);
- }
-}
-
-static const char *a38 =
- "dns_name_fromregion(name, region) converts a DNS name "
- "from a region representation to a name representation";
-
-static int
-test_dns_name_fromregion(char *test_name) {
- int result;
- int order;
- unsigned int nlabels;
- isc_result_t dns_result;
- dns_fixedname_t fixed1;
- dns_name_t *dns_name1;
- dns_name_t dns_name2;
- dns_namereln_t dns_namereln;
- isc_region_t region;
-
- result = T_UNRESOLVED;
-
- t_info("testing %s\n", test_name);
-
- dns_fixedname_init(&fixed1);
- dns_name1 = dns_fixedname_name(&fixed1);
- dns_result = dns_name_fromstring2(dns_name1, test_name, NULL, 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
-
- dns_name_toregion(dns_name1, ®ion);
-
- dns_name_init(&dns_name2, NULL);
- dns_name_fromregion(&dns_name2, ®ion);
- dns_namereln = dns_name_fullcompare(dns_name1, &dns_name2,
- &order, &nlabels);
- if (dns_namereln == dns_namereln_equal)
- result = T_PASS;
- else
- result = T_FAIL;
- } else {
- t_info("dns_name_fromstring2 failed, result == %s\n",
- dns_result_totext(result));
- }
- return (result);
-}
-
-static void
-t_dns_name_fromregion(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_fromregion", 1, T_REQUIRED, "%s", a38);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_fromregion_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 1) {
- /*
- * test_name.
- */
- result = test_dns_name_fromregion(Tokens[0]);
- } else {
- t_info("bad format at line %d\n", line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_fromregion_data\n");
- t_result(result);
- }
-}
-
-static const char *a39 =
- "dns_name_toregion(name, region) converts a DNS name "
- "from a region representation to a name representation";
-
-static void
-t_dns_name_toregion(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_toregion", 1, T_REQUIRED, "%s", a39);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_toregion_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 1) {
- /*
- * test_name.
- */
- result = test_dns_name_fromregion(Tokens[0]);
- } else {
- t_info("bad format at line %d\n", line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_toregion_data\n");
- t_result(result);
- }
-}
-
-static const char *a40 =
- "dns_name_fromtext(name, source, origin, downcase, target) "
- "converts the textual representation of a DNS name at source "
- "into uncompressed wire form at target, appending origin to "
- "the converted name if origin is non-NULL and converting "
- "upper case to lower case during conversion "
- "if downcase is true.";
-
-static int
-test_dns_name_fromtext(char *test_name1, char *test_name2, char *test_origin,
- unsigned int downcase)
-{
- int result;
- int order;
- unsigned int nlabels;
- unsigned char junk1[BUFLEN];
- unsigned char junk2[BUFLEN];
- unsigned char junk3[BUFLEN];
- isc_buffer_t binbuf1;
- isc_buffer_t binbuf2;
- isc_buffer_t binbuf3;
- isc_buffer_t txtbuf1;
- isc_buffer_t txtbuf2;
- isc_buffer_t txtbuf3;
- dns_name_t dns_name1;
- dns_name_t dns_name2;
- dns_name_t dns_name3;
- isc_result_t dns_result;
- dns_namereln_t dns_namereln;
-
- t_info("testing %s %s %s\n", test_name1, test_name2, test_origin);
-
- isc_buffer_init(&binbuf1, junk1, BUFLEN);
- isc_buffer_init(&binbuf2, junk2, BUFLEN);
- isc_buffer_init(&binbuf3, junk3, BUFLEN);
-
- isc_buffer_init(&txtbuf1, test_name1, strlen(test_name1));
- isc_buffer_add(&txtbuf1, strlen(test_name1));
-
- isc_buffer_init(&txtbuf2, test_name2, strlen(test_name2));
- isc_buffer_add(&txtbuf2, strlen(test_name2));
-
- isc_buffer_init(&txtbuf3, test_origin, strlen(test_origin));
- isc_buffer_add(&txtbuf3, strlen(test_origin));
- dns_name_init(&dns_name1, NULL);
- dns_name_init(&dns_name2, NULL);
- dns_name_init(&dns_name3, NULL);
- dns_name_setbuffer(&dns_name1, &binbuf1);
- dns_name_setbuffer(&dns_name2, &binbuf2);
- dns_name_setbuffer(&dns_name3, &binbuf3);
-
- dns_result = dns_name_fromtext(&dns_name3, &txtbuf3, NULL, 0,
- &binbuf3);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext(dns_name3) failed, result == %s\n",
- dns_result_totext(dns_result));
- return (T_FAIL);
- }
-
- dns_result = dns_name_fromtext(&dns_name1, &txtbuf1, &dns_name3,
- downcase, &binbuf1);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext(dns_name1) failed, result == %s\n",
- dns_result_totext(dns_result));
- return (T_FAIL);
- }
-
- dns_result = dns_name_fromtext(&dns_name2, &txtbuf2, NULL, 0,
- &binbuf2);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext(dns_name2) failed, result == %s\n",
- dns_result_totext(dns_result));
- return (T_FAIL);
- }
-
- dns_namereln = dns_name_fullcompare(&dns_name1, &dns_name2, &order,
- &nlabels);
-
- if (dns_namereln == dns_namereln_equal)
- result = T_PASS;
- else {
- t_info("dns_name_fullcompare returned %s\n",
- dns_namereln_to_text(dns_namereln));
- result = T_FAIL;
- }
-
- return (result);
-}
-
-static void
-t_dns_name_fromtext(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_fromtext", 1, T_REQUIRED, "%s", a40);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_fromtext_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 4) {
- /*
- * test_name1, test_name2, test_origin,
- * downcase.
- */
- result = test_dns_name_fromtext(Tokens[0],
- Tokens[1],
- Tokens[2],
- atoi(Tokens[3])
- == 0 ?
- 0 :
- DNS_NAME_DOWNCASE);
- } else {
- t_info("bad format at line %d\n", line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_fromtext\n");
- t_result(result);
- }
-}
-
-static const char *a41 =
- "dns_name_totext(name, omit_final_dot, target) converts "
- "the DNS name 'name' in wire format to textual format "
- "at target, and adds a final '.' to the name if "
- "omit_final_dot is false";
-
-static int
-test_dns_name_totext(char *test_name, isc_boolean_t omit_final) {
- int result;
- int len;
- int order;
- unsigned int nlabels;
- unsigned char junk1[BUFLEN];
- unsigned char junk2[BUFLEN];
- unsigned char junk3[BUFLEN];
- isc_buffer_t buf1;
- isc_buffer_t buf2;
- isc_buffer_t buf3;
- dns_name_t dns_name1;
- dns_name_t dns_name2;
- isc_result_t dns_result;
- dns_namereln_t dns_namereln;
-
- t_info("testing %s\n", test_name);
-
- len = strlen(test_name);
- isc_buffer_init(&buf1, test_name, len);
- isc_buffer_add(&buf1, len);
-
- dns_name_init(&dns_name1, NULL);
- isc_buffer_init(&buf2, junk2, BUFLEN);
-
- /*
- * Out of the data file to dns_name1.
- */
- dns_result = dns_name_fromtext(&dns_name1, &buf1, NULL, 0, &buf2);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed, result == %s\n",
- dns_result_totext(dns_result));
- return (T_UNRESOLVED);
- }
-
- /*
- * From dns_name1 into a text buffer.
- */
- isc_buffer_invalidate(&buf1);
- isc_buffer_init(&buf1, junk1, BUFLEN);
- dns_result = dns_name_totext(&dns_name1, omit_final, &buf1);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_totext failed, result == %s\n",
- dns_result_totext(dns_result));
- return (T_FAIL);
- }
-
- /*
- * From the text buffer into dns_name2.
- */
- dns_name_init(&dns_name2, NULL);
- isc_buffer_init(&buf3, junk3, BUFLEN);
- dns_result = dns_name_fromtext(&dns_name2, &buf1, NULL, 0, &buf3);
- if (dns_result != ISC_R_SUCCESS) {
- t_info("dns_name_fromtext failed, result == %s\n",
- dns_result_totext(dns_result));
- return (T_UNRESOLVED);
- }
-
- dns_namereln = dns_name_fullcompare(&dns_name1, &dns_name2,
- &order, &nlabels);
- if (dns_namereln == dns_namereln_equal)
- result = T_PASS;
- else {
- t_info("dns_name_fullcompare returned %s\n",
- dns_namereln_to_text(dns_namereln));
- result = T_FAIL;
- }
-
- return (result);
-}
-
-static void
-t_dns_name_totext(void) {
- int line;
- int cnt;
- int result;
- char *p;
- FILE *fp;
-
- t_assert("dns_name_totext", 1, T_REQUIRED, "%s", a41);
-
- result = T_UNRESOLVED;
- fp = fopen("dns_name_totext_data", "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 2) {
- /*
- * test_name, omit_final.
- */
- result = test_dns_name_totext(Tokens[0],
- atoi(Tokens[1]) == 0 ?
- ISC_FALSE :
- ISC_TRUE);
- } else {
- t_info("bad format at line %d\n", line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile dns_name_totext\n");
- t_result(result);
- }
-}
-
-static const char *a42 =
- "dns_name_fromwire(name, source, dctx, downcase, target) "
- "converts the possibly compressed DNS name 'name' in wire "
- "format to canonicalized form at target, performing upper to "
- "lower case conversion if downcase is true, and returns "
- "ISC_R_SUCCESS";
-
-#if 0
- /*
- * XXXRTH these tests appear to be broken, so I have
- * disabled them.
- */
-static const char *a43 =
- "when a label length is invalid, dns_name_fromwire() "
- "returns DNS_R_FORMERR";
-
-static const char *a44 =
- "when a label type is invalid, dns_name_fromwire() "
- "returns DNS_R_BADLABELTYPE";
-#endif
-
-static const char *a45 =
- "when a name length is invalid, dns_name_fromwire() "
- "returns DNS_R_FORMERR";
-
-static const char *a46 =
- "when a compression type is invalid, dns_name_fromwire() "
- "returns DNS_R_DISALLOWED";
-
-static const char *a47 =
- "when a bad compression pointer is encountered, "
- "dns_name_fromwire() returns DNS_R_BADPOINTER";
-
-static const char *a48 =
- "when input ends unexpected, dns_name_fromwire() "
- "returns ISC_R_UNEXPECTEDEND";
-
-static const char *a49 =
- "when there is not enough space in target, "
- "dns_name_fromwire(name, source, dcts, downcase, target) "
- "returns ISC_R_NOSPACE";
-
-static int
-test_dns_name_fromwire(char *datafile_name, int testname_offset, int downcase,
- unsigned int dc_method, char *exp_name,
- isc_result_t exp_result, size_t buflen)
-{
- int result;
- int order;
- unsigned int nlabels;
- int len;
- unsigned char buf1[BIGBUFLEN];
- char buf2[BUFLEN];
- isc_buffer_t iscbuf1;
- isc_buffer_t iscbuf2;
- dns_fixedname_t fixed2;
- dns_name_t dns_name1;
- dns_name_t *dns_name2;
- isc_result_t dns_result;
- dns_namereln_t dns_namereln;
- dns_decompress_t dctx;
-
- t_info("testing using %s\n", datafile_name);
- isc_buffer_init(&iscbuf1, buf1, sizeof(buf1));
- len = getmsg(datafile_name, &iscbuf1);
- if (len == 0)
- return (T_FAIL);
-
- isc_buffer_setactive(&iscbuf1, len);
- iscbuf1.current = testname_offset;
-
- isc_buffer_init(&iscbuf2, buf2, (unsigned int)buflen);
- dns_name_init(&dns_name1, NULL);
- dns_decompress_init(&dctx, -1, DNS_DECOMPRESS_STRICT);
- dns_decompress_setmethods(&dctx, dc_method);
- dns_result = dns_name_fromwire(&dns_name1, &iscbuf1,
- &dctx, downcase ? ISC_TRUE : ISC_FALSE,
- &iscbuf2);
-
- if ((dns_result == exp_result) && (exp_result == ISC_R_SUCCESS)) {
-
- dns_fixedname_init(&fixed2);
- dns_name2 = dns_fixedname_name(&fixed2);
- dns_result = dns_name_fromstring2(dns_name2, exp_name, NULL,
- 0, NULL);
- if (dns_result == ISC_R_SUCCESS) {
- dns_namereln = dns_name_fullcompare(&dns_name1,
- dns_name2,
- &order, &nlabels);
- if (dns_namereln != dns_namereln_equal) {
- t_info("dns_name_fullcompare returned %s\n",
- dns_namereln_to_text(dns_namereln));
- result = T_FAIL;
- } else {
- result = T_PASS;
- }
- } else {
- t_info("dns_name_fromtext %s failed, result = %s\n",
- exp_name, dns_result_totext(dns_result));
- result = T_UNRESOLVED;
- }
- } else if (dns_result == exp_result) {
- result = T_PASS;
- } else {
- t_info("dns_name_fromwire returned %s\n",
- dns_result_totext(dns_result));
- result = T_FAIL;
- }
-
- return (result);
-}
-
-static void
-t_dns_name_fromwire_x(const char *testfile, size_t buflen) {
- int line;
- int cnt;
- int result;
- unsigned int dc_method;
- isc_result_t exp_result;
- char *p;
- char *tok;
- FILE *fp;
-
- result = T_UNRESOLVED;
- fp = fopen(testfile, "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 6) {
- /*
- * datafile_name, testname_offset,
- * downcase, dc_method,
- * exp_name, exp_result.
- */
-
- tok = Tokens[5];
- exp_result = ISC_R_SUCCESS;
- if (! strcmp(tok, "ISC_R_SUCCESS"))
- exp_result = ISC_R_SUCCESS;
- else if (! strcmp(tok, "ISC_R_NOSPACE"))
- exp_result = ISC_R_NOSPACE;
- else if (! strcmp(tok, "DNS_R_BADLABELTYPE"))
- exp_result = DNS_R_BADLABELTYPE;
- else if (! strcmp(tok, "DNS_R_FORMERR"))
- exp_result = DNS_R_FORMERR;
- else if (! strcmp(tok, "DNS_R_BADPOINTER"))
- exp_result = DNS_R_BADPOINTER;
- else if (! strcmp(tok, "ISC_R_UNEXPECTEDEND"))
- exp_result = ISC_R_UNEXPECTEDEND;
- else if (! strcmp(tok, "DNS_R_TOOMANYHOPS"))
- exp_result = DNS_R_TOOMANYHOPS;
- else if (! strcmp(tok, "DNS_R_DISALLOWED"))
- exp_result = DNS_R_DISALLOWED;
- else if (! strcmp(tok, "DNS_R_NAMETOOLONG"))
- exp_result = DNS_R_NAMETOOLONG;
-
- tok = Tokens[3];
- dc_method = DNS_COMPRESS_NONE;
- if (! strcmp(tok, "DNS_COMPRESS_GLOBAL14"))
- dc_method = DNS_COMPRESS_GLOBAL14;
- else if (! strcmp(tok, "DNS_COMPRESS_ALL"))
- dc_method = DNS_COMPRESS_ALL;
-
- result = test_dns_name_fromwire(Tokens[0],
- atoi(Tokens[1]),
- atoi(Tokens[2]),
- dc_method,
- Tokens[4],
- exp_result,
- buflen);
- } else {
- t_info("bad format at line %d\n", line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile %s\n", testfile);
- t_result(result);
- }
-}
-
-static void
-t_dns_name_fromwire(void) {
- t_assert("dns_name_fromwire", 1, T_REQUIRED, "%s", a42);
- t_dns_name_fromwire_x("dns_name_fromwire_1_data", BUFLEN);
-
-#if 0
- /*
- * XXXRTH these tests appear to be broken, so I have
- * disabled them.
- */
- t_assert("dns_name_fromwire", 2, T_REQUIRED, "%s", a43);
- t_dns_name_fromwire_x("dns_name_fromwire_2_data", BUFLEN);
-
- t_assert("dns_name_fromwire", 3, T_REQUIRED, "%s", a44);
- t_dns_name_fromwire_x("dns_name_fromwire_3_data", BUFLEN);
-#endif
-
- t_assert("dns_name_fromwire", 4, T_REQUIRED, "%s", a45);
- t_dns_name_fromwire_x("dns_name_fromwire_4_data", BUFLEN);
-
- t_assert("dns_name_fromwire", 5, T_REQUIRED, "%s", a46);
- t_dns_name_fromwire_x("dns_name_fromwire_5_data", BUFLEN);
-
- t_assert("dns_name_fromwire", 6, T_REQUIRED, "%s", a47);
- t_dns_name_fromwire_x("dns_name_fromwire_6_data", BUFLEN);
-
- t_assert("dns_name_fromwire", 7, T_REQUIRED, "%s", a48);
- t_dns_name_fromwire_x("dns_name_fromwire_7_data", BUFLEN);
-
- t_assert("dns_name_fromwire", 9, T_REQUIRED, "%s", a49);
- t_dns_name_fromwire_x("dns_name_fromwire_8_data", 2);
-}
-
-
-static const char *a51 =
- "dns_name_towire(name, cctx, target) converts the DNS name "
- "'name' into wire format, compresses it as specified "
- "by the compression context cctx, stores the result in "
- "target and returns DNS_SUCCESS";
-
-static const char *a52 =
- "when not enough space exists in target, "
- "dns_name_towire(name, cctx, target) returns ISC_R_NOSPACE";
-
-static int
-test_dns_name_towire(char *testname, unsigned int dc_method, char *exp_data,
- size_t exp_data_len, isc_result_t exp_result,
- size_t buflen)
-{
- int result;
- int val;
- int len;
- unsigned char buf2[BUFLEN];
- unsigned char buf3[BUFLEN];
- isc_buffer_t iscbuf1;
- isc_buffer_t iscbuf2;
- isc_buffer_t iscbuf3;
- dns_name_t dns_name;
- isc_result_t dns_result;
- isc_result_t isc_result;
- dns_compress_t cctx;
- isc_mem_t *mctx;
-
- t_info("testing using %s\n", testname);
-
- result = T_UNRESOLVED;
- mctx = NULL;
-
- isc_result = isc_mem_create(0, 0, &mctx);
- if (isc_result != ISC_R_SUCCESS) {
- t_info("isc_mem_create failed\n");
- return (result);
- }
- dns_compress_init(&cctx, -1, mctx);
- dns_compress_setmethods(&cctx, dc_method);
- dns_name_init(&dns_name, NULL);
- len = strlen(testname);
- isc_buffer_init(&iscbuf1, testname, len);
- isc_buffer_add(&iscbuf1, len);
- isc_buffer_init(&iscbuf2, buf2, BUFLEN);
- dns_result = dns_name_fromtext(&dns_name, &iscbuf1, NULL, 0, &iscbuf2);
- if (dns_result == ISC_R_SUCCESS) {
- isc_buffer_init(&iscbuf3, buf3, (unsigned int)buflen);
- dns_result = dns_name_towire(&dns_name, &cctx, &iscbuf3);
- if (dns_result == exp_result) {
- if (exp_result == ISC_R_SUCCESS) {
- /*
- * Compare results with expected data.
- */
- val = chkdata(buf3, iscbuf3.used, exp_data,
- exp_data_len);
- if (val == 0)
- result = T_PASS;
- else
- result = T_FAIL;
- } else
- result = T_PASS;
- } else {
- t_info("dns_name_towire unexpectedly returned %s\n",
- dns_result_totext(dns_result));
- result = T_FAIL;
- }
- } else {
- t_info("dns_name_fromtext %s failed, result = %s\n",
- testname, dns_result_totext(dns_result));
- }
- return (result);
-}
-
-static void
-t_dns_name_towire_x(const char *testfile, size_t buflen) {
- int line;
- int cnt;
- int result;
- unsigned int dc_method;
- isc_result_t exp_result;
- size_t exp_data_len;
- char *p;
- FILE *fp;
-
- result = T_UNRESOLVED;
- fp = fopen(testfile, "r");
- if (fp != NULL) {
- line = 0;
- while ((p = t_fgetbs(fp)) != NULL) {
-
- ++line;
-
- /*
- * Skip comment lines.
- */
- if ((isspace((unsigned char)*p)) || (*p == '#')) {
- (void)free(p);
- continue;
- }
-
- cnt = bustline(p, Tokens);
- if (cnt == 5) {
- /*
- * testname, dc_method,
- * exp_data, exp_data_len,
- * exp_result.
- */
-
- dc_method = t_dc_method_fromtext(Tokens[3]);
- exp_result = t_dns_result_fromtext(Tokens[4]);
- exp_data_len = strtoul(Tokens[3], NULL, 10);
-
- result = test_dns_name_towire(Tokens[0],
- dc_method,
- Tokens[2],
- exp_data_len,
- exp_result,
- buflen);
- } else {
- t_info("bad format at line %d\n", line);
- }
-
- (void)free(p);
- t_result(result);
- }
- (void)fclose(fp);
- } else {
- t_info("Missing datafile %s\n", testfile);
- t_result(result);
- }
-}
-
-static void
-t_dns_name_towire_1(void) {
- t_assert("dns_name_towire", 1, T_REQUIRED, "%s", a51);
- t_dns_name_towire_x("dns_name_towire_1_data", BUFLEN);
-}
-
-static void
-t_dns_name_towire_2(void) {
- t_assert("dns_name_towire", 2, T_REQUIRED, "%s", a52);
- t_dns_name_towire_x("dns_name_towire_2_data", 2);
-}
-
-static void
-t_dns_name_towire(void) {
- t_dns_name_towire_1();
- t_dns_name_towire_2();
-}
-
-#if 0 /* This is silly. A test should either exist, or not, but not
- * one that just returns "UNTESTED."
- */
-static const char *a53 =
- "dns_name_concatenate(prefix, suffix, name, target) "
- "concatenates prefix and suffix, stores the result "
- "in target, canonicalizes any bitstring labels "
- "and returns ISC_R_SUCCESS";
-
-static void
-t_dns_name_concatenate(void) {
- t_assert("dns_name_concatenate", 1, T_REQUIRED, "%s", a53);
- t_result(T_UNTESTED);
-}
-#endif
-
-testspec_t T_testlist[] = {
- { (PFV) t_dns_name_init, "dns_name_init" },
- { (PFV) t_dns_name_invalidate, "dns_name_invalidate" },
- { (PFV) t_dns_name_setbuffer, "dns_name_setbuffer" },
- { (PFV) t_dns_name_hasbuffer, "dns_name_hasbuffer" },
- { (PFV) t_dns_name_isabsolute, "dns_name_isabsolute" },
- { (PFV) t_dns_name_hash, "dns_name_hash" },
- { (PFV) t_dns_name_fullcompare, "dns_name_fullcompare" },
- { (PFV) t_dns_name_compare, "dns_name_compare" },
- { (PFV) t_dns_name_rdatacompare, "dns_name_rdatacompare" },
- { (PFV) t_dns_name_issubdomain, "dns_name_issubdomain" },
- { (PFV) t_dns_name_countlabels, "dns_name_countlabels" },
- { (PFV) t_dns_name_getlabel, "dns_name_getlabel" },
- { (PFV) t_dns_name_getlabelsequence, "dns_name_getlabelsequence" },
- { (PFV) t_dns_name_fromregion, "dns_name_fromregion" },
- { (PFV) t_dns_name_toregion, "dns_name_toregion" },
- { (PFV) t_dns_name_fromwire, "dns_name_fromwire" },
- { (PFV) t_dns_name_towire, "dns_name_towire" },
- { (PFV) t_dns_name_fromtext, "dns_name_fromtext" },
- { (PFV) t_dns_name_totext, "dns_name_totext" },
-#if 0
- { (PFV) t_dns_name_concatenate, "dns_name_concatenate" },
-#endif
- { (PFV) 0, NULL }
-};
-
-#ifdef WIN32
-int
-main(int argc, char **argv) {
- t_settests(T_testlist);
- return (t_main(argc, argv));
-}
-#endif
diff --git a/bin/tests/names/win32/t_names.vcxproj.filters.in b/bin/tests/names/win32/t_names.vcxproj.filters.in
deleted file mode 100644
index 8520c64b10..0000000000
--- a/bin/tests/names/win32/t_names.vcxproj.filters.in
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/bin/tests/names/win32/t_names.vcxproj.in b/bin/tests/names/win32/t_names.vcxproj.in
deleted file mode 100644
index 5be43c2ffd..0000000000
--- a/bin/tests/names/win32/t_names.vcxproj.in
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
- Debug
- @PLATFORM@
-
-
- Release
- @PLATFORM@
-
-
-
- {124DC0D3-3096-41D2-B490-CE85E890FF33}
- Win32Proj
- t_names
-
-
-
- Application
- true
- MultiByte
-
-
- Application
- false
- true
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
- true
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
- false
- ..\..\..\..\Build\$(Configuration)\
- .\$(Configuration)\
-
-
-
-
-
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- true
- .\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
- Level3
-
-
- MaxSpeed
- true
- @INTRINSIC@
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- OnlyExplicitInline
- false
- true
- .\$(Configuration)\$(TargetName).pch
- .\$(Configuration)\
- .\$(Configuration)\
- $(OutDir)$(TargetName).pdb
- .\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)
- CompileAsC
-
-
- Console
- false
- true
- true
- ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)
- Default
- ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)
- @LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)
-
-
-
-
-
-
-
-
-
diff --git a/bin/tests/names/win32/t_names.vcxproj.user b/bin/tests/names/win32/t_names.vcxproj.user
deleted file mode 100644
index 695b5c78b9..0000000000
--- a/bin/tests/names/win32/t_names.vcxproj.user
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/bin/tests/names/wire_test1.data b/bin/tests/names/wire_test1.data
deleted file mode 100644
index 505134acfa..0000000000
--- a/bin/tests/names/wire_test1.data
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# a global14 compression pointer
-#
-000a85800001000300000003
-0376697803636f6d0000020001c00c00
-02000100000e10000b05697372763102
-7061c00cc00c0002000100000e100009
-066e732d657874c00cc00c0002000100
-000e10000e036e733104676e61630363
-6f6d00c0250001000100000e100004cc
-98b886c03c0001000100000e100004cc
-98b840c051000100010002a14a0004c6
-97f8f6
diff --git a/bin/tests/names/wire_test2.data b/bin/tests/names/wire_test2.data
deleted file mode 100644
index ea03557da7..0000000000
--- a/bin/tests/names/wire_test2.data
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# a global14 compression pointer
-#
-000a85800001000300000003
-8376697803636f6d0000020001c00c00
-02000100000e10000b05697372763102
-7061c00cc00c0002000100000e100009
-066e732d657874c00cc00c0002000100
-000e10000e036e733104676e61630363
-6f6d00c0250001000100000e100004cc
-98b886c03c0001000100000e100004cc
-98b840c051000100010002a14a0004c6
-97f8f6
diff --git a/bin/tests/names/wire_test3_1.data b/bin/tests/names/wire_test3_1.data
deleted file mode 100644
index 5f5ec59061..0000000000
--- a/bin/tests/names/wire_test3_1.data
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# a bad compression pointer starting with the bits 1111
-#
-000a85800001000300000003
-03766978 03636f6d 00 0002 0001
-f00c 0002 0001 0000 0e10 000b 056973727631 027061 c00c
-c00c 0002 0001 0000 0e10 0009 066e732d657874 c00c
-c00c 0002 0001 0000 0e10 000e 036e7331 04676e6163 03636f6d 00
-c025 0001 0001 0000 0e10 0004 cc98b886
-c03c 0001 0001 0000 0e10 0004 cc98b840
-c051 0001 0001 0002 a14a 0004 c697f8f6
diff --git a/bin/tests/names/wire_test3_2.data b/bin/tests/names/wire_test3_2.data
deleted file mode 100644
index fae2fe25ec..0000000000
--- a/bin/tests/names/wire_test3_2.data
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# a bad compression pointer due to forward reference of 0x30 to
-# another compression pointer with a valid backreference
-#
-000a85800001000300000003
-03766978 03636f6d 00 0002 0001
-c030 0002 0001 0000 0e10 000b 056973727631 027061 c00c
-c00c 0002 0001 0000 0e10 0009 066e732d657874 c00c
-c00c 0002 0001 0000 0e10 000e 036e7331 04676e6163 03636f6d 00
-c025 0001 0001 0000 0e10 0004 cc98b886
-c03c 0001 0001 0000 0e10 0004 cc98b840
-c051 0001 0001 0002 a14a 0004 c697f8f6
diff --git a/bin/tests/names/wire_test4.data b/bin/tests/names/wire_test4.data
deleted file mode 100644
index dba6035ab5..0000000000
--- a/bin/tests/names/wire_test4.data
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# invalid name length, pointer at offset 0x0226 points to
-# long name at offset 0x25
-#
-000a 8580 0001 0003 0000 0001
-03 766978 03 636f6d 00 0002 0001
-c00c 0002 0001 00000e10
-0101
-# long name starts here
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a
-03616263 0358595a 03616263 0358595a
-03414243 0378797a 03414243 0378797a 00
-# compression pointer start here and refers back to long name
-c023 0002 0001 00000e10 0009 066e732d657874 c00c
-c00c 0002 0001 00000e10 000e 036e733104676e616303636f6d00
-c025 0001 0001 00000e10 0004 cc98b886
diff --git a/bin/tests/names/wire_test5.data b/bin/tests/names/wire_test5.data
deleted file mode 100644
index 505134acfa..0000000000
--- a/bin/tests/names/wire_test5.data
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# a global14 compression pointer
-#
-000a85800001000300000003
-0376697803636f6d0000020001c00c00
-02000100000e10000b05697372763102
-7061c00cc00c0002000100000e100009
-066e732d657874c00cc00c0002000100
-000e10000e036e733104676e61630363
-6f6d00c0250001000100000e100004cc
-98b886c03c0001000100000e100004cc
-98b840c051000100010002a14a0004c6
-97f8f6
diff --git a/bin/tests/names/wire_test6.data b/bin/tests/names/wire_test6.data
deleted file mode 100644
index 1a05d264e8..0000000000
--- a/bin/tests/names/wire_test6.data
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# a bad pointer
-#
-000a85800001000300000003
-0376697803636f6d0000020001f00c00
-02000100000e10000b05697372763102
-7061c00cc00c0002000100000e100009
-066e732d657874c00cc00c0002000100
-000e10000e036e733104676e61630363
-6f6d00c0250001000100000e100004cc
-98b886c03c0001000100000e100004cc
-98b840c051000100010002a14a0004c6
-97f8f6
diff --git a/bin/tests/names/wire_test7.data b/bin/tests/names/wire_test7.data
deleted file mode 100644
index 40fbbed615..0000000000
--- a/bin/tests/names/wire_test7.data
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# input ends unexpectedly
-#
-000a85800001000300000003
-0376697803636f6d0000020001c0
diff --git a/bin/tests/names/wire_test8.data b/bin/tests/names/wire_test8.data
deleted file mode 100644
index beabbf7b28..0000000000
--- a/bin/tests/names/wire_test8.data
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# too many hops DNS_POINTER_MAXHOPS is defined as 16
-# in lib/dns/include/dns/name.h
-#
-000a85800001000300000013
-03 766978 03 636f6d 00 0002 0001
-c00c 0002 0001 00000e10 000b 056973727631027061 c00c
-c019 0002 0001 00000e10 0009 066e732d657874 c00c
-c030 0002 0001 00000e10 000e 036e7331 04676e6163 03636f6d 00
-c045 0001 0001 00000e10 0004 cc98b886
-c05f 0001 0001 00000e10 0004 cc98b840
-c06f 0001 0001 0002a14a 0004 c697f8f6
-c07f 0001 0001 0002a14a 0004 c697f8f6
-c08f 0001 0001 0002a14a 0004 c697f8f6
-c09f 0001 0001 0002a14a 0004 c697f8f6
-c0af 0001 0001 0002a14a 0004 c697f8f6
-c0bf 0001 0001 0002a14a 0004 c697f8f6
-c0cf 0001 0001 0002a14a 0004 c697f8f6
-c0df 0001 0001 0002a14a 0004 c697f8f6
-c0ef 0001 0001 0002a14a 0004 c697f8f6
-c0ff 0001 0001 0002a14a 0004 c697f8f6
-c10f 0001 0001 0002a14a 0004 c697f8f6
-c11f 0001 0001 0002a14a 0004 c697f8f6
-c12f 0001 0001 0002a14a 0004 c697f8f6
-c13f 0001 0001 0002a14a 0004 c697f8f6
-c14f 0001 0001 0002a14a 0004 c697f8f6
-c15f 0001 0001 0002a14a 0004 c697f8f6
-c16f 0001 0001 0002a14a 0004 c697f8f6
diff --git a/bin/tests/ndc.conf b/bin/tests/ndc.conf
deleted file mode 100644
index aa06c3eda3..0000000000
--- a/bin/tests/ndc.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: ndc.conf,v 1.11 2007/06/19 23:46:59 tbox Exp $ */
-
-options {
- default-server "velo.jab.fr" ;
-# [ default-key key_name; ]
-};
-
-server "velo.jab.fr" {
- key "akey";
- host "1.2.3.4";
-};
-
-include "ndc.conf-include";
-
-key "akey" {
- algorithm "algo";
- secret "c2Vj";
-};
-
diff --git a/bin/tests/ndc.conf-include b/bin/tests/ndc.conf-include
deleted file mode 100644
index 8884d75ffa..0000000000
--- a/bin/tests/ndc.conf-include
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: ndc.conf-include,v 1.6 2007/06/19 23:46:59 tbox Exp $ */
-
-key "another-key" {
- algorithm "al-gore-rhythm";
- secret "R29yZSBpbiAyMDA0IQo"; # "Gore in 2004!"
-};
-
-
diff --git a/bin/tests/net/Makefile.in b/bin/tests/net/Makefile.in
deleted file mode 100644
index d34e1e6254..0000000000
--- a/bin/tests/net/Makefile.in
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = ${TEST_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES}
-
-CDEFINES =
-CWARNINGS =
-
-ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
-
-ISCDEPLIBS = ../../../lib/isc/libisc.@A@
-
-DEPLIBS = ${ISCDEPLIBS}
-
-LIBS = ${ISCLIBS} @LIBS@
-
-TARGETS = t_net@EXEEXT@
-
-SRCS = driver.c netaddr_multicast.c sockaddr_multicast.c
-
-OBJS = driver.@O@ netaddr_multicast.@O@ sockaddr_multicast.@O@
-
-@BIND9_MAKE_RULES@
-
-t_net@EXEEXT@: ${OBJS} ${DEPLIBS} ${TLIB}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJS} ${TLIB} ${LIBS}
-
-test: t_net@EXEEXT@
- -@./t_net@EXEEXT@
-
-clean distclean::
- rm -f ${TARGETS}
- rm -f ${OBJS}
diff --git a/bin/tests/net/driver.c b/bin/tests/net/driver.c
deleted file mode 100644
index 69ad6dd9a2..0000000000
--- a/bin/tests/net/driver.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: driver.c,v 1.11 2007/06/19 23:47:00 tbox Exp $ */
-
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include "driver.h"
-
-#include "testsuite.h"
-
-#define NTESTS (sizeof(tests) / sizeof(test_t))
-
-const char *gettime(void);
-const char *test_result_totext(test_result_t);
-
-const char *
-gettime(void) {
- static char now[512];
- time_t t;
-#if defined(ISC_PLATFORM_USETHREADS) && !defined(WIN32)
- struct tm tm;
-#endif
-
- (void)time(&t);
-
-#if defined(ISC_PLATFORM_USETHREADS) && !defined(WIN32)
- strftime(now, sizeof(now) - 1, "%A %d %B %H:%M:%S %Y",
- localtime_r(&t, &tm));
-#else
- strftime(now, sizeof(now) - 1, "%A %d %B %H:%M:%S %Y", localtime(&t));
-#endif
-
- return (now);
-}
-
-const char *
-test_result_totext(test_result_t result) {
- const char *s;
- switch (result) {
- case PASSED:
- s = "PASS";
- break;
- case FAILED:
- s = "FAIL";
- break;
- case UNTESTED:
- s = "UNTESTED";
- break;
- case UNKNOWN:
- default:
- s = "UNKNOWN";
- break;
- }
-
- return (s);
-}
-
-int
-main(int argc, char **argv) {
- test_t *test;
- test_result_t result;
- unsigned int n_failed;
- unsigned int testno;
-
- UNUSED(argc);
- UNUSED(argv);
-
- printf("S:%s:%s\n", SUITENAME, gettime());
-
- n_failed = 0;
- for (testno = 0; testno < NTESTS; testno++) {
- test = &tests[testno];
- printf("T:%s:%u:A\n", test->tag, testno + 1);
- printf("A:%s\n", test->description);
- result = test->func();
- printf("R:%s\n", test_result_totext(result));
- if (result != PASSED)
- n_failed++;
- }
-
- printf("E:%s:%s\n", SUITENAME, gettime());
-
- if (n_failed > 0)
- exit(1);
-
- return (0);
-}
-
diff --git a/bin/tests/net/driver.h b/bin/tests/net/driver.h
deleted file mode 100644
index 23c256b748..0000000000
--- a/bin/tests/net/driver.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: driver.h,v 1.8 2007/06/19 23:47:00 tbox Exp $ */
-
-/*
- * PASSED and FAILED mean the particular test passed or failed.
- *
- * UNKNOWN means that for one reason or another, the test process itself
- * failed. For instance, missing files, error when parsing files or
- * IP addresses, etc. That is, the test itself is broken, not what is
- * being tested.
- *
- * UNTESTED means the test was unable to be run because a prerequisite test
- * failed, the test is disabled, or the test needs a system component
- * (for instance, Perl) and cannot run.
- */
-typedef enum {
- PASSED = 0,
- FAILED = 1,
- UNKNOWN = 2,
- UNTESTED = 3
-} test_result_t;
-
-typedef test_result_t (*test_func_t)(void);
-
-typedef struct {
- const char *tag;
- const char *description;
- test_func_t func;
-} test_t;
-
-#define TESTDECL(name) test_result_t name(void)
-
diff --git a/bin/tests/net/netaddr_multicast.c b/bin/tests/net/netaddr_multicast.c
deleted file mode 100644
index 9fb21ec5fc..0000000000
--- a/bin/tests/net/netaddr_multicast.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: netaddr_multicast.c,v 1.12 2007/06/19 23:47:00 tbox Exp $ */
-
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "driver.h"
-
-TESTDECL(netaddr_multicast);
-
-typedef struct {
- int family;
- const char *addr;
- isc_boolean_t is_multicast;
-} t_addr_t;
-
-static t_addr_t addrs[] = {
- { AF_INET, "1.2.3.4", ISC_FALSE },
- { AF_INET, "4.3.2.1", ISC_FALSE },
- { AF_INET, "224.1.1.1", ISC_TRUE },
- { AF_INET, "1.1.1.244", ISC_FALSE },
- { AF_INET6, "::1", ISC_FALSE },
- { AF_INET6, "ff02::1", ISC_TRUE }
-};
-#define NADDRS (sizeof(addrs) / sizeof(t_addr_t))
-
-static isc_result_t to_netaddr(t_addr_t *, isc_netaddr_t *);
-
-static isc_result_t
-to_netaddr(t_addr_t *addr, isc_netaddr_t *na) {
- int r;
- struct in_addr in;
- struct in6_addr in6;
-
- switch (addr->family) {
- case AF_INET:
- r = inet_pton(AF_INET, addr->addr, (unsigned char *)&in);
- if (r != 1)
- return (ISC_R_FAILURE);
- isc_netaddr_fromin(na, &in);
- break;
- case AF_INET6:
- r = inet_pton(AF_INET6, addr->addr, (unsigned char *)&in6);
- if (r != 1)
- return (ISC_R_FAILURE);
- isc_netaddr_fromin6(na, &in6);
- break;
- default:
- return (ISC_R_UNEXPECTED);
- }
-
- return (ISC_R_SUCCESS);
-}
-
-test_result_t
-netaddr_multicast(void) {
- isc_netaddr_t na;
- unsigned int n_fail;
- t_addr_t *addr;
- unsigned int i;
- isc_result_t result;
- isc_boolean_t tf;
-
- n_fail = 0;
- for (i = 0; i < NADDRS; i++) {
- addr = &addrs[i];
- result = to_netaddr(addr, &na);
- if (result != ISC_R_SUCCESS) {
- printf("I:to_netaddr() returned %s on item %u\n",
- isc_result_totext(result), i);
- return (UNKNOWN);
- }
- tf = isc_netaddr_ismulticast(&na);
- if (tf == addr->is_multicast) {
- printf("I:%s is%s multicast (PASSED)\n",
- (addr->addr), (tf ? "" : " not"));
- } else {
- printf("I:%s is%s multicast (FAILED)\n",
- (addr->addr), (tf ? "" : " not"));
- n_fail++;
- }
- }
-
- if (n_fail > 0)
- return (FAILED);
-
- return (PASSED);
-}
diff --git a/bin/tests/net/sockaddr_multicast.c b/bin/tests/net/sockaddr_multicast.c
deleted file mode 100644
index de216e390a..0000000000
--- a/bin/tests/net/sockaddr_multicast.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: sockaddr_multicast.c,v 1.8 2007/06/19 23:47:00 tbox Exp $ */
-
-#include
-
-#include
-#include
-
-#include
-#include
-
-#include "driver.h"
-
-TESTDECL(sockaddr_multicast);
-
-test_result_t
-sockaddr_multicast(void) {
-
- return (PASSED);
-}
diff --git a/bin/tests/net/testsuite.h b/bin/tests/net/testsuite.h
deleted file mode 100644
index cb06b19e4f..0000000000
--- a/bin/tests/net/testsuite.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/* $Id: testsuite.h,v 1.7 2007/06/19 23:47:00 tbox Exp $ */
-
-#define SUITENAME "net"
-
-TESTDECL(netaddr_multicast);
-TESTDECL(sockaddr_multicast);
-
-static test_t tests[] = {
- { "isc_netaddr_ismulticast",
- "Checking to see if multicast addresses are detected properly",
- netaddr_multicast },
- { "isc_sockaddr_ismulticast",
- "Checking to see if multicast addresses are detected properly",
- sockaddr_multicast },
-
-};
diff --git a/bin/tests/Kchild.example.+003+04017.key b/bin/tests/optional/Kchild.example.+003+04017.key
similarity index 100%
rename from bin/tests/Kchild.example.+003+04017.key
rename to bin/tests/optional/Kchild.example.+003+04017.key
diff --git a/bin/tests/Kchild.example.+003+04017.private b/bin/tests/optional/Kchild.example.+003+04017.private
similarity index 100%
rename from bin/tests/Kchild.example.+003+04017.private
rename to bin/tests/optional/Kchild.example.+003+04017.private
diff --git a/bin/tests/optional/Makefile.in b/bin/tests/optional/Makefile.in
new file mode 100644
index 0000000000..8cefb5a916
--- /dev/null
+++ b/bin/tests/optional/Makefile.in
@@ -0,0 +1,273 @@
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+top_srcdir = @top_srcdir@
+
+@BIND9_MAKE_INCLUDES@
+
+CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} ${ISCCFG_INCLUDES} \
+ @DST_OPENSSL_INC@ @DST_GSSAPI_INC@
+
+CDEFINES = @CRYPTO@ @USE_GSSAPI@
+
+CWARNINGS =
+BACKTRACECFLAGS = @BACKTRACECFLAGS@
+
+DNSLIBS = ../../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
+ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
+ISCNOSYMLIBS = ../../../lib/isc/libisc-nosymtbl.@A@ @ISC_OPENSSL_LIBS@
+ISCCFGLIBS = ../../../lib/isccfg/libisccfg.@A@
+
+DNSDEPLIBS = ../../../lib/dns/libdns.@A@
+ISCDEPLIBS = ../../../lib/isc/libisc.@A@
+ISCDEPNOSYMLIBS = ../../../lib/isc/libisc-nosymtbl.@A@
+ISCCFGDEPLIBS = ../../../lib/isccfg/libisccfg.@A@
+
+LIBS = @LIBS@
+
+SUBDIRS =
+
+# These programs are not built by default, but only when
+# configured with --enable-developer or built explicitly with
+# "make all_tests"
+
+TARGETS = @XTARGETS@
+XTARGETS = adb_test@EXEEXT@ \
+ byaddr_test@EXEEXT@ \
+ backtrace_test@EXEEXT@ \
+ backtrace_test_nosymtbl@EXEEXT@ \
+ byname_test@EXEEXT@ \
+ db_test@EXEEXT@ \
+ dst_test@EXEEXT@ \
+ entropy_test@EXEEXT@ \
+ entropy2_test@EXEEXT@ \
+ gsstest@EXEEXT@ \
+ hash_test@EXEEXT@ \
+ fsaccess_test@EXEEXT@ \
+ inter_test@EXEEXT@ \
+ keyboard_test@EXEEXT@ \
+ lex_test@EXEEXT@ \
+ lfsr_test@EXEEXT@ \
+ log_test@EXEEXT@ \
+ master_test@EXEEXT@ \
+ mempool_test@EXEEXT@ \
+ name_test@EXEEXT@ \
+ nsecify@EXEEXT@ \
+ ratelimiter_test@EXEEXT@ \
+ rbt_test@EXEEXT@ \
+ rwlock_test@EXEEXT@ \
+ serial_test@EXEEXT@ \
+ shutdown_test@EXEEXT@ \
+ sig0_test@EXEEXT@ \
+ sock_test@EXEEXT@ \
+ sym_test@EXEEXT@ \
+ task_test@EXEEXT@ \
+ timer_test@EXEEXT@ \
+ zone_test@EXEEXT@
+
+SRCS = ${XSRCS}
+XSRCS = adb_test.c \
+ byaddr_test.c \
+ backtrace_test.c \
+ byname_test.c \
+ db_test.c \
+ dst_test.c \
+ entropy_test.c \
+ entropy2_test.c \
+ hash_test.c \
+ fsaccess_test.c \
+ gsstest.c \
+ inter_test.c \
+ keyboard_test.c \
+ lex_test.c \
+ lfsr_test.c \
+ log_test.c \
+ master_test.c \
+ mempool_test.c \
+ name_test.c \
+ nsecify.c \
+ ratelimiter_test.c \
+ rbt_test.c \
+ rwlock_test.c \
+ serial_test.c \
+ shutdown_test.c \
+ sig0_test.c \
+ sock_test.c \
+ sym_test.c \
+ task_test.c \
+ timer_test.c \
+ zone_test.c
+
+@BIND9_MAKE_RULES@
+
+# disable optimization for backtrace test to get the expected result
+BTTEST_CFLAGS = ${BACKTRACECFLAGS} ${EXT_CFLAGS} ${ALL_CPPFLAGS} -g \
+ ${ALWAYS_WARNINGS} ${STD_CWARNINGS} ${CWARNINGS}
+
+all_tests: ${XTARGETS}
+
+adb_test@EXEEXT@: adb_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ adb_test.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+backtrace_test_nosymtbl@EXEEXT@: ${srcdir}/backtrace_test.c ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${BTTEST_CFLAGS} ${LDFLAGS} -o $@ \
+ ${srcdir}/backtrace_test.c ${ISCLIBS} ${LIBS}
+
+backtrace_test@EXEEXT@: ${srcdir}/backtrace_test.c backtrace_test_nosymtbl@EXEEXT@
+ #first step: create a first symbol table
+ rm -f symtbl.c
+ if test X${MKSYMTBL_PROGRAM} != X; then \
+ ${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
+ backtrace_test_nosymtbl@EXEEXT@; else \
+ cp ${top_srcdir}/lib/isc/backtrace-emptytbl.c symtbl.c; fi
+ #second step: build a binary with the first symbol table
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${BTTEST_CFLAGS} ${LDFLAGS} \
+ -o $@0 ${srcdir}/backtrace_test.c symtbl.c \
+ ${ISCNOSYMLIBS} ${LIBS}
+ rm -f symtbl.c
+ #third step: create a second symbol table
+ if test X${MKSYMTBL_PROGRAM} != X; then \
+ ${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl $@0; else \
+ cp ${top_srcdir}/lib/isc/backtrace-emptytbl.c symtbl.c; fi
+ #fourth step: build the final binary
+ rm -f $@0
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${BTTEST_CFLAGS} ${LDFLAGS} \
+ -o $@ ${srcdir}/backtrace_test.c symtbl.c ${ISCNOSYMLIBS} ${LIBS}
+ rm -f symtbl.c
+
+nsecify@EXEEXT@: nsecify.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ nsecify.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+byaddr_test@EXEEXT@: byaddr_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ byaddr_test.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+byname_test@EXEEXT@: byname_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ byname_test.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+lex_test@EXEEXT@: lex_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ lex_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+lfsr_test@EXEEXT@: lfsr_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ lfsr_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+log_test@EXEEXT@: log_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ log_test.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+name_test@EXEEXT@: name_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ name_test.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+hash_test@EXEEXT@: hash_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ hash_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+entropy_test@EXEEXT@: entropy_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ entropy_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+entropy2_test@EXEEXT@: entropy2_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ entropy2_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+sock_test@EXEEXT@: sock_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ sock_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+sym_test@EXEEXT@: sym_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ sym_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+task_test@EXEEXT@: task_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ task_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+shutdown_test@EXEEXT@: shutdown_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ shutdown_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+timer_test@EXEEXT@: timer_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ timer_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+ratelimiter_test@EXEEXT@: ratelimiter_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ratelimiter_test.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+rbt_test@EXEEXT@: rbt_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ rbt_test.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+rwlock_test@EXEEXT@: rwlock_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ rwlock_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+master_test@EXEEXT@: master_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ master_test.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+db_test@EXEEXT@: db_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ db_test.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+mempool_test@EXEEXT@: mempool_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ mempool_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+serial_test@EXEEXT@: serial_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ serial_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+zone_test@EXEEXT@: zone_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zone_test.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+fsaccess_test@EXEEXT@: fsaccess_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ fsaccess_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+inter_test@EXEEXT@: inter_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ inter_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+keyboard_test@EXEEXT@: keyboard_test.@O@ ${ISCDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ keyboard_test.@O@ \
+ ${ISCLIBS} ${LIBS}
+
+sig0_test@EXEEXT@: sig0_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ sig0_test.@O@ \
+ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+dst_test@EXEEXT@: dst_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \
+ -o $@ dst_test.@O@ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+gsstest@EXEEXT@: gsstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \
+ -o $@ gsstest.@O@ ${DNSLIBS} ${ISCLIBS} ${LIBS}
+
+clean distclean::
+ rm -f ${TARGETS} ${XTARGETS}
+ rm -f backtrace_test_symtbl.c
+
+check: test
+
+test:
+ @for dir in $(TESTDIRS) ;\
+ do \
+ ( cd $$dir; $(MAKE) test ) ;\
+ done
diff --git a/bin/tests/adb_test.c b/bin/tests/optional/adb_test.c
similarity index 99%
rename from bin/tests/adb_test.c
rename to bin/tests/optional/adb_test.c
index 4f0b3b34ed..9cd96a4a7a 100644
--- a/bin/tests/adb_test.c
+++ b/bin/tests/optional/adb_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: adb_test.c,v 1.73 2011/08/30 23:46:51 tbox Exp $ */
-
/*! \file */
#include
diff --git a/bin/tests/backtrace_test.c b/bin/tests/optional/backtrace_test.c
similarity index 96%
rename from bin/tests/backtrace_test.c
rename to bin/tests/optional/backtrace_test.c
index f18d9ed1a6..cd89a68b5f 100644
--- a/bin/tests/backtrace_test.c
+++ b/bin/tests/optional/backtrace_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: backtrace_test.c,v 1.4 2009/09/02 23:48:01 tbox Exp $ */
-
#include
#include
diff --git a/bin/tests/byaddr_test.c b/bin/tests/optional/byaddr_test.c
similarity index 98%
rename from bin/tests/byaddr_test.c
rename to bin/tests/optional/byaddr_test.c
index ba3ab02a7c..39b8b253e9 100644
--- a/bin/tests/byaddr_test.c
+++ b/bin/tests/optional/byaddr_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: byaddr_test.c,v 1.28 2007/06/19 23:46:59 tbox Exp $ */
-
/*! \file
* \author
* Principal Author: Bob Halley
diff --git a/bin/tests/byname_test.c b/bin/tests/optional/byname_test.c
similarity index 99%
rename from bin/tests/byname_test.c
rename to bin/tests/optional/byname_test.c
index c5458a77ab..d4853c4760 100644
--- a/bin/tests/byname_test.c
+++ b/bin/tests/optional/byname_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: byname_test.c,v 1.33 2009/09/02 23:48:01 tbox Exp $ */
-
/*! \file
* \author
* Principal Author: Bob Halley
diff --git a/bin/tests/db_test.c b/bin/tests/optional/db_test.c
similarity index 99%
rename from bin/tests/db_test.c
rename to bin/tests/optional/db_test.c
index f22cde5d64..bc5d08f9e1 100644
--- a/bin/tests/db_test.c
+++ b/bin/tests/optional/db_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: db_test.c,v 1.70 2011/08/29 23:46:44 tbox Exp $ */
-
/*! \file
* \author
* Principal Author: Bob Halley
diff --git a/bin/tests/dst/dst_test.c b/bin/tests/optional/dst_test.c
similarity index 99%
rename from bin/tests/dst/dst_test.c
rename to bin/tests/optional/dst_test.c
index 867668b791..f2b1bc15bf 100644
--- a/bin/tests/dst/dst_test.c
+++ b/bin/tests/optional/dst_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: dst_test.c,v 1.46 2009/09/01 00:22:25 jinmei Exp $ */
-
#include
#include
diff --git a/bin/tests/entropy2_test.c b/bin/tests/optional/entropy2_test.c
similarity index 98%
rename from bin/tests/entropy2_test.c
rename to bin/tests/optional/entropy2_test.c
index b1208e3e0d..d7ae39e4bd 100644
--- a/bin/tests/entropy2_test.c
+++ b/bin/tests/optional/entropy2_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: entropy2_test.c,v 1.16 2007/06/19 23:46:59 tbox Exp $ */
-
/*! \file */
#include
@@ -167,4 +165,3 @@ main(int argc, char **argv) {
return (0);
}
-
diff --git a/bin/tests/entropy_test.c b/bin/tests/optional/entropy_test.c
similarity index 97%
rename from bin/tests/entropy_test.c
rename to bin/tests/optional/entropy_test.c
index e2656403df..ffe2a47b18 100644
--- a/bin/tests/entropy_test.c
+++ b/bin/tests/optional/entropy_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: entropy_test.c,v 1.23 2007/06/19 23:46:59 tbox Exp $ */
-
/*! \file */
#include
@@ -132,4 +130,3 @@ main(int argc, char **argv) {
return (0);
}
-
diff --git a/bin/tests/fsaccess_test.c b/bin/tests/optional/fsaccess_test.c
similarity index 95%
rename from bin/tests/fsaccess_test.c
rename to bin/tests/optional/fsaccess_test.c
index d2bd440453..f2e4c24f64 100644
--- a/bin/tests/fsaccess_test.c
+++ b/bin/tests/optional/fsaccess_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: fsaccess_test.c,v 1.13 2007/06/19 23:46:59 tbox Exp $ */
-
/*! \file */
#include
diff --git a/bin/tests/dst/gsstest.c b/bin/tests/optional/gsstest.c
similarity index 100%
rename from bin/tests/dst/gsstest.c
rename to bin/tests/optional/gsstest.c
diff --git a/bin/tests/hash_test.c b/bin/tests/optional/hash_test.c
similarity index 99%
rename from bin/tests/hash_test.c
rename to bin/tests/optional/hash_test.c
index 20d2dd3922..bf2891ad4c 100644
--- a/bin/tests/hash_test.c
+++ b/bin/tests/optional/hash_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: hash_test.c,v 1.19 2007/06/19 23:46:59 tbox Exp $ */
-
/*! \file */
#include
diff --git a/bin/tests/inter_test.c b/bin/tests/optional/inter_test.c
similarity index 100%
rename from bin/tests/inter_test.c
rename to bin/tests/optional/inter_test.c
diff --git a/bin/tests/keyboard_test.c b/bin/tests/optional/keyboard_test.c
similarity index 95%
rename from bin/tests/keyboard_test.c
rename to bin/tests/optional/keyboard_test.c
index ab4be5ffac..085b314e02 100644
--- a/bin/tests/keyboard_test.c
+++ b/bin/tests/optional/keyboard_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: keyboard_test.c,v 1.13 2007/06/19 23:46:59 tbox Exp $ */
-
/*! \file */
#include
@@ -67,4 +65,3 @@ main(int argc, char **argv) {
return (0);
}
-
diff --git a/bin/tests/lex_test.c b/bin/tests/optional/lex_test.c
similarity index 98%
rename from bin/tests/lex_test.c
rename to bin/tests/optional/lex_test.c
index 4c9221b0a2..4631242602 100644
--- a/bin/tests/lex_test.c
+++ b/bin/tests/optional/lex_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: lex_test.c,v 1.23 2007/06/19 23:46:59 tbox Exp $ */
-
/*! \file */
#include
diff --git a/bin/tests/lfsr_test.c b/bin/tests/optional/lfsr_test.c
similarity index 97%
rename from bin/tests/lfsr_test.c
rename to bin/tests/optional/lfsr_test.c
index adf2858265..af55a31abe 100644
--- a/bin/tests/lfsr_test.c
+++ b/bin/tests/optional/lfsr_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: lfsr_test.c,v 1.16 2007/06/19 23:46:59 tbox Exp $ */
-
/*! \file */
#include
diff --git a/bin/tests/log_test.c b/bin/tests/optional/log_test.c
similarity index 99%
rename from bin/tests/log_test.c
rename to bin/tests/optional/log_test.c
index 93fb6b78e4..50807e8c02 100644
--- a/bin/tests/log_test.c
+++ b/bin/tests/optional/log_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: log_test.c,v 1.29 2011/08/28 23:46:51 marka Exp $ */
-
/* Principal Authors: DCL */
#include
diff --git a/bin/tests/master_test.c b/bin/tests/optional/master_test.c
similarity index 97%
rename from bin/tests/master_test.c
rename to bin/tests/optional/master_test.c
index ae7c0a6518..8d021842ae 100644
--- a/bin/tests/master_test.c
+++ b/bin/tests/optional/master_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: master_test.c,v 1.32 2009/09/02 23:48:01 tbox Exp $ */
-
#include
#include
diff --git a/bin/tests/mempool_test.c b/bin/tests/optional/mempool_test.c
similarity index 97%
rename from bin/tests/mempool_test.c
rename to bin/tests/optional/mempool_test.c
index 7074450f95..6a878f449c 100644
--- a/bin/tests/mempool_test.c
+++ b/bin/tests/optional/mempool_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: mempool_test.c,v 1.17 2007/06/19 23:46:59 tbox Exp $ */
-
#include
#include
diff --git a/bin/tests/name_test.c b/bin/tests/optional/name_test.c
similarity index 100%
rename from bin/tests/name_test.c
rename to bin/tests/optional/name_test.c
diff --git a/bin/tests/nsecify.c b/bin/tests/optional/nsecify.c
similarity index 98%
rename from bin/tests/nsecify.c
rename to bin/tests/optional/nsecify.c
index 4b06d1e085..5371bc4d44 100644
--- a/bin/tests/nsecify.c
+++ b/bin/tests/optional/nsecify.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: nsecify.c,v 1.12 2011/08/29 23:46:44 tbox Exp $ */
-
#include
#include
diff --git a/bin/tests/ratelimiter_test.c b/bin/tests/optional/ratelimiter_test.c
similarity index 98%
rename from bin/tests/ratelimiter_test.c
rename to bin/tests/optional/ratelimiter_test.c
index 5fa5ed55dc..02eadace52 100644
--- a/bin/tests/ratelimiter_test.c
+++ b/bin/tests/optional/ratelimiter_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: ratelimiter_test.c,v 1.18 2007/06/19 23:46:59 tbox Exp $ */
-
#include
#include
diff --git a/bin/tests/rbt_test.c b/bin/tests/optional/rbt_test.c
similarity index 99%
rename from bin/tests/rbt_test.c
rename to bin/tests/optional/rbt_test.c
index 4bec961b18..055586d747 100644
--- a/bin/tests/rbt_test.c
+++ b/bin/tests/optional/rbt_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: rbt_test.c,v 1.52 2011/08/28 23:46:41 tbox Exp $ */
-
#include
#include
diff --git a/bin/tests/rbt_test.out b/bin/tests/optional/rbt_test.out
similarity index 100%
rename from bin/tests/rbt_test.out
rename to bin/tests/optional/rbt_test.out
diff --git a/bin/tests/rbt_test.txt b/bin/tests/optional/rbt_test.txt
similarity index 94%
rename from bin/tests/rbt_test.txt
rename to bin/tests/optional/rbt_test.txt
index 2acee1ee6c..4821c34c0f 100644
--- a/bin/tests/rbt_test.txt
+++ b/bin/tests/optional/rbt_test.txt
@@ -7,81 +7,79 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
-# $Id: rbt_test.txt,v 1.17 2007/06/19 23:46:59 tbox Exp $
-
-add a.vix.com
-add b.vix.com
-add c.vix.com
-print
-add a.b.c.d.e.f.vix.com
-add b.b.c.d.e.f.vix.com
-add c.b.c.d.e.f.vix.com
-print
-add a.d.e.f.vix.com
-add q.d.e.f.vix.com
-add d.e.f.vix.com
-print
-add g.h.vix.com
-print
-search q.d.e.f.vix.com
-search just-parent.a.vix.com
-search no-real-parent.vix.com
-search does.not.exist.at.all
-forward
-backward
-# existing name
-check vix.com.
-# greater than stop node, which has down pointer
-check zzz.com.
-# less than lowest in level (would be left link from stop node)
-check 0.vix.com
-# greater than stop node, no down pointer
-check d.vix.com
-# superdomain stored in existing node
-check f.vix.com
-# common ancestor stored in existing node; existing is successor
-check a.e.f.vix.com
-# common ancestor stored in existing node; existing is less but not predecessor
-check z.e.f.vix.com
-#
-check g.vix.com
-#
-check i.vix.com
-#
-check b.c.vix.com
-nuke d.e.f.vix.com
-print
-add x.a.vix.com
-add y.x.a.vix.com
-print
-delete a.vix.com
-delete x.a.vix.com
-print
-delete b.vix.com
-delete c.vix.com
-print
-delete y.x.a.vix.com
-print
-delete g.h.vix.com.
-add \[b100000].vix.com.
-add \[b010000].vix.com.
-add \[b001000].vix.com.
-add \[b000100].vix.com.
-add \[b000010].vix.com.
-add \[b000001].vix.com.
-p
-search \[b000100].vix.com.
-# zap the entire tree
-add vix.com.
-nuke vix.com.
-add a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.
-add b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.
-print
-add .
-# zap it again
-nuke .
-# test splitting of maximal bitstring
-add \[xFFFF/16].\[xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF/256].com
-add \[xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF/128].com
-print
-quit
+add a.vix.com
+add b.vix.com
+add c.vix.com
+print
+add a.b.c.d.e.f.vix.com
+add b.b.c.d.e.f.vix.com
+add c.b.c.d.e.f.vix.com
+print
+add a.d.e.f.vix.com
+add q.d.e.f.vix.com
+add d.e.f.vix.com
+print
+add g.h.vix.com
+print
+search q.d.e.f.vix.com
+search just-parent.a.vix.com
+search no-real-parent.vix.com
+search does.not.exist.at.all
+forward
+backward
+# existing name
+check vix.com.
+# greater than stop node, which has down pointer
+check zzz.com.
+# less than lowest in level (would be left link from stop node)
+check 0.vix.com
+# greater than stop node, no down pointer
+check d.vix.com
+# superdomain stored in existing node
+check f.vix.com
+# common ancestor stored in existing node; existing is successor
+check a.e.f.vix.com
+# common ancestor stored in existing node; existing is less but not predecessor
+check z.e.f.vix.com
+#
+check g.vix.com
+#
+check i.vix.com
+#
+check b.c.vix.com
+nuke d.e.f.vix.com
+print
+add x.a.vix.com
+add y.x.a.vix.com
+print
+delete a.vix.com
+delete x.a.vix.com
+print
+delete b.vix.com
+delete c.vix.com
+print
+delete y.x.a.vix.com
+print
+delete g.h.vix.com.
+add \[b100000].vix.com.
+add \[b010000].vix.com.
+add \[b001000].vix.com.
+add \[b000100].vix.com.
+add \[b000010].vix.com.
+add \[b000001].vix.com.
+p
+search \[b000100].vix.com.
+# zap the entire tree
+add vix.com.
+nuke vix.com.
+add a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.
+add b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.
+print
+add .
+# zap it again
+nuke .
+# test splitting of maximal bitstring
+add \[xFFFF/16].\[xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF/256].com
+add \[xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF/128].com
+print
+quit
diff --git a/bin/tests/rwlock_test.c b/bin/tests/optional/rwlock_test.c
similarity index 98%
rename from bin/tests/rwlock_test.c
rename to bin/tests/optional/rwlock_test.c
index a3178908a3..a540e3cd50 100644
--- a/bin/tests/rwlock_test.c
+++ b/bin/tests/optional/rwlock_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: rwlock_test.c,v 1.26 2007/06/19 23:46:59 tbox Exp $ */
-
#include
#include
diff --git a/bin/tests/serial_test.c b/bin/tests/optional/serial_test.c
similarity index 93%
rename from bin/tests/serial_test.c
rename to bin/tests/optional/serial_test.c
index 61b31c8b41..2c8715722c 100644
--- a/bin/tests/serial_test.c
+++ b/bin/tests/optional/serial_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: serial_test.c,v 1.15 2007/06/19 23:46:59 tbox Exp $ */
-
#include
#include
diff --git a/bin/tests/shutdown_test.c b/bin/tests/optional/shutdown_test.c
similarity index 98%
rename from bin/tests/shutdown_test.c
rename to bin/tests/optional/shutdown_test.c
index f4f041197f..3e98b2de7f 100644
--- a/bin/tests/shutdown_test.c
+++ b/bin/tests/optional/shutdown_test.c
@@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
-/* $Id: shutdown_test.c,v 1.25 2011/08/28 23:46:41 tbox Exp $ */
-
#include
#include