Commit 8ecf69ef authored by Evan Hunt's avatar Evan Hunt
Browse files

migrate t_names to lib/dns/tests/name_test

parent 109546cb
......@@ -7,7 +7,6 @@ sdig
t_db
gsstest
t_dst
t_names
conf.sh
dlopen
keycreate
......
......@@ -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
......
# 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}
#
# test data for dns_name_compare
# format:
# <name1> <tab> <name2> <tab> <exp_order>
# 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
#
# test data for dns_name_countlabels
# format:
# <name> <tab> <nlabels>
#
c.d 2
c.d. 3
a.b.c.d 4
a.b.c 3
. 1
#
# test data for dns_name_fromregion
# format:
# <test_name>
# 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
#
# test data for dns_name_fromtext
# format:
# <name1> <tab> <name2> <tab> <origin> <tab> <downcase>
#
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
#
# test data for dns_name_fromwire_1
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# 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
#
# test data for dns_name_fromwire_2
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# 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
#
# test data for dns_name_fromwire_3
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# 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
#
# test data for dns_name_fromwire_4
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# 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
#
# test data for dns_name_fromwire_5
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# 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
#
# test data for dns_name_fromwire_6
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# 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
#
# test data for dns_name_fromwire_7
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# 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
#
# test data for dns_name_fromwire_9
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# 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
#
# test data for dns_name_fullcompare
# format:
# <name1> <tab> <name2> <tab> <exp_reln> <tab> <exp_order> <tab> <exp_nlabels> <tab> <exp_nbits>
# 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
#
# test data for dns_name_compare
# format:
# <name1> <tab> <label1_pos> <tab> <name2> <tab> <label2_pos>
# 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
#
# test data for dns_name_getlabelsequence
# format:
# <name1> <tab> <label1_start> <tab> <name2> <tab> <label2_start> <tab> <extent>
#
#
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
#
# test data for dns_name_hash
# format:
# <testname1> <tab> <testname2> <tab> <cshm> <tab> <cishm>
# 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
#
# test data for dns_name_isabsolute
# format is:
# <testname> <tab> <expected value>
#
x. 1
a.b.c.d 0
x.z. 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment