mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-22 10:10:06 +00:00
add a compile-time option to select default zone and cache DB
by default, QPDB is the database used by named and all tools and unit tests. the old default of RBTDB can now be restored by using "configure --with-zonedb=rbt --with-cachedb=rbt". some tests have been fixed so they will work correctly with either database. CHANGES and release notes have been updated to reflect this change.
This commit is contained in:
parent
618c963cb7
commit
92b305be4b
12
CHANGES
12
CHANGES
@ -2,8 +2,8 @@
|
||||
RBTDB has been replaced with QP-tries. This is
|
||||
expected to improve scalability and reduce
|
||||
CPU consumption under load. It is currently known to
|
||||
have higher memory consumption than RBTDB; this
|
||||
will be addressed in future releases.
|
||||
have higher memory consumption than the traditional
|
||||
RBTDB; this will be addressed in future releases.
|
||||
|
||||
Nodes in a QP-trie contain the full domain name,
|
||||
while nodes in a red-black tree only contain names
|
||||
@ -18,7 +18,13 @@
|
||||
single-thread "dns_qp" interface with locks for
|
||||
synchronization. A future version will use the
|
||||
multithreaded "dns_qpmulti" interface instead,
|
||||
and will be renamed to QPDB. [GL #4411]
|
||||
and will be renamed to QPDB.
|
||||
|
||||
The RBT-based version of RBTDB is still in place
|
||||
for now, and can be used by specifying "database rbt"
|
||||
in a "zone" statement, or by compiling with
|
||||
"configure --with-zonedb=rbt --with-cachedb=rbt".
|
||||
[GL #4411]
|
||||
|
||||
6354. [bug] Change 6035 introduced a regression when chasing DS
|
||||
records resulting in an assertion failure. [GL #4612]
|
||||
|
@ -73,7 +73,7 @@
|
||||
#define ERR_IS_MXCNAME 6
|
||||
#define ERR_IS_SRVCNAME 7
|
||||
|
||||
static const char *dbtype[] = { "qp" };
|
||||
static const char *dbtype[] = { ZONEDB_DEFAULT };
|
||||
|
||||
int debug = 0;
|
||||
const char *journal = NULL;
|
||||
|
@ -242,7 +242,9 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
|
||||
* Skip checks when using an alternate data source.
|
||||
*/
|
||||
cfg_map_get(zoptions, "database", &dbobj);
|
||||
if (dbobj != NULL && strcmp("qp", cfg_obj_asstring(dbobj)) != 0) {
|
||||
if (dbobj != NULL &&
|
||||
strcmp(ZONEDB_DEFAULT, cfg_obj_asstring(dbobj)) != 0)
|
||||
{
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
@ -247,8 +247,8 @@ static void
|
||||
load_db(const char *filename, dns_db_t **dbp, dns_dbnode_t **nodep) {
|
||||
isc_result_t result;
|
||||
|
||||
result = dns_db_create(mctx, "qp", name, dns_dbtype_zone, rdclass, 0,
|
||||
NULL, dbp);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, name, dns_dbtype_zone,
|
||||
rdclass, 0, NULL, dbp);
|
||||
check_result(result, "dns_db_create()");
|
||||
|
||||
result = dns_db_load(*dbp, filename, dns_masterformat_text,
|
||||
@ -979,8 +979,8 @@ update_diff(const char *cmd, uint32_t ttl, dns_rdataset_t *addset,
|
||||
dns_rdataset_t diffset;
|
||||
uint32_t save;
|
||||
|
||||
result = dns_db_create(mctx, "qp", name, dns_dbtype_zone, rdclass, 0,
|
||||
NULL, &update_db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, name, dns_dbtype_zone,
|
||||
rdclass, 0, NULL, &update_db);
|
||||
check_result(result, "dns_db_create()");
|
||||
|
||||
result = dns_db_newversion(update_db, &update_version);
|
||||
|
@ -100,8 +100,8 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
|
||||
|
||||
dns_name_format(name, setname, sizeof(setname));
|
||||
|
||||
result = dns_db_create(mctx, "qp", name, dns_dbtype_zone, rdclass, 0,
|
||||
NULL, &db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, name, dns_dbtype_zone,
|
||||
rdclass, 0, NULL, &db);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("can't create database");
|
||||
}
|
||||
|
@ -103,8 +103,8 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
|
||||
|
||||
dns_name_format(name, setname, sizeof(setname));
|
||||
|
||||
result = dns_db_create(mctx, "qp", name, dns_dbtype_zone, rdclass, 0,
|
||||
NULL, &db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, name, dns_dbtype_zone,
|
||||
rdclass, 0, NULL, &db);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("can't create database");
|
||||
}
|
||||
|
@ -998,8 +998,8 @@ opendb(const char *prefix, dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
}
|
||||
isc_buffer_putuint8(&b, 0);
|
||||
|
||||
result = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_zone,
|
||||
rdclass, 0, NULL, dbp);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_zone, rdclass, 0, NULL, dbp);
|
||||
check_result(result, "dns_db_create()");
|
||||
|
||||
result = dns_db_load(*dbp, filename, inputformat, DNS_MASTER_HINT);
|
||||
@ -2572,8 +2572,8 @@ loadzone(char *file, char *origin, dns_rdataclass_t rdclass, dns_db_t **db) {
|
||||
isc_result_totext(result));
|
||||
}
|
||||
|
||||
result = dns_db_create(mctx, "qp", name, dns_dbtype_zone, rdclass, 0,
|
||||
NULL, db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, name, dns_dbtype_zone,
|
||||
rdclass, 0, NULL, db);
|
||||
check_result(result, "dns_db_create()");
|
||||
|
||||
result = dns_db_load(*db, file, inputformat, 0);
|
||||
@ -3162,8 +3162,8 @@ writeset(const char *prefix, dns_rdatatype_t type) {
|
||||
dns_diff_append(&diff, &tuple);
|
||||
}
|
||||
|
||||
result = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_zone,
|
||||
gclass, 0, NULL, &db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_zone, gclass, 0, NULL, &db);
|
||||
check_result(result, "dns_db_create");
|
||||
|
||||
result = dns_db_newversion(db, &dbversion);
|
||||
|
@ -109,8 +109,8 @@ loadzone(char *file, char *origin, dns_rdataclass_t rdclass, dns_db_t **db) {
|
||||
isc_result_totext(result));
|
||||
}
|
||||
|
||||
result = dns_db_create(mctx, "qp", name, dns_dbtype_zone, rdclass, 0,
|
||||
NULL, db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, name, dns_dbtype_zone,
|
||||
rdclass, 0, NULL, db);
|
||||
check_result(result, "dns_db_create()");
|
||||
|
||||
result = dns_db_load(*db, file, inputformat, 0);
|
||||
|
@ -3377,7 +3377,7 @@ create_empty_zone(dns_zone_t *pzone, dns_name_t *name, dns_view_t *view,
|
||||
const cfg_obj_t *obj;
|
||||
const cfg_obj_t *zconfig;
|
||||
const cfg_obj_t *zoptions;
|
||||
const char *rbt_dbtype[4] = { "qp" };
|
||||
const char *default_dbtype[4] = { ZONEDB_DEFAULT };
|
||||
const char *sep = ": view ";
|
||||
const char *str;
|
||||
const char *viewname = view->name;
|
||||
@ -3390,7 +3390,7 @@ create_empty_zone(dns_zone_t *pzone, dns_name_t *name, dns_view_t *view,
|
||||
dns_name_t *ns;
|
||||
dns_name_t *zname;
|
||||
dns_zone_t *zone = NULL;
|
||||
int rbt_dbtypec = 1;
|
||||
int default_dbtypec = 1;
|
||||
isc_result_t result;
|
||||
dns_namereln_t namereln;
|
||||
int order;
|
||||
@ -3432,7 +3432,7 @@ create_empty_zone(dns_zone_t *pzone, dns_name_t *name, dns_view_t *view,
|
||||
}
|
||||
}
|
||||
if (db == NULL) {
|
||||
CHECK(dns_db_create(view->mctx, "qp", name,
|
||||
CHECK(dns_db_create(view->mctx, ZONEDB_DEFAULT, name,
|
||||
dns_dbtype_zone, view->rdclass, 0,
|
||||
NULL, &db));
|
||||
CHECK(dns_db_newversion(db, &version));
|
||||
@ -3452,15 +3452,15 @@ create_empty_zone(dns_zone_t *pzone, dns_name_t *name, dns_view_t *view,
|
||||
}
|
||||
|
||||
/*
|
||||
* Is the existing zone the ok to use?
|
||||
* Is the existing zone ok to use?
|
||||
*/
|
||||
if (pzone != NULL) {
|
||||
unsigned int typec;
|
||||
const char **dbargv;
|
||||
const char **dbargv = NULL;
|
||||
|
||||
if (db != NULL) {
|
||||
typec = rbt_dbtypec;
|
||||
dbargv = rbt_dbtype;
|
||||
typec = default_dbtypec;
|
||||
dbargv = default_dbtype;
|
||||
} else {
|
||||
typec = empty_dbtypec;
|
||||
dbargv = empty_dbtype;
|
||||
|
@ -885,7 +885,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
uint32_t count;
|
||||
unsigned int dbargc;
|
||||
char **dbargv;
|
||||
static char default_dbtype[] = "qp";
|
||||
static char default_dbtype[] = ZONEDB_DEFAULT;
|
||||
static char dlz_dbtype[] = "dlz";
|
||||
char *cpval = default_dbtype;
|
||||
isc_mem_t *mctx = dns_zone_getmctx(zone);
|
||||
|
@ -67,7 +67,7 @@ loadzone(dns_db_t **db, const char *origin, const char *filename) {
|
||||
return (result);
|
||||
}
|
||||
|
||||
result = dns_db_create(mctx, "qp", name, dns_dbtype_zone,
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, name, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, db);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
|
35
configure.ac
35
configure.ac
@ -1569,6 +1569,35 @@ AS_IF([test -z "$DTRACE"],
|
||||
|
||||
AC_SUBST([DTRACE])
|
||||
|
||||
#
|
||||
# Which should be the default zone database, RBTDB or QPDB?
|
||||
# [pairwise: --with-zonedb=qp, --with-zonedb=rbt]
|
||||
#
|
||||
AC_ARG_WITH([zonedb],
|
||||
[AS_HELP_STRING([--with-zonedb=detect],[specify default zone database type (default is "qp")])],
|
||||
[],[with_zonedb=qp])
|
||||
zonedb="qp"
|
||||
AS_CASE([$with_zonedb],
|
||||
[RBT*|rbt*],[zonedb="rbt"],
|
||||
[QP*|qp*],[],
|
||||
[AC_MSG_ERROR([Unknown zone database type])]
|
||||
)
|
||||
AC_DEFINE_UNQUOTED([ZONEDB_DEFAULT], ["$zonedb"], [Default zone database type])
|
||||
|
||||
#
|
||||
# Which should be the default cache database, RBTDB or QPDB?
|
||||
# [pairwise: --with-cachedb=qp, --with-cachedb=rbt]
|
||||
#
|
||||
AC_ARG_WITH([cachedb],
|
||||
[AS_HELP_STRING([--with-cachedb=detect],[specify default cache database type (default is "qp")])],
|
||||
[],[with_cachedb=qp])
|
||||
cachedb="qp"
|
||||
AS_CASE([$with_cachedb],
|
||||
[RBT*|rbt*],[cachedb="rbt"],
|
||||
[QP*|qp*],[],
|
||||
[AC_MSG_ERROR([Unknown cache database type])]
|
||||
)
|
||||
AC_DEFINE_UNQUOTED([CACHEDB_DEFAULT], ["$cachedb"], [Default cache database type])
|
||||
|
||||
#
|
||||
# Files to configure. These are listed here because we used to
|
||||
@ -1668,6 +1697,12 @@ report() {
|
||||
if test "yes" = "$with_jemalloc"; then
|
||||
echo " Memory allocator: jemalloc"
|
||||
fi
|
||||
if test "yes" = "$enable_full_report" -o "rbt" = "$zonedb"; then
|
||||
echo " Default zone database type: $zonedb"
|
||||
fi
|
||||
if test "yes" = "$enable_full_report" -o "rbt" = "$zonedb"; then
|
||||
echo " Default cache database type: $cachedb"
|
||||
fi
|
||||
if test "yes" = "$enable_full_report" -o "standard" = "$with_locktype"; then
|
||||
echo " Mutex lock type: $with_locktype"
|
||||
fi
|
||||
|
@ -62,8 +62,13 @@ Feature Changes
|
||||
A side effect of this change is that zone files that are created with
|
||||
:any:`masterfile-style` ``relative`` - for example, the output of
|
||||
:any:`dnssec-signzone` - will no longer have multiple different
|
||||
`$ORIGIN` statements. There should be no other behavior changes to
|
||||
server behavior. :gl:`#4411`.
|
||||
`$ORIGIN` statements. There should be no other changes to server
|
||||
behavior.
|
||||
|
||||
The old RBT-based database still exists for now, and can be used by
|
||||
specifying ``database rbt`` in a ``zone`` statement in ``named.conf``,
|
||||
or by compiling with ``configure --with-zonedb=rbt --with-cachedb=rbt``.
|
||||
:gl:`#4411`.
|
||||
|
||||
Bug Fixes
|
||||
~~~~~~~~~
|
||||
|
@ -49,8 +49,9 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
dns_db_t *db = NULL;
|
||||
|
||||
isc_mem_create(&mctx);
|
||||
result = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_zone, dns_rdataclass_in, 0, NULL,
|
||||
&db);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ cache_create_db(dns_cache_t *cache, dns_db_t **db) {
|
||||
* dns_db_create() via argv[0].
|
||||
*/
|
||||
argv[0] = (char *)cache->hmctx;
|
||||
result = dns_db_create(cache->mctx, "qp", dns_rootname,
|
||||
result = dns_db_create(cache->mctx, CACHEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_cache, cache->rdclass, 1, argv, db);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
dns_db_setservestalettl(*db, cache->serve_stale_ttl);
|
||||
|
@ -216,8 +216,9 @@ createview(isc_mem_t *mctx, dns_rdataclass_t rdclass, isc_loopmgr_t *loopmgr,
|
||||
|
||||
CHECK(dns_view_createresolver(view, loopmgr, nm, 0, tlsctx_client_cache,
|
||||
dispatchv4, dispatchv6));
|
||||
CHECK(dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_cache, rdclass,
|
||||
0, NULL, &view->cachedb));
|
||||
CHECK(dns_db_create(mctx, CACHEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_cache, rdclass, 0, NULL,
|
||||
&view->cachedb));
|
||||
|
||||
*viewp = view;
|
||||
return (ISC_R_SUCCESS);
|
||||
|
@ -238,8 +238,8 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
|
||||
|
||||
REQUIRE(target != NULL && *target == NULL);
|
||||
|
||||
result = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_zone,
|
||||
rdclass, 0, NULL, &db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_zone, rdclass, 0, NULL, &db);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto failure;
|
||||
}
|
||||
|
@ -297,11 +297,8 @@ static isc_result_t
|
||||
axfr_makedb(dns_xfrin_t *xfr, dns_db_t **dbp) {
|
||||
isc_result_t result;
|
||||
|
||||
result = dns_db_create(xfr->mctx, /* XXX */
|
||||
"qp", /* XXX guess */
|
||||
&xfr->name, dns_dbtype_zone, xfr->rdclass, 0,
|
||||
NULL, /* XXX guess */
|
||||
dbp);
|
||||
result = dns_db_create(xfr->mctx, ZONEDB_DEFAULT, &xfr->name,
|
||||
dns_dbtype_zone, xfr->rdclass, 0, NULL, dbp);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
dns_zone_rpz_enable_db(xfr->zone, *dbp);
|
||||
dns_zone_catz_enable_db(xfr->zone, *dbp);
|
||||
|
@ -1006,7 +1006,7 @@ zmgr_tlsctx_attach(dns_zonemgr_t *zmgr, isc_tlsctx_cache_t **ptlsctx_cache);
|
||||
#define ENTER zone_debuglog(zone, __func__, 1, "enter")
|
||||
|
||||
static const unsigned int dbargc_default = 1;
|
||||
static const char *dbargv_default[] = { "qp" };
|
||||
static const char *dbargv_default[] = { ZONEDB_DEFAULT };
|
||||
|
||||
#define DNS_ZONE_JITTER_ADD(a, b, c) \
|
||||
do { \
|
||||
@ -2118,7 +2118,7 @@ zone_load(dns_zone_t *zone, unsigned int flags, bool locked) {
|
||||
|
||||
INSIST(zone->db_argc >= 1);
|
||||
|
||||
rbt = strcmp(zone->db_argv[0], "qp") == 0;
|
||||
rbt = strcmp(zone->db_argv[0], ZONEDB_DEFAULT) == 0;
|
||||
|
||||
if (zone->db != NULL && zone->masterfile == NULL && rbt) {
|
||||
/*
|
||||
@ -11324,7 +11324,7 @@ zone_expire(dns_zone_t *zone) {
|
||||
isc_result_t result;
|
||||
dns_rpz_zone_t *rpz = zone->rpzs->zones[zone->rpz_num];
|
||||
|
||||
CHECK(dns_db_create(zone->mctx, "qp", &zone->origin,
|
||||
CHECK(dns_db_create(zone->mctx, ZONEDB_DEFAULT, &zone->origin,
|
||||
dns_dbtype_zone, zone->rdclass, 0, NULL,
|
||||
&db));
|
||||
CHECK(dns_rpz_dbupdate_callback(db, rpz));
|
||||
|
@ -3986,9 +3986,10 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
||||
"and 'database'",
|
||||
znamestr);
|
||||
result = ISC_R_FAILURE;
|
||||
} else if (!dlz && (tresult == ISC_R_NOTFOUND ||
|
||||
(tresult == ISC_R_SUCCESS &&
|
||||
strcmp("qp", cfg_obj_asstring(obj)) == 0)))
|
||||
} else if (!dlz &&
|
||||
(tresult == ISC_R_NOTFOUND ||
|
||||
(tresult == ISC_R_SUCCESS &&
|
||||
strcmp(ZONEDB_DEFAULT, cfg_obj_asstring(obj)) == 0)))
|
||||
{
|
||||
isc_result_t res1;
|
||||
const cfg_obj_t *fileobj = NULL;
|
||||
|
@ -46,8 +46,9 @@ ISC_RUN_TEST_IMPL(getoriginnode) {
|
||||
|
||||
UNUSED(state);
|
||||
|
||||
result = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_zone, dns_rdataclass_in, 0, NULL,
|
||||
&db);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_db_getoriginnode(db, &node);
|
||||
@ -69,8 +70,9 @@ ISC_RUN_TEST_IMPL(getsetservestalettl) {
|
||||
|
||||
UNUSED(state);
|
||||
|
||||
result = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_cache,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
result = dns_db_create(mctx, CACHEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_cache, dns_rdataclass_in, 0, NULL,
|
||||
&db);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
ttl = 5000;
|
||||
@ -107,8 +109,9 @@ ISC_RUN_TEST_IMPL(dns_dbfind_staleok) {
|
||||
|
||||
UNUSED(state);
|
||||
|
||||
result = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_cache,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
result = dns_db_create(mctx, CACHEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_cache, dns_rdataclass_in, 0, NULL,
|
||||
&db);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
example = dns_fixedname_initname(&example_fixed);
|
||||
@ -249,8 +252,9 @@ ISC_RUN_TEST_IMPL(class) {
|
||||
|
||||
UNUSED(state);
|
||||
|
||||
result = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_zone, dns_rdataclass_in, 0, NULL,
|
||||
&db);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_db_load(db, TESTS_DIR "/testdata/db/data.db",
|
||||
@ -270,8 +274,9 @@ ISC_RUN_TEST_IMPL(dbtype) {
|
||||
UNUSED(state);
|
||||
|
||||
/* DB has zone semantics */
|
||||
result = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_zone, dns_rdataclass_in, 0, NULL,
|
||||
&db);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
result = dns_db_load(db, TESTS_DIR "/testdata/db/data.db",
|
||||
dns_masterformat_text, 0);
|
||||
@ -281,14 +286,12 @@ ISC_RUN_TEST_IMPL(dbtype) {
|
||||
dns_db_detach(&db);
|
||||
|
||||
/* DB has cache semantics */
|
||||
result = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
result = dns_db_create(mctx, CACHEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_cache, dns_rdataclass_in, 0, NULL,
|
||||
&db);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
result = dns_db_load(db, TESTS_DIR "/testdata/db/data.db",
|
||||
dns_masterformat_text, 0);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
assert_false(dns_db_iscache(db));
|
||||
assert_true(dns_db_iszone(db));
|
||||
assert_true(dns_db_iscache(db));
|
||||
assert_false(dns_db_iszone(db));
|
||||
dns_db_detach(&db);
|
||||
}
|
||||
|
||||
|
@ -78,13 +78,13 @@ setup_test(void **state) {
|
||||
|
||||
isc_assertion_setcallback(local_callback);
|
||||
|
||||
res = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_zone,
|
||||
res = dns_db_create(mctx, ZONEDB_DEFAULT, dns_rootname, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, &db1);
|
||||
assert_int_equal(res, ISC_R_SUCCESS);
|
||||
dns_db_newversion(db1, &v1);
|
||||
assert_non_null(v1);
|
||||
|
||||
res = dns_db_create(mctx, "qp", dns_rootname, dns_dbtype_zone,
|
||||
res = dns_db_create(mctx, ZONEDB_DEFAULT, dns_rootname, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, &db2);
|
||||
assert_int_equal(res, ISC_R_SUCCESS);
|
||||
dns_db_newversion(db2, &v2);
|
||||
|
@ -472,8 +472,9 @@ ISC_RUN_TEST_IMPL(dumpraw) {
|
||||
&target);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_db_create(mctx, "qp", &dnsorigin, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
result = dns_db_create(mctx, ZONEDB_DEFAULT, &dnsorigin,
|
||||
dns_dbtype_zone, dns_rdataclass_in, 0, NULL,
|
||||
&db);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_dir_chdir(SRCDIR);
|
||||
|
@ -293,8 +293,9 @@ ISC_RUN_TEST_IMPL(overmempurge_bigrdata) {
|
||||
|
||||
isc_mem_create(&mctx2);
|
||||
|
||||
result = dns_db_create(mctx2, "qp", dns_rootname, dns_dbtype_cache,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
result = dns_db_create(mctx2, CACHEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_cache, dns_rdataclass_in, 0, NULL,
|
||||
&db);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_mem_setwater(mctx2, hiwater, lowater);
|
||||
@ -337,8 +338,9 @@ ISC_RUN_TEST_IMPL(overmempurge_longname) {
|
||||
|
||||
isc_mem_create(&mctx2);
|
||||
|
||||
result = dns_db_create(mctx2, "qp", dns_rootname, dns_dbtype_cache,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
result = dns_db_create(mctx2, CACHEDB_DEFAULT, dns_rootname,
|
||||
dns_dbtype_cache, dns_rdataclass_in, 0, NULL,
|
||||
&db);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_mem_setwater(mctx2, hiwater, lowater);
|
||||
|
@ -213,7 +213,9 @@ dns_test_loaddb(dns_db_t **db, dns_dbtype_t dbtype, const char *origin,
|
||||
const char *testfile) {
|
||||
isc_result_t result;
|
||||
dns_fixedname_t fixed;
|
||||
dns_name_t *name;
|
||||
dns_name_t *name = NULL;
|
||||
const char *dbimp = (dbtype == dns_dbtype_zone) ? ZONEDB_DEFAULT
|
||||
: CACHEDB_DEFAULT;
|
||||
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
|
||||
@ -222,7 +224,7 @@ dns_test_loaddb(dns_db_t **db, dns_dbtype_t dbtype, const char *origin,
|
||||
return (result);
|
||||
}
|
||||
|
||||
result = dns_db_create(mctx, "qp", name, dbtype, dns_rdataclass_in, 0,
|
||||
result = dns_db_create(mctx, dbimp, name, dbtype, dns_rdataclass_in, 0,
|
||||
NULL, db);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
|
@ -530,7 +530,9 @@ ns_test_loaddb(dns_db_t **db, dns_dbtype_t dbtype, const char *origin,
|
||||
const char *testfile) {
|
||||
isc_result_t result;
|
||||
dns_fixedname_t fixed;
|
||||
dns_name_t *name;
|
||||
dns_name_t *name = NULL;
|
||||
const char *dbimp = (dbtype == dns_dbtype_zone) ? ZONEDB_DEFAULT
|
||||
: CACHEDB_DEFAULT;
|
||||
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
|
||||
@ -539,7 +541,7 @@ ns_test_loaddb(dns_db_t **db, dns_dbtype_t dbtype, const char *origin,
|
||||
return (result);
|
||||
}
|
||||
|
||||
result = dns_db_create(mctx, "qp", name, dbtype, dns_rdataclass_in, 0,
|
||||
result = dns_db_create(mctx, dbimp, name, dbtype, dns_rdataclass_in, 0,
|
||||
NULL, db);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
|
Loading…
x
Reference in New Issue
Block a user