af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews/*
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2011, 2012, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews *
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews */
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
28a8f5b0de57d269cf2845c69cb6abe18cbd3b3aMark Andrews/* $Id$ */
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews/*! \file */
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <config.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <atf-c.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
e236b52ce069b9cfc9da991e3a52538e22b177fdMark Andrews#include <stdlib.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <time.h>
e236b52ce069b9cfc9da991e3a52538e22b177fdMark Andrews#include <unistd.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <isc/file.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <isc/result.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <isc/serial.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <isc/stdtime.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <isc/msgcat.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <dns/db.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <dns/rdatalist.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <dns/rdataset.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <dns/rdatasetiter.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include <dns/nsec3.h>
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#include "dnstest.h"
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic char tempname[11] = "dtXXXXXXXX";
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Huntlocal_callback(const char *file, int line, isc_assertiontype_t type,
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt const char *cond)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews{
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(file); UNUSED(line); UNUSED(type); UNUSED(cond);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (strcmp(tempname, "dtXXXXXXXX"))
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews unlink(tempname);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_pass();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews exit(0);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic dns_db_t *db1 = NULL, *db2 = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic dns_dbversion_t *v1 = NULL, *v2 = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
b454c0319685041db3f3e8fd7671e1b364fd20c5Evan Huntsetup_db(void) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_zone,
304a539c5966697827f2a021303e634aee98503dAutomatic Updater dns_rdataclass_in, 0, NULL, &db1);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_newversion(db1, &v1);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_zone,
304a539c5966697827f2a021303e634aee98503dAutomatic Updater dns_rdataclass_in, 0, NULL, &db2);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_newversion(db2, &v2);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
b454c0319685041db3f3e8fd7671e1b364fd20c5Evan Huntclose_db(void) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (v1 != NULL) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_closeversion(db1, &v1, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(v1, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews }
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (db1 != NULL) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_detach(&db1);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(db1, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews }
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (v2 != NULL) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_closeversion(db2, &v2, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(v2, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews }
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (db2 != NULL) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_detach(&db2);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(db2, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews }
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#define VERSION(callback) ((callback == NULL) ? v1 : v2)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews#define VERSIONP(callback) ((callback == NULL) ? &v1 : &v2)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews/*
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews * Individual unit tests
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews */
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsattachversion(isc_assertioncallback_t callback) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_dbversion_t *v = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_test_begin(NULL, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
304a539c5966697827f2a021303e634aee98503dAutomatic Updater
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews setup_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_assertion_setcallback(callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_attachversion(db1, VERSION(callback), &v);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (callback != NULL)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_fail("dns_db_attachversion did not assert");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(v, v1);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_closeversion(db1, &v, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(v, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews close_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_test_end();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(attachversion);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(attachversion, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_attachversion passes with matching db/verison");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(attachversion, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
304a539c5966697827f2a021303e634aee98503dAutomatic Updater
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews attachversion(NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(attachversion_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(attachversion_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_attachversion aborts with mis-matching db/verison");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(attachversion_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt attachversion(local_callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewscloseversion(isc_assertioncallback_t callback) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_test_begin(NULL, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
304a539c5966697827f2a021303e634aee98503dAutomatic Updater
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews setup_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_assertion_setcallback(callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_closeversion(db1, VERSIONP(callback), ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (callback != NULL)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_fail("dns_db_closeversion did not assert");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(v1, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews close_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_test_end();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(closeversion);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(closeversion, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_closeversion passes with matching db/verison");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(closeversion, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews closeversion(NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(closeversion_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(closeversion_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_closeversion asserts with mis-matching db/verison");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(closeversion_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt closeversion(local_callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsfind(isc_assertioncallback_t callback) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_t rdataset;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_fixedname_t fixed;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_test_begin(NULL, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews setup_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_init(&rdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_fixedname_init(&fixed);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_assertion_setcallback(callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_find(db1, dns_rootname, VERSION(callback),
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatatype_soa, 0, 0, NULL,
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_fixedname_name(&fixed), &rdataset, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (callback != NULL)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_fail("dns_db_find did not assert");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, DNS_R_NXDOMAIN);
304a539c5966697827f2a021303e634aee98503dAutomatic Updater
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews close_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_test_end();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(find);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(find, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_find passes with matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(find, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews find(NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(find_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(find_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_find asserts with mis-matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(find_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt find(local_callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsallrdatasets(isc_assertioncallback_t callback) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_dbnode_t *node = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatasetiter_t *iterator = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_test_begin(NULL, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews setup_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_findnode(db1, dns_rootname, ISC_FALSE, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_assertion_setcallback(callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_allrdatasets(db1, node, VERSION(callback), 0,
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews &iterator);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (callback != NULL)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_fail("dns_db_allrdatasets did not assert");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatasetiter_destroy(&iterator);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(iterator, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_detachnode(db1, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(node, NULL);
304a539c5966697827f2a021303e634aee98503dAutomatic Updater
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews close_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_test_end();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(allrdatasets);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(allrdatasets, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_allrdatasets passes with matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(allrdatasets, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews allrdatasets(NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(allrdatasets_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(allrdatasets_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_allrdatasets aborts with mis-matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(allrdatasets_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt allrdatasets(local_callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsfindrdataset(isc_assertioncallback_t callback) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_t rdataset;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_fixedname_t fixed;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_dbnode_t *node = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_test_begin(NULL, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews setup_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_init(&rdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_fixedname_init(&fixed);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_findnode(db1, dns_rootname, ISC_FALSE, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_assertion_setcallback(callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_findrdataset(db1, node, VERSION(callback),
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatatype_soa, 0, 0, &rdataset, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (callback != NULL)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_fail("dns_db_findrdataset did not assert");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_NOTFOUND);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_detachnode(db1, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(node, NULL);
304a539c5966697827f2a021303e634aee98503dAutomatic Updater
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews close_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_test_end();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(findrdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(findrdataset, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_findrdataset passes with matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(findrdataset, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews findrdataset(NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(findrdataset_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(findrdataset_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_findrdataset aborts with mis-matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(findrdataset_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt findrdataset(local_callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsdeleterdataset(isc_assertioncallback_t callback) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_t rdataset;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_fixedname_t fixed;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_dbnode_t *node = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_test_begin(NULL, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews setup_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_init(&rdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_fixedname_init(&fixed);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_findnode(db1, dns_rootname, ISC_FALSE, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_assertion_setcallback(callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_deleterdataset(db1, node, VERSION(callback),
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatatype_soa, 0);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (callback != NULL)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_fail("dns_db_deleterdataset did not assert");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, DNS_R_UNCHANGED);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_detachnode(db1, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(node, NULL);
304a539c5966697827f2a021303e634aee98503dAutomatic Updater
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews close_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_test_end();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(deleterdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(deleterdataset, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_deleterdataset passes with matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(deleterdataset, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews deleterdataset(NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(deleterdataset_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(deleterdataset_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_deleterdataset aborts with mis-matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(deleterdataset_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt deleterdataset(local_callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewssubtract(isc_assertioncallback_t callback) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_t rdataset;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_fixedname_t fixed;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_dbnode_t *node = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatalist_t rdatalist;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_test_begin(NULL, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews setup_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_init(&rdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatalist_init(&rdatalist);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_fixedname_init(&fixed);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rdatalist.rdclass = dns_rdataclass_in;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_rdatalist_tordataset(&rdatalist, &rdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_findnode(db1, dns_rootname, ISC_FALSE, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_assertion_setcallback(callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_subtractrdataset(db1, node, VERSION(callback),
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews &rdataset, 0, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (callback != NULL)
702e9f43bc893f1ba687fd376e84afccb9b6a314Evan Hunt atf_tc_fail("dns_db_subtractrdataset did not assert");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, DNS_R_UNCHANGED);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_detachnode(db1, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(node, NULL);
304a539c5966697827f2a021303e634aee98503dAutomatic Updater
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews close_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_test_end();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(subtractrdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(subtractrdataset, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_subtractrdataset passes with matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(subtractrdataset, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
304a539c5966697827f2a021303e634aee98503dAutomatic Updater
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews subtract(NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(subtractrdataset_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(subtractrdataset_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_subtractrdataset aborts with mis-matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(subtractrdataset_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt subtract(local_callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsdump(isc_assertioncallback_t callback) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews FILE *f = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_test_begin(NULL, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews setup_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = isc_file_openunique(tempname, &f);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews fclose(f);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_assertion_setcallback(callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_dump(db1, VERSION(callback), tempname);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews (void)unlink(tempname);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (callback != NULL)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_fail("dns_db_dump did not assert");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews close_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_test_end();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(dump);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(dump, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_dump passes with matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(dump, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dump(NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(dump_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(dump_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_dump aborts with mis-matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(dump_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt dump(local_callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsaddrdataset(isc_assertioncallback_t callback) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_t rdataset;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_fixedname_t fixed;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_dbnode_t *node = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatalist_t rdatalist;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_test_begin(NULL, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews setup_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_init(&rdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatalist_init(&rdatalist);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_fixedname_init(&fixed);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rdatalist.rdclass = dns_rdataclass_in;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_rdatalist_tordataset(&rdatalist, &rdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_findnode(db1, dns_rootname, ISC_FALSE, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_assertion_setcallback(callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_addrdataset(db1, node, VERSION(callback), 0, &rdataset,
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews 0, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (callback != NULL)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_fail("dns_db_adddataset did not assert");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_detachnode(db1, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(node, NULL);
304a539c5966697827f2a021303e634aee98503dAutomatic Updater
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews close_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_test_end();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(addrdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(addrdataset, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_addrdataset passes with matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(addrdataset, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews addrdataset(NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(addrdataset_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(addrdataset_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_addrdataset aborts with mis-matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(addrdataset_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt addrdataset(local_callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsgetnsec3parameters(isc_assertioncallback_t callback) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_hash_t hash;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_uint8_t flags;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_uint16_t iterations;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews unsigned char salt[DNS_NSEC3_SALTSIZE];
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews size_t salt_length = sizeof(salt);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_test_begin(NULL, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews setup_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_assertion_setcallback(callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_getnsec3parameters(db1, VERSION(callback), &hash,
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews &flags, &iterations, salt,
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews &salt_length);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (callback != NULL)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_fail("dns_db_dump did not assert");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_NOTFOUND);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews close_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_test_end();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(getnsec3parameters);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(getnsec3parameters, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_getnsec3parameters passes with matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(getnsec3parameters, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews getnsec3parameters(NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(getnsec3parameters_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(getnsec3parameters_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_db_getnsec3parameters aborts with mis-matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(getnsec3parameters_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt getnsec3parameters(local_callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsstatic void
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrewsresigned(isc_assertioncallback_t callback) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_result_t result;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_t rdataset, added;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_dbnode_t *node = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatalist_t rdatalist;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdata_rrsig_t rrsig;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdata_t rdata = DNS_RDATA_INIT;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_buffer_t b;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews unsigned char buf[1024];
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_test_begin(NULL, ISC_FALSE);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews setup_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews /*
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews * Create a dummy RRSIG record and set a resigning time.
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews */
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_init(&added);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_init(&rdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatalist_init(&rdatalist);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_buffer_init(&b, buf, sizeof(buf));
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews DNS_RDATACOMMON_INIT(&rrsig, dns_rdatatype_rrsig, dns_rdataclass_in);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rrsig.covered = dns_rdatatype_a;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rrsig.algorithm = 100;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rrsig.labels = 0;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rrsig.originalttl = 0;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rrsig.timeexpire = 3600;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rrsig.timesigned = 0;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rrsig.keyid = 0;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_name_init(&rrsig.signer, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_name_clone(dns_rootname, &rrsig.signer);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rrsig.siglen = 0;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rrsig.signature = NULL;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_rdata_fromstruct(&rdata, dns_rdataclass_in,
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdatatype_rrsig, &rrsig, &b);
63b6eac79c78081fe35c69e0ee019a857304c964Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rdatalist.rdclass = dns_rdataclass_in;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rdatalist.type = dns_rdatatype_rrsig;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ISC_LIST_APPEND(rdatalist.rdata, &rdata, link);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_rdatalist_tordataset(&rdatalist, &rdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rdataset.attributes |= DNS_RDATASETATTR_RESIGN;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rdataset.resign = 7200;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_findnode(db1, dns_rootname, ISC_FALSE, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews result = dns_db_addrdataset(db1, node, v1, 0, &rdataset, 0, &added);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_detachnode(db1, &node);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_REQUIRE_EQ(node, NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews isc_assertion_setcallback(callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_db_resigned(db1, &added, VERSION(callback));
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews if (callback != NULL)
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_fail("dns_db_resigned did not assert");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_rdataset_disassociate(&added);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews close_db();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews dns_test_end();
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(resigned);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(resigned, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_rdataset_resigned passes with matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(resigned, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews resigned(NULL);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC(resigned_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_HEAD(resigned_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews atf_tc_set_md_var(tc, "descr", "check dns_rdataset_resigned aborts with mis-matching db/version");
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TC_BODY(resigned_bad, tc) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews UNUSED(tc);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt resigned(local_callback);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews/*
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews * Main
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews */
af850c4120c5bee9462de4def85d0b4c1b583963Mark AndrewsATF_TP_ADD_TCS(tp) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, dump);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, dump_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, find);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, find_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, allrdatasets);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, allrdatasets_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, findrdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, findrdataset_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, addrdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, addrdataset_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, deleterdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, deleterdataset_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, subtractrdataset);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, subtractrdataset_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, attachversion);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, attachversion_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, closeversion);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, closeversion_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, getnsec3parameters);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, getnsec3parameters_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, resigned);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews ATF_TP_ADD_TC(tp, resigned_bad);
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews return (atf_no_error());
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews}