Commit 1313127e authored by Mark Andrews's avatar Mark Andrews
Browse files

check result tables are complete

(cherry picked from commit 4f04a792)
parent 39fe368c
5087. [test] Check that result tables are complete. [GL #676]
5085. [bug] win32: Restore looking up nameservers, search list,
etc. [GL #186]
 
......
......@@ -24913,7 +24913,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/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/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/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/isccc/tests/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/samples/Makefile lib/samples/Makefile-postinstall unit/Makefile unit/unittest.sh"
 
 
#
......@@ -26027,6 +26027,7 @@ do
"lib/isccc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isccc/Makefile" ;;
"lib/isccc/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isccc/include/Makefile" ;;
"lib/isccc/include/isccc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isccc/include/isccc/Makefile" ;;
"lib/isccc/tests/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isccc/tests/Makefile" ;;
"lib/isccfg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isccfg/Makefile" ;;
"lib/isccfg/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isccfg/include/Makefile" ;;
"lib/isccfg/include/isccfg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/isccfg/include/isccfg/Makefile" ;;
......
......@@ -5458,6 +5458,7 @@ AC_CONFIG_FILES([
lib/isccc/Makefile
lib/isccc/include/Makefile
lib/isccc/include/isccc/Makefile
lib/isccc/tests/Makefile
lib/isccfg/Makefile
lib/isccfg/include/Makefile
lib/isccfg/include/isccfg/Makefile
......
......@@ -289,6 +289,7 @@ static const char *ids[DNS_R_NRESULTS] = {
"DNS_R_BADDNSTAP",
"DNS_R_BADTSIG",
"DNS_R_BADSIG0",
"DNS_R_TOOMANYRECORDS",
};
static const char *rcode_text[DNS_R_NRCODERESULTS] = {
......
......@@ -55,6 +55,7 @@ SRCS = acl_test.c \
rdataset_test.c \
rdatasetstats_test.c \
resolver_test.c \
result_test.c \
rsa_test.c \
sigs_test.c \
time_test.c \
......@@ -88,6 +89,7 @@ TARGETS = acl_test@EXEEXT@ \
rdataset_test@EXEEXT@ \
rdatasetstats_test@EXEEXT@ \
resolver_test@EXEEXT@ \
result_test@EXEEXT@ \
rsa_test@EXEEXT@ \
sigs_test@EXEEXT@ \
time_test@EXEEXT@ \
......@@ -227,6 +229,12 @@ resolver_test@EXEEXT@: resolver_test.@O@ dnstest.@O@ \
resolver_test.@O@ dnstest.@O@ ${DNSLIBS} \
${ISCLIBS} ${LIBS}
result_test@EXEEXT@: result_test.@O@ \
${ISCDEPLIBS} ${DNSDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
result_test.@O@ ${DNSLIBS} \
${ISCLIBS} ${LIBS}
rsa_test@EXEEXT@: rsa_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
rsa_test.@O@ dnstest.@O@ ${DNSLIBS} \
......
/*
* 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.
*/
/* ! \file */
#include <config.h>
#include <atf-c.h>
#include <isc/result.h>
#include <isc/util.h>
#include <dns/lib.h>
#include <dns/result.h>
#include <dst/result.h>
ATF_TC(ids);
ATF_TC_HEAD(ids, tc) {
atf_tc_set_md_var(tc, "descr", "check ids array is populated");
}
ATF_TC_BODY(ids, tc) {
const char *str;
isc_result_t result;
UNUSED(tc);
dns_result_register();
dst_result_register();
for (result = ISC_RESULTCLASS_DNS;
result < (ISC_RESULTCLASS_DNS + DNS_R_NRESULTS);
result++) {
str = isc_result_toid(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_toid(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_toid(%u) returned %s", result, str);
str = isc_result_totext(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_totext(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_totext(%u) returned %s", result, str);
}
str = isc_result_toid(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
str = isc_result_totext(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
for (result = ISC_RESULTCLASS_DST;
result < (ISC_RESULTCLASS_DST + DST_R_NRESULTS);
result++) {
str = isc_result_toid(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_toid(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_toid(%u) returned %s", result, str);
str = isc_result_totext(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_totext(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_totext(%u) returned %s", result, str);
}
str = isc_result_toid(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
str = isc_result_totext(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
for (result = ISC_RESULTCLASS_DNSRCODE;
result < (ISC_RESULTCLASS_DNSRCODE + DNS_R_NRCODERESULTS);
result++) {
str = isc_result_toid(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_toid(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_toid(%u) returned %s", result, str);
str = isc_result_totext(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_totext(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_totext(%u) returned %s", result, str);
}
str = isc_result_toid(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
str = isc_result_totext(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
}
/*
* Main
*/
ATF_TP_ADD_TCS(tp) {
ATF_TP_ADD_TC(tp, ids);
return (atf_no_error());
}
......@@ -17,6 +17,76 @@
#include <isc/result.h>
#ifdef PKCS11CRYPTO
#include <pk11/result.h>
#endif
ATF_TC(tables);
ATF_TC_HEAD(tables, tc) {
atf_tc_set_md_var(tc, "descr", "check tables are populated");
}
ATF_TC_BODY(tables, tc) {
const char *str;
isc_result_t result;
#ifdef PKCS11CRYPTO
pk11_result_register();
#endif
for (result = 0; result < ISC_R_NRESULTS; result++) {
str = isc_result_toid(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_toid(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_toid(%u) returned %s", result, str);
str = isc_result_totext(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_totext(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_totext(%u) returned %s", result, str);
}
str = isc_result_toid(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
str = isc_result_totext(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
#ifdef PKCS11CRYPTO
for (result = ISC_RESULTCLASS_PK11;
result < (ISC_RESULTCLASS_PK11 + PK11_R_NRESULTS);
result++)
{
str = isc_result_toid(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_toid(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_toid(%u) returned %s", result, str);
str = isc_result_totext(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_totext(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_totext(%u) returned %s", result, str);
}
str = isc_result_toid(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
str = isc_result_totext(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
#endif
}
ATF_TC(isc_result_toid);
ATF_TC_HEAD(isc_result_toid, tc) {
atf_tc_set_md_var(tc, "descr", "convert result to identifier string");
......@@ -51,6 +121,7 @@ ATF_TC_BODY(isc_result_totext, tc) {
ATF_TP_ADD_TCS(tp) {
ATF_TP_ADD_TC(tp, isc_result_toid);
ATF_TP_ADD_TC(tp, isc_result_totext);
ATF_TP_ADD_TC(tp, tables);
return (atf_no_error());
}
......@@ -45,6 +45,7 @@ SRCS = alist.c base64.c cc.c ccmsg.c \
TARGETS = timestamp
TESTDIRS = @UNITTESTS@
@BIND9_MAKE_RULES@
......@@ -69,6 +70,8 @@ libisccc.la: ${OBJS}
timestamp: libisccc.@A@
touch timestamp
testdirs: libisccc.@A@
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
......
# 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@
# Attempt to disable parallel processing.
.NOTPARALLEL:
.NO_PARALLEL:
VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I. -Iinclude ${ISCCC_INCLUDES} ${ISC_INCLUDES}
CDEFINES =
ISCLIBS = ../../isc/libisc.@A@ @ISC_OPENSSL_LIBS@
ISCDEPLIBS = ../../isc/libisc.@A@
ISCCCLIBS = ../libisccc.@A@
ISCCCDEPLIBS = ../libisccc.@A@
LIBS = @LIBS@ @ATFLIBS@
CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
CMOCKA_LIBS = @CMOCKA_LIBS@
OBJS =
SRCS = result_test.c
SUBDIRS =
TARGETS = result_test@EXEEXT@
@BIND9_MAKE_RULES@
result_test@EXEEXT@: result_test.@O@ \
${ISCDEPLIBS} ${ISCCCDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
result_test.@O@ ${ISCCCLIBS} \
${ISCLIBS} ${LIBS}
unit::
sh ${top_builddir}/unit/unittest.sh
clean distclean::
rm -f ${TARGETS}
rm -f atf.out
/*
* 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.
*/
/* ! \file */
#include <config.h>
#include <atf-c.h>
#include <isc/result.h>
#include <isc/util.h>
#include <isccc/lib.h>
#include <isccc/result.h>
ATF_TC(tables);
ATF_TC_HEAD(tables, tc) {
atf_tc_set_md_var(tc, "descr", "check tables are populated");
}
ATF_TC_BODY(tables, tc) {
const char *str;
isc_result_t result;
UNUSED(tc);
isccc_result_register();
for (result = ISC_RESULTCLASS_ISCCC;
result < (ISC_RESULTCLASS_ISCCC + ISCCC_R_NRESULTS);
result++) {
str = isc_result_toid(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_toid(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_toid(%u) returned %s", result, str);
str = isc_result_totext(result);
ATF_REQUIRE_MSG(str != NULL,
"isc_result_totext(%u) returned NULL", result);
ATF_CHECK_MSG(strcmp(str,
"(result code text not available)") != 0,
"isc_result_totext(%u) returned %s", result, str);
}
str = isc_result_toid(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
str = isc_result_totext(result);
ATF_REQUIRE(str != NULL);
ATF_CHECK_STREQ(str, "(result code text not available)");
}
/*
* Main
*/
ATF_TP_ADD_TCS(tp) {
ATF_TP_ADD_TC(tp, tables);
return (atf_no_error());
}
......@@ -3513,6 +3513,7 @@
./lib/dns/tests/rdataset_test.c C 2012,2016,2018
./lib/dns/tests/rdatasetstats_test.c C 2012,2015,2016,2018
./lib/dns/tests/resolver_test.c C 2018
./lib/dns/tests/result_test.c C 2018
./lib/dns/tests/rsa_test.c C 2016,2018
./lib/dns/tests/sigs_test.c C 2018
./lib/dns/tests/testdata/db/data.db ZONE 2018
......@@ -4047,6 +4048,7 @@
./lib/isccc/result.c C.NOM 2001,2003,2004,2005,2007,2015,2016,2018
./lib/isccc/sexpr.c C.NOM 2001,2004,2005,2007,2014,2015,2016,2018
./lib/isccc/symtab.c C.NOM 2001,2004,2005,2007,2016,2018
./lib/isccc/tests/result_test.c C 2018
./lib/isccc/version.c C 1998,1999,2000,2001,2004,2005,2007,2016,2018
./lib/isccc/win32/DLLMain.c C 2001,2004,2007,2016,2018
./lib/isccc/win32/libisccc.def X 2001,2016,2018
......
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