From: Evan Hunt Date: Thu, 1 Mar 2018 00:51:23 +0000 (-0800) Subject: migrate t_names to lib/dns/tests/name_test X-Git-Tag: v9.13.0~101^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ecf69ef7bc125753b3647c45c1be721bd3ea400;p=thirdparty%2Fbind9.git migrate t_names to lib/dns/tests/name_test --- diff --git a/bin/tests/.gitignore b/bin/tests/.gitignore index 9b2e581b060..8cf880b9cfe 100644 --- a/bin/tests/.gitignore +++ b/bin/tests/.gitignore @@ -7,7 +7,6 @@ sdig t_db gsstest t_dst -t_names conf.sh dlopen keycreate diff --git a/bin/tests/Makefile.in b/bin/tests/Makefile.in index b327d272eea..98b9c2bc7e2 100644 --- a/bin/tests/Makefile.in +++ b/bin/tests/Makefile.in @@ -32,7 +32,7 @@ ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@ LIBS = @LIBS@ -SUBDIR = db dst names system @PKCS11_TOOLS@ optional +SUBDIR = db dst system @PKCS11_TOOLS@ optional TESTDIRS = system diff --git a/bin/tests/names/Makefile.in b/bin/tests/names/Makefile.in deleted file mode 100644 index 27fc124cdd3..00000000000 --- 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 0467fcfeb01..00000000000 --- 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 f11c3873f45..00000000000 --- 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 32b42204834..00000000000 --- 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 16554a5a590..00000000000 --- 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 b7ae69bfd80..00000000000 --- 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 90dfec4e71a..00000000000 --- 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 f4253b475d2..00000000000 --- 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 b76b326dbc8..00000000000 --- 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 1a4221b6480..00000000000 --- 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 e4460cea0c6..00000000000 --- 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 5828bfc8845..00000000000 --- 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 9ddd3f3da06..00000000000 --- 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 f40e7e6998e..00000000000 --- 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 d8dc880a099..00000000000 --- 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 339604afb03..00000000000 --- 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 bf2fc79e4d1..00000000000 --- 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 a17c9b8a19c..00000000000 --- 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 102b0721f3a..00000000000 --- 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 7f0c6a21096..00000000000 --- 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 00c10f49f93..00000000000 --- 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 9db22aad1ed..00000000000 --- 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 a45d80a69f6..00000000000 --- 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 35479bea10b..00000000000 --- 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 59e396b36f3..00000000000 --- 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 8520c64b10e..00000000000 --- 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 5be43c2ffda..00000000000 --- 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 695b5c78b91..00000000000 --- 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 505134acfa9..00000000000 --- 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 ea03557da71..00000000000 --- 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 5f5ec590619..00000000000 --- 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 fae2fe25ecb..00000000000 --- 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 dba6035ab5d..00000000000 --- 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 505134acfa9..00000000000 --- 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 1a05d264e84..00000000000 --- 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 40fbbed6150..00000000000 --- 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 beabbf7b28a..00000000000 --- 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/configure b/configure index a94f7efb315..4027917423d 100755 --- a/configure +++ b/configure @@ -24157,7 +24157,7 @@ ac_config_commands="$ac_config_commands chmod" # elsewhere if there's a good reason for doing so. # -ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/db/Makefile bin/tests/dst/Makefile bin/tests/dst/Kdh.+002+18602.key bin/tests/dst/Kdh.+002+18602.private bin/tests/dst/Kdh.+002+48957.key bin/tests/dst/Kdh.+002+48957.private bin/tests/dst/Ktest.+001+00002.key bin/tests/dst/Ktest.+001+54622.key bin/tests/dst/Ktest.+001+54622.private bin/tests/dst/Ktest.+003+23616.key bin/tests/dst/Ktest.+003+23616.private bin/tests/dst/Ktest.+003+49667.key bin/tests/dst/dst_2_data bin/tests/dst/t2_data_1 bin/tests/dst/t2_data_2 bin/tests/dst/t2_dsasig bin/tests/dst/t2_rsasig bin/tests/headerdep_test.sh bin/tests/names/Makefile bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/inline/checkdsa.sh bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/$arch/Makefile lib/isc/$arch/include/Makefile lib/isc/$arch/include/isc/Makefile lib/isc/$thread_dir/Makefile lib/isc/$thread_dir/include/Makefile lib/isc/$thread_dir/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/Makefile unit/unittest.sh" +ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/db/Makefile bin/tests/dst/Makefile bin/tests/dst/Kdh.+002+18602.key bin/tests/dst/Kdh.+002+18602.private bin/tests/dst/Kdh.+002+48957.key bin/tests/dst/Kdh.+002+48957.private bin/tests/dst/Ktest.+001+00002.key bin/tests/dst/Ktest.+001+54622.key bin/tests/dst/Ktest.+001+54622.private bin/tests/dst/Ktest.+003+23616.key bin/tests/dst/Ktest.+003+23616.private bin/tests/dst/Ktest.+003+49667.key bin/tests/dst/dst_2_data bin/tests/dst/t2_data_1 bin/tests/dst/t2_data_2 bin/tests/dst/t2_dsasig bin/tests/dst/t2_rsasig bin/tests/headerdep_test.sh bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/inline/checkdsa.sh bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/$arch/Makefile lib/isc/$arch/include/Makefile lib/isc/$arch/include/isc/Makefile lib/isc/$thread_dir/Makefile lib/isc/$thread_dir/include/Makefile lib/isc/$thread_dir/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/Makefile unit/unittest.sh" # @@ -25214,7 +25214,6 @@ do "bin/tests/dst/t2_dsasig") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/t2_dsasig" ;; "bin/tests/dst/t2_rsasig") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/t2_rsasig" ;; "bin/tests/headerdep_test.sh") CONFIG_FILES="$CONFIG_FILES bin/tests/headerdep_test.sh" ;; - "bin/tests/names/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/names/Makefile" ;; "bin/tests/optional/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/optional/Makefile" ;; "bin/tests/pkcs11/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/pkcs11/Makefile" ;; "bin/tests/pkcs11/benchmarks/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/pkcs11/benchmarks/Makefile" ;; diff --git a/configure.in b/configure.in index 1147dfb0e1d..beb84e5afee 100644 --- a/configure.in +++ b/configure.in @@ -5331,7 +5331,6 @@ AC_CONFIG_FILES([ bin/tests/dst/t2_dsasig bin/tests/dst/t2_rsasig bin/tests/headerdep_test.sh - bin/tests/names/Makefile bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile diff --git a/lib/dns/tests/name_test.c b/lib/dns/tests/name_test.c index bab9d4a0d3c..77d4ab46d09 100644 --- a/lib/dns/tests/name_test.c +++ b/lib/dns/tests/name_test.c @@ -9,8 +9,6 @@ * information regarding copyright ownership. */ -/* $Id$ */ - /*! \file */ #include @@ -328,6 +326,338 @@ ATF_TC_BODY(istat, tc) { } } +ATF_TC(init); +ATF_TC_HEAD(init, tc) { + atf_tc_set_md_var(tc, "descr", "dns_nane_init"); +} +ATF_TC_BODY(init, tc) { + dns_name_t name; + unsigned char offsets[1]; + + dns_name_init(&name, offsets); + + ATF_CHECK_EQ(name.ndata, NULL); + ATF_CHECK_EQ(name.length, 0); + ATF_CHECK_EQ(name.labels, 0); + ATF_CHECK_EQ(name.attributes, 0); + ATF_CHECK_EQ(name.offsets, offsets); + ATF_CHECK_EQ(name.buffer, NULL); +} + +ATF_TC(invalidate); +ATF_TC_HEAD(invalidate, tc) { + atf_tc_set_md_var(tc, "descr", "dns_nane_invalidate"); +} +ATF_TC_BODY(invalidate, tc) { + dns_name_t name; + unsigned char offsets[1]; + + dns_name_init(&name, offsets); + dns_name_invalidate(&name); + + ATF_CHECK_EQ(name.ndata, NULL); + ATF_CHECK_EQ(name.length, 0); + ATF_CHECK_EQ(name.labels, 0); + ATF_CHECK_EQ(name.attributes, 0); + ATF_CHECK_EQ(name.offsets, NULL); + ATF_CHECK_EQ(name.buffer, NULL); +} + +ATF_TC(buffer); +ATF_TC_HEAD(buffer, tc) { + atf_tc_set_md_var(tc, "descr", "dns_nane_setbuffer/hasbuffer"); +} +ATF_TC_BODY(buffer, tc) { + dns_name_t name; + unsigned char buf[BUFSIZ]; + isc_buffer_t b; + + isc_buffer_init(&b, buf, BUFSIZ); + dns_name_init(&name, NULL); + dns_name_setbuffer(&name, &b); + ATF_CHECK_EQ(name.buffer, &b); + ATF_CHECK(dns_name_hasbuffer(&name)); +} + +ATF_TC(isabsolute); +ATF_TC_HEAD(isabsolute, tc) { + atf_tc_set_md_var(tc, "descr", "dns_nane_isabsolute"); +} +ATF_TC_BODY(isabsolute, tc) { + struct { + const char *namestr; + isc_boolean_t expect; + } testcases[] = { + { "x", ISC_FALSE }, + { "a.b.c.d.", ISC_TRUE }, + { "x.z", ISC_FALSE} + }; + unsigned int i; + + for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) { + isc_result_t result; + dns_name_t name; + unsigned char data[BUFSIZ]; + isc_buffer_t b, nb; + size_t len; + + len = strlen(testcases[i].namestr); + isc_buffer_constinit(&b, testcases[i].namestr, len); + isc_buffer_add(&b, len); + + dns_name_init(&name, NULL); + isc_buffer_init(&nb, data, BUFSIZ); + dns_name_setbuffer(&name, &nb); + result = dns_name_fromtext(&name, &b, NULL, 0, NULL); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + ATF_CHECK_EQ(dns_name_isabsolute(&name), testcases[i].expect); + } +} + +ATF_TC(hash); +ATF_TC_HEAD(hash, tc) { + atf_tc_set_md_var(tc, "descr", "dns_nane_hash"); +} +ATF_TC_BODY(hash, tc) { + struct { + const char *name1; + const char *name2; + isc_boolean_t expect; + isc_boolean_t expecti; + } testcases[] = { + { "a.b.c.d", "A.B.C.D", ISC_TRUE, ISC_FALSE }, + { "a.b.c.d.", "A.B.C.D.", ISC_TRUE, ISC_FALSE }, + { "a.b.c.d", "a.b.c.d", ISC_TRUE, ISC_TRUE }, + { "A.B.C.D.", "A.B.C.D.", ISC_TRUE, ISC_FALSE }, + { "x.y.z.w", "a.b.c.d", ISC_FALSE, ISC_FALSE }, + { "x.y.z.w.", "a.b.c.d.", ISC_FALSE, ISC_FALSE }, + }; + unsigned int i; + + for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) { + isc_result_t result; + dns_fixedname_t f1, f2; + dns_name_t *n1, *n2; + unsigned int h1, h2; + + dns_fixedname_init(&f1); + n1 = dns_fixedname_name(&f1); + dns_fixedname_init(&f2); + n2 = dns_fixedname_name(&f2); + + result = dns_name_fromstring2(n1, testcases[i].name1, + NULL, 0, NULL); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + result = dns_name_fromstring2(n2, testcases[i].name2, + NULL, 0, NULL); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + /* Check case-insensitive hashing first */ + h1 = dns_name_hash(n1, ISC_FALSE); + h2 = dns_name_hash(n2, ISC_FALSE); + + printf("%s hashes to %u, %s to %u, case insensitive\n", + testcases[i].name1, h1, testcases[i].name2, h2); + + ATF_REQUIRE_EQ(ISC_TF(h1 == h2), testcases[i].expect); + + /* Now case-sensitive */ + h1 = dns_name_hash(n1, ISC_FALSE); + h2 = dns_name_hash(n2, ISC_FALSE); + + printf("%s hashes to %u, %s to %u, case sensitive\n", + testcases[i].name1, h1, testcases[i].name2, h2); + + ATF_REQUIRE_EQ(ISC_TF(h1 == h2), testcases[i].expect); + } +} + +ATF_TC(issubdomain); +ATF_TC_HEAD(issubdomain, tc) { + atf_tc_set_md_var(tc, "descr", "dns_nane_issubdomain"); +} +ATF_TC_BODY(issubdomain, tc) { + struct { + const char *name1; + const char *name2; + isc_boolean_t expect; + } testcases[] = { + { "c.d", "a.b.c.d", ISC_FALSE }, + { "c.d.", "a.b.c.d.", ISC_FALSE }, + { "b.c.d", "c.d", ISC_TRUE }, + { "a.b.c.d.", "c.d.", ISC_TRUE }, + { "a.b.c", "a.b.c", ISC_TRUE }, + { "a.b.c.", "a.b.c.", ISC_TRUE }, + { "x.y.z", "a.b.c", ISC_FALSE} + }; + unsigned int i; + + for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) { + isc_result_t result; + dns_fixedname_t f1, f2; + dns_name_t *n1, *n2; + + dns_fixedname_init(&f1); + n1 = dns_fixedname_name(&f1); + dns_fixedname_init(&f2); + n2 = dns_fixedname_name(&f2); + + result = dns_name_fromstring2(n1, testcases[i].name1, + NULL, 0, NULL); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + result = dns_name_fromstring2(n2, testcases[i].name2, + NULL, 0, NULL); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + printf("check: %s %s a subdomain of %s\n", + testcases[i].name1, + testcases[i].expect ? "is" : "is not", + testcases[i].name2); + + ATF_CHECK_EQ(dns_name_issubdomain(n1, n2), + testcases[i].expect); + } +} + +ATF_TC(countlabels); +ATF_TC_HEAD(countlabels, tc) { + atf_tc_set_md_var(tc, "descr", "dns_nane_countlabels"); +} +ATF_TC_BODY(countlabels, tc) { + struct { + const char *namestr; + unsigned int expect; + } testcases[] = { + { "c.d", 2 }, + { "c.d.", 3 }, + { "a.b.c.d.", 5 }, + { "a.b.c.d", 4 }, + { "a.b.c", 3 }, + { ".", 1 }, + }; + unsigned int i; + + for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) { + isc_result_t result; + dns_fixedname_t fname; + dns_name_t *name; + + dns_fixedname_init(&fname); + name = dns_fixedname_name(&fname); + + result = dns_name_fromstring2(name, testcases[i].namestr, + NULL, 0, NULL); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + printf("%s: expect %d labels\n", + testcases[i].namestr, testcases[i].expect); + + ATF_REQUIRE_EQ(dns_name_countlabels(name), + testcases[i].expect); + } +} + +ATF_TC(getlabel); +ATF_TC_HEAD(getlabel, tc) { + atf_tc_set_md_var(tc, "descr", "dns_nane_getlabel"); +} +ATF_TC_BODY(getlabel, tc) { + struct { + const char *name1; + unsigned int pos1; + const char *name2; + unsigned int pos2; + } testcases[] = { + { "c.d", 1, "a.b.c.d", 3 }, + { "a.b.c.d", 3, "c.d", 1 }, + { "a.b.c.", 3, "A.B.C.", 3 }, + }; + unsigned int i; + + for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) { + isc_result_t result; + dns_fixedname_t f1, f2; + dns_name_t *n1, *n2; + dns_label_t l1, l2; + unsigned char *p1, *p2; + unsigned int j; + + dns_fixedname_init(&f1); + n1 = dns_fixedname_name(&f1); + dns_fixedname_init(&f2); + n2 = dns_fixedname_name(&f2); + + result = dns_name_fromstring2(n1, testcases[i].name1, + NULL, 0, NULL); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + result = dns_name_fromstring2(n2, testcases[i].name2, + NULL, 0, NULL); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + dns_name_getlabel(n1, testcases[i].pos1, &l1); + dns_name_getlabel(n2, testcases[i].pos2, &l2); + ATF_CHECK_EQ(l1.length, l2.length); + + p1 = l1.base; + p2 = l2.base; + for (j = 0; j < l1.length; j++) { + ATF_REQUIRE_EQ(*p1++, *p2++); + } + } +} + +ATF_TC(getlabelsequence); +ATF_TC_HEAD(getlabelsequence, tc) { + atf_tc_set_md_var(tc, "descr", "dns_nane_getlabelsequence"); +} +ATF_TC_BODY(getlabelsequence, tc) { + struct { + const char *name1; + unsigned int pos1; + const char *name2; + unsigned int pos2; + unsigned int range; + } testcases[] = { + { "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 }, + + }; + unsigned int i; + + for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) { + isc_result_t result; + dns_name_t t1, t2; + dns_fixedname_t f1, f2; + dns_name_t *n1, *n2; + + /* target names */ + dns_name_init(&t1, NULL); + dns_name_init(&t2, NULL); + + /* source names */ + dns_fixedname_init(&f1); + n1 = dns_fixedname_name(&f1); + dns_fixedname_init(&f2); + n2 = dns_fixedname_name(&f2); + + result = dns_name_fromstring2(n1, testcases[i].name1, + NULL, 0, NULL); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + result = dns_name_fromstring2(n2, testcases[i].name2, + NULL, 0, NULL); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + dns_name_getlabelsequence(n1, testcases[i].pos1, + testcases[i].range, &t1); + dns_name_getlabelsequence(n2, testcases[i].pos2, + testcases[i].range, &t2); + + ATF_REQUIRE(dns_name_equal(&t1, &t2)); + } +} + #ifdef ISC_PLATFORM_USETHREADS #ifdef DNS_BENCHMARK_TESTS @@ -433,6 +763,15 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, fullcompare); ATF_TP_ADD_TC(tp, compression); ATF_TP_ADD_TC(tp, istat); + ATF_TP_ADD_TC(tp, init); + ATF_TP_ADD_TC(tp, invalidate); + ATF_TP_ADD_TC(tp, buffer); + ATF_TP_ADD_TC(tp, isabsolute); + ATF_TP_ADD_TC(tp, hash); + ATF_TP_ADD_TC(tp, issubdomain); + ATF_TP_ADD_TC(tp, countlabels); + ATF_TP_ADD_TC(tp, getlabel); + ATF_TP_ADD_TC(tp, getlabelsequence); #ifdef ISC_PLATFORM_USETHREADS #ifdef DNS_BENCHMARK_TESTS ATF_TP_ADD_TC(tp, benchmark); diff --git a/util/copyrights b/util/copyrights index ddb50aebf8c..c50e9ab7335 100644 --- a/util/copyrights +++ b/util/copyrights @@ -440,43 +440,6 @@ ./bin/tests/mempool_test.c C 1999,2000,2001,2004,2007,2016,2018 ./bin/tests/name_test.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2015,2016,2017,2018 ./bin/tests/named.conf CONF-C 1999,2000,2001,2004,2007,2011,2015,2016,2018 -./bin/tests/names/Makefile.in MAKE 1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017,2018 -./bin/tests/names/dns_name_compare_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_countlabels_data X 1999,2000,2001,2003,2018 -./bin/tests/names/dns_name_fromregion_data X 1999,2000,2001,2003,2018 -./bin/tests/names/dns_name_fromtext_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_fromwire_1_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_fromwire_2_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_fromwire_3_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_fromwire_4_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_fromwire_5_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_fromwire_6_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_fromwire_7_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_fromwire_8_data X 1999,2000,2001,2006,2018 -./bin/tests/names/dns_name_fullcompare_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_getlabel_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_getlabelsequence_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_hash_data X 1999,2000,2001,2003,2012,2018 -./bin/tests/names/dns_name_isabsolute_data X 1999,2000,2001,2003,2018 -./bin/tests/names/dns_name_issubdomain_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_rdatacompare_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_toregion_data X 1999,2000,2001,2003,2018 -./bin/tests/names/dns_name_totext_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_towire_1_data X 1999,2000,2001,2018 -./bin/tests/names/dns_name_towire_2_data X 1999,2000,2001,2018 -./bin/tests/names/t_names.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2018 -./bin/tests/names/win32/t_names.vcxproj.filters.in X 2013,2015,2018 -./bin/tests/names/win32/t_names.vcxproj.in X 2013,2015,2016,2017,2018 -./bin/tests/names/win32/t_names.vcxproj.user X 2013,2018 -./bin/tests/names/wire_test1.data X 1999,2000,2001,2018 -./bin/tests/names/wire_test2.data X 1999,2000,2001,2018 -./bin/tests/names/wire_test3_1.data X 1999,2000,2001,2018 -./bin/tests/names/wire_test3_2.data X 1999,2000,2001,2018 -./bin/tests/names/wire_test4.data X 1999,2000,2001,2018 -./bin/tests/names/wire_test5.data X 1999,2000,2001,2018 -./bin/tests/names/wire_test6.data X 1999,2000,2001,2018 -./bin/tests/names/wire_test7.data X 1999,2000,2001,2018 -./bin/tests/names/wire_test8.data X 1999,2000,2001,2018 ./bin/tests/ndc.conf CONF-C 2000,2001,2004,2007,2016,2018 ./bin/tests/ndc.conf-include CONF-C 2001,2004,2007,2016,2018 ./bin/tests/nsecify.c C 1999,2000,2001,2003,2004,2007,2008,2009,2011,2015,2016,2017,2018 diff --git a/win32utils/Configure b/win32utils/Configure index 37b76941378..689fdcf96ca 100644 --- a/win32utils/Configure +++ b/win32utils/Configure @@ -120,8 +120,6 @@ my @projectlist = ("..\\bin\\check\\win32\\checkconf.vcxproj", "..\\bin\\tests\\db\\win32\\t_db.vcxproj.filters", "..\\bin\\tests\\dst\\win32\\t_dst.vcxproj", "..\\bin\\tests\\dst\\win32\\t_dst.vcxproj.filters", - "..\\bin\\tests\\names\\win32\\t_names.vcxproj", - "..\\bin\\tests\\names\\win32\\t_names.vcxproj.filters", "..\\bin\\tests\\system\\win32\\bigkey.vcxproj", "..\\bin\\tests\\system\\win32\\bigkey.vcxproj.filters", "..\\bin\\tests\\system\\win32\\feature-test.vcxproj", diff --git a/win32utils/bind9.sln.in b/win32utils/bind9.sln.in index acfac853954..771e9617681 100644 --- a/win32utils/bind9.sln.in +++ b/win32utils/bind9.sln.in @@ -516,14 +516,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t_dst", "..\bin\tests\dst\w {B4AC7F81-E3DC-43E9-B339-4FA5149FA8F7} = {B4AC7F81-E3DC-43E9-B339-4FA5149FA8F7} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t_names", "..\bin\tests\names\win32\t_names.vcxproj", "{124DC0D3-3096-41D2-B490-CE85E890FF33}" - ProjectSection(ProjectDependencies) = postProject - {A3F71D12-F38A-4C77-8D87-8E8854CA74A1} = {A3F71D12-F38A-4C77-8D87-8E8854CA74A1} - {3840E563-D180-4761-AA9C-E6155F02EAFF} = {3840E563-D180-4761-AA9C-E6155F02EAFF} - {5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A} = {5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A} - {F6F08940-7597-4FEE-9CE0-E09A009C45A3} = {F6F08940-7597-4FEE-9CE0-E09A009C45A3} - EndProjectSection -EndProject @END TESTS @IF XTESTS Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "backtrace_test", "..\bin\tests\win32\backtrace_test.vcxproj", "{14751171-C40E-40EE-A2F0-37FFC3CCD4A2}"