#include <config.h>
#include <atf-c.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <isc/file.h>
#include <isc/result.h>
#include <isc/serial.h>
#include <isc/stdtime.h>
#include <isc/msgcat.h>
#include <dns/db.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include <dns/rdatasetiter.h>
#include <dns/nsec3.h>
#include "dnstest.h"
Go to the source code of this file.
Defines | |
#define | VERSION(callback) ((callback == NULL) ? v1 : v2) |
#define | VERSIONP(callback) ((callback == NULL) ? &v1 : &v2) |
Functions | |
static void | local_callback (const char *file, int line, isc_assertiontype_t type, const char *cond) |
static void | setup_db (void) |
static void | close_db (void) |
static void | attachversion (isc_assertioncallback_t callback) |
ATF_TC (attachversion) | |
ATF_TC_HEAD (attachversion, tc) | |
ATF_TC_BODY (attachversion, tc) | |
ATF_TC (attachversion_bad) | |
ATF_TC_HEAD (attachversion_bad, tc) | |
ATF_TC_BODY (attachversion_bad, tc) | |
static void | closeversion (isc_assertioncallback_t callback) |
ATF_TC (closeversion) | |
ATF_TC_HEAD (closeversion, tc) | |
ATF_TC_BODY (closeversion, tc) | |
ATF_TC (closeversion_bad) | |
ATF_TC_HEAD (closeversion_bad, tc) | |
ATF_TC_BODY (closeversion_bad, tc) | |
static void | find (isc_assertioncallback_t callback) |
ATF_TC (find) | |
ATF_TC_HEAD (find, tc) | |
ATF_TC_BODY (find, tc) | |
ATF_TC (find_bad) | |
ATF_TC_HEAD (find_bad, tc) | |
ATF_TC_BODY (find_bad, tc) | |
static void | allrdatasets (isc_assertioncallback_t callback) |
ATF_TC (allrdatasets) | |
ATF_TC_HEAD (allrdatasets, tc) | |
ATF_TC_BODY (allrdatasets, tc) | |
ATF_TC (allrdatasets_bad) | |
ATF_TC_HEAD (allrdatasets_bad, tc) | |
ATF_TC_BODY (allrdatasets_bad, tc) | |
static void | findrdataset (isc_assertioncallback_t callback) |
ATF_TC (findrdataset) | |
ATF_TC_HEAD (findrdataset, tc) | |
ATF_TC_BODY (findrdataset, tc) | |
ATF_TC (findrdataset_bad) | |
ATF_TC_HEAD (findrdataset_bad, tc) | |
ATF_TC_BODY (findrdataset_bad, tc) | |
static void | deleterdataset (isc_assertioncallback_t callback) |
ATF_TC (deleterdataset) | |
ATF_TC_HEAD (deleterdataset, tc) | |
ATF_TC_BODY (deleterdataset, tc) | |
ATF_TC (deleterdataset_bad) | |
ATF_TC_HEAD (deleterdataset_bad, tc) | |
ATF_TC_BODY (deleterdataset_bad, tc) | |
static void | subtract (isc_assertioncallback_t callback) |
ATF_TC (subtractrdataset) | |
ATF_TC_HEAD (subtractrdataset, tc) | |
ATF_TC_BODY (subtractrdataset, tc) | |
ATF_TC (subtractrdataset_bad) | |
ATF_TC_HEAD (subtractrdataset_bad, tc) | |
ATF_TC_BODY (subtractrdataset_bad, tc) | |
static void | dump (isc_assertioncallback_t callback) |
ATF_TC (dump) | |
ATF_TC_HEAD (dump, tc) | |
ATF_TC_BODY (dump, tc) | |
ATF_TC (dump_bad) | |
ATF_TC_HEAD (dump_bad, tc) | |
ATF_TC_BODY (dump_bad, tc) | |
static void | addrdataset (isc_assertioncallback_t callback) |
ATF_TC (addrdataset) | |
ATF_TC_HEAD (addrdataset, tc) | |
ATF_TC_BODY (addrdataset, tc) | |
ATF_TC (addrdataset_bad) | |
ATF_TC_HEAD (addrdataset_bad, tc) | |
ATF_TC_BODY (addrdataset_bad, tc) | |
static void | getnsec3parameters (isc_assertioncallback_t callback) |
ATF_TC (getnsec3parameters) | |
ATF_TC_HEAD (getnsec3parameters, tc) | |
ATF_TC_BODY (getnsec3parameters, tc) | |
ATF_TC (getnsec3parameters_bad) | |
ATF_TC_HEAD (getnsec3parameters_bad, tc) | |
ATF_TC_BODY (getnsec3parameters_bad, tc) | |
static void | resigned (isc_assertioncallback_t callback) |
ATF_TC (resigned) | |
ATF_TC_HEAD (resigned, tc) | |
ATF_TC_BODY (resigned, tc) | |
ATF_TC (resigned_bad) | |
ATF_TC_HEAD (resigned_bad, tc) | |
ATF_TC_BODY (resigned_bad, tc) | |
ATF_TP_ADD_TCS (tp) | |
Variables | |
static char | tempname [11] = "dtXXXXXXXX" |
static dns_db_t * | db1 = NULL |
static dns_db_t * | db2 = NULL |
static dns_dbversion_t * | v1 = NULL |
static dns_dbversion_t * | v2 = NULL |
Definition in file dbversion_test.c.
Definition at line 94 of file dbversion_test.c.
Referenced by addrdataset(), allrdatasets(), attachversion(), deleterdataset(), do_next_command(), dump(), find(), findrdataset(), getnsec3parameters(), main(), print_version(), printgreeting(), resigned(), subtract(), usage(), and version().
static void local_callback | ( | const char * | file, | |
int | line, | |||
isc_assertiontype_t | type, | |||
const char * | cond | |||
) | [static] |
Definition at line 46 of file dbversion_test.c.
References tempname, and UNUSED.
Referenced by ATF_TC_BODY().
static void setup_db | ( | void | ) | [static] |
Definition at line 60 of file dbversion_test.c.
References db2, dns_db_create(), dns_db_newversion(), dns_dbtype_zone, dns_rootname, ISC_R_SUCCESS, mctx, v1, and v2.
Referenced by addrdataset(), allrdatasets(), attachversion(), closeversion(), deleterdataset(), dump(), find(), findrdataset(), getnsec3parameters(), resigned(), and subtract().
static void close_db | ( | void | ) | [static] |
Definition at line 74 of file dbversion_test.c.
References db2, dns_db_closeversion(), dns_db_detach(), ISC_FALSE, v1, and v2.
Referenced by addrdataset(), allrdatasets(), attachversion(), closeversion(), deleterdataset(), dump(), find(), findrdataset(), getnsec3parameters(), resigned(), and subtract().
static void attachversion | ( | isc_assertioncallback_t | callback | ) | [static] |
Definition at line 100 of file dbversion_test.c.
References close_db(), dns_db_attachversion(), dns_db_closeversion(), dns_test_begin(), dns_test_end(), isc_assertion_setcallback(), ISC_FALSE, ISC_R_SUCCESS, setup_db(), v1, and VERSION.
ATF_TC | ( | attachversion | ) |
ATF_TC_HEAD | ( | attachversion | , | |
tc | ||||
) |
Definition at line 123 of file dbversion_test.c.
ATF_TC_BODY | ( | attachversion | , | |
tc | ||||
) |
ATF_TC | ( | attachversion_bad | ) |
ATF_TC_HEAD | ( | attachversion_bad | , | |
tc | ||||
) |
Definition at line 134 of file dbversion_test.c.
ATF_TC_BODY | ( | attachversion_bad | , | |
tc | ||||
) |
Definition at line 137 of file dbversion_test.c.
References attachversion(), local_callback(), and UNUSED.
static void closeversion | ( | isc_assertioncallback_t | callback | ) | [static] |
Definition at line 145 of file dbversion_test.c.
References close_db(), dns_db_closeversion(), dns_test_begin(), dns_test_end(), isc_assertion_setcallback(), ISC_FALSE, ISC_R_SUCCESS, setup_db(), v1, and VERSIONP.
ATF_TC | ( | closeversion | ) |
ATF_TC_HEAD | ( | closeversion | , | |
tc | ||||
) |
Definition at line 164 of file dbversion_test.c.
ATF_TC_BODY | ( | closeversion | , | |
tc | ||||
) |
ATF_TC | ( | closeversion_bad | ) |
ATF_TC_HEAD | ( | closeversion_bad | , | |
tc | ||||
) |
Definition at line 175 of file dbversion_test.c.
ATF_TC_BODY | ( | closeversion_bad | , | |
tc | ||||
) |
Definition at line 178 of file dbversion_test.c.
References closeversion(), local_callback(), and UNUSED.
static void find | ( | isc_assertioncallback_t | callback | ) | [static] |
Definition at line 186 of file dbversion_test.c.
References close_db(), dns_db_find(), dns_fixedname_init, dns_fixedname_name, DNS_R_NXDOMAIN, dns_rdataset_init(), dns_rootname, dns_test_begin(), dns_test_end(), fixed, isc_assertion_setcallback(), ISC_FALSE, ISC_R_SUCCESS, setup_db(), and VERSION.
ATF_TC | ( | find | ) |
ATF_TC_HEAD | ( | find | , | |
tc | ||||
) |
Definition at line 212 of file dbversion_test.c.
ATF_TC_BODY | ( | find | , | |
tc | ||||
) |
ATF_TC | ( | find_bad | ) |
ATF_TC_HEAD | ( | find_bad | , | |
tc | ||||
) |
Definition at line 223 of file dbversion_test.c.
ATF_TC_BODY | ( | find_bad | , | |
tc | ||||
) |
static void allrdatasets | ( | isc_assertioncallback_t | callback | ) | [static] |
Definition at line 234 of file dbversion_test.c.
References close_db(), dns_db_allrdatasets(), dns_db_detachnode(), dns_db_findnode(), dns_rdatasetiter_destroy(), dns_rootname, dns_test_begin(), dns_test_end(), isc_assertion_setcallback(), ISC_FALSE, ISC_R_SUCCESS, setup_db(), and VERSION.
ATF_TC | ( | allrdatasets | ) |
ATF_TC_HEAD | ( | allrdatasets | , | |
tc | ||||
) |
Definition at line 266 of file dbversion_test.c.
ATF_TC_BODY | ( | allrdatasets | , | |
tc | ||||
) |
ATF_TC | ( | allrdatasets_bad | ) |
ATF_TC_HEAD | ( | allrdatasets_bad | , | |
tc | ||||
) |
Definition at line 277 of file dbversion_test.c.
ATF_TC_BODY | ( | allrdatasets_bad | , | |
tc | ||||
) |
Definition at line 280 of file dbversion_test.c.
References allrdatasets(), local_callback(), and UNUSED.
static void findrdataset | ( | isc_assertioncallback_t | callback | ) | [static] |
Definition at line 288 of file dbversion_test.c.
References close_db(), dns_db_detachnode(), dns_db_findnode(), dns_db_findrdataset(), dns_fixedname_init, dns_rdataset_init(), dns_rootname, dns_test_begin(), dns_test_end(), fixed, isc_assertion_setcallback(), ISC_FALSE, ISC_R_NOTFOUND, ISC_R_SUCCESS, setup_db(), and VERSION.
ATF_TC | ( | findrdataset | ) |
ATF_TC_HEAD | ( | findrdataset | , | |
tc | ||||
) |
Definition at line 321 of file dbversion_test.c.
ATF_TC_BODY | ( | findrdataset | , | |
tc | ||||
) |
ATF_TC | ( | findrdataset_bad | ) |
ATF_TC_HEAD | ( | findrdataset_bad | , | |
tc | ||||
) |
Definition at line 332 of file dbversion_test.c.
ATF_TC_BODY | ( | findrdataset_bad | , | |
tc | ||||
) |
Definition at line 335 of file dbversion_test.c.
References findrdataset(), local_callback(), and UNUSED.
static void deleterdataset | ( | isc_assertioncallback_t | callback | ) | [static] |
Definition at line 343 of file dbversion_test.c.
References close_db(), dns_db_deleterdataset(), dns_db_detachnode(), dns_db_findnode(), dns_fixedname_init, DNS_R_UNCHANGED, dns_rdataset_init(), dns_rootname, dns_test_begin(), dns_test_end(), fixed, isc_assertion_setcallback(), ISC_FALSE, ISC_R_SUCCESS, setup_db(), and VERSION.
ATF_TC | ( | deleterdataset | ) |
ATF_TC_HEAD | ( | deleterdataset | , | |
tc | ||||
) |
Definition at line 376 of file dbversion_test.c.
ATF_TC_BODY | ( | deleterdataset | , | |
tc | ||||
) |
ATF_TC | ( | deleterdataset_bad | ) |
ATF_TC_HEAD | ( | deleterdataset_bad | , | |
tc | ||||
) |
Definition at line 387 of file dbversion_test.c.
ATF_TC_BODY | ( | deleterdataset_bad | , | |
tc | ||||
) |
Definition at line 390 of file dbversion_test.c.
References deleterdataset(), local_callback(), and UNUSED.
static void subtract | ( | isc_assertioncallback_t | callback | ) | [static] |
Definition at line 398 of file dbversion_test.c.
References close_db(), dns_db_detachnode(), dns_db_findnode(), dns_db_subtractrdataset(), dns_fixedname_init, DNS_R_UNCHANGED, dns_rdatalist_init(), dns_rdatalist_tordataset(), dns_rdataset_init(), dns_rootname, dns_test_begin(), dns_test_end(), fixed, isc_assertion_setcallback(), ISC_FALSE, ISC_R_SUCCESS, dns_rdatalist::rdclass, setup_db(), and VERSION.
Referenced by ATF_TC_BODY().
ATF_TC | ( | subtractrdataset | ) |
ATF_TC_HEAD | ( | subtractrdataset | , | |
tc | ||||
) |
Definition at line 438 of file dbversion_test.c.
ATF_TC_BODY | ( | subtractrdataset | , | |
tc | ||||
) |
ATF_TC | ( | subtractrdataset_bad | ) |
ATF_TC_HEAD | ( | subtractrdataset_bad | , | |
tc | ||||
) |
Definition at line 449 of file dbversion_test.c.
ATF_TC_BODY | ( | subtractrdataset_bad | , | |
tc | ||||
) |
Definition at line 452 of file dbversion_test.c.
References local_callback(), subtract(), and UNUSED.
static void dump | ( | isc_assertioncallback_t | callback | ) | [static] |
Definition at line 460 of file dbversion_test.c.
References close_db(), dns_db_dump(), dns_test_begin(), dns_test_end(), isc_assertion_setcallback(), ISC_FALSE, isc_file_openunique(), ISC_R_SUCCESS, setup_db(), tempname, and VERSION.
ATF_TC | ( | dump | ) |
ATF_TC_HEAD | ( | dump | , | |
tc | ||||
) |
Definition at line 486 of file dbversion_test.c.
ATF_TC_BODY | ( | dump | , | |
tc | ||||
) |
ATF_TC | ( | dump_bad | ) |
ATF_TC_HEAD | ( | dump_bad | , | |
tc | ||||
) |
Definition at line 497 of file dbversion_test.c.
ATF_TC_BODY | ( | dump_bad | , | |
tc | ||||
) |
static void addrdataset | ( | isc_assertioncallback_t | callback | ) | [static] |
Definition at line 508 of file dbversion_test.c.
References close_db(), dns_db_addrdataset(), dns_db_detachnode(), dns_db_findnode(), dns_fixedname_init, dns_rdatalist_init(), dns_rdatalist_tordataset(), dns_rdataset_init(), dns_rootname, dns_test_begin(), dns_test_end(), fixed, isc_assertion_setcallback(), ISC_FALSE, ISC_R_SUCCESS, dns_rdatalist::rdclass, setup_db(), and VERSION.
ATF_TC | ( | addrdataset | ) |
ATF_TC_HEAD | ( | addrdataset | , | |
tc | ||||
) |
Definition at line 548 of file dbversion_test.c.
ATF_TC_BODY | ( | addrdataset | , | |
tc | ||||
) |
ATF_TC | ( | addrdataset_bad | ) |
ATF_TC_HEAD | ( | addrdataset_bad | , | |
tc | ||||
) |
Definition at line 559 of file dbversion_test.c.
ATF_TC_BODY | ( | addrdataset_bad | , | |
tc | ||||
) |
Definition at line 562 of file dbversion_test.c.
References addrdataset(), local_callback(), and UNUSED.
static void getnsec3parameters | ( | isc_assertioncallback_t | callback | ) | [static] |
Definition at line 570 of file dbversion_test.c.
References close_db(), dns_db_getnsec3parameters(), DNS_NSEC3_SALTSIZE, dns_test_begin(), dns_test_end(), hash, isc_assertion_setcallback(), ISC_FALSE, ISC_R_NOTFOUND, ISC_R_SUCCESS, salt_length, setup_db(), and VERSION.
ATF_TC | ( | getnsec3parameters | ) |
ATF_TC_HEAD | ( | getnsec3parameters | , | |
tc | ||||
) |
Definition at line 597 of file dbversion_test.c.
ATF_TC_BODY | ( | getnsec3parameters | , | |
tc | ||||
) |
ATF_TC | ( | getnsec3parameters_bad | ) |
ATF_TC_HEAD | ( | getnsec3parameters_bad | , | |
tc | ||||
) |
Definition at line 608 of file dbversion_test.c.
ATF_TC_BODY | ( | getnsec3parameters_bad | , | |
tc | ||||
) |
Definition at line 611 of file dbversion_test.c.
References getnsec3parameters(), local_callback(), and UNUSED.
static void resigned | ( | isc_assertioncallback_t | callback | ) | [static] |
Definition at line 619 of file dbversion_test.c.
References dns_rdataset::attributes, close_db(), dns_db_addrdataset(), dns_db_detachnode(), dns_db_findnode(), dns_db_resigned(), dns_name_clone(), dns_name_init(), dns_rdata_fromstruct(), DNS_RDATA_INIT, dns_rdatalist_init(), dns_rdatalist_tordataset(), dns_rdataset_disassociate(), dns_rdataset_init(), DNS_RDATASETATTR_RESIGN, dns_rootname, dns_test_begin(), dns_test_end(), isc_assertion_setcallback(), isc_buffer_init, ISC_FALSE, ISC_LIST_APPEND, ISC_R_SUCCESS, dns_rdatalist::rdclass, dns_rdataset::resign, setup_db(), dns_rdatalist::type, v1, and VERSION.
ATF_TC | ( | resigned | ) |
ATF_TC_HEAD | ( | resigned | , | |
tc | ||||
) |
Definition at line 691 of file dbversion_test.c.
ATF_TC_BODY | ( | resigned | , | |
tc | ||||
) |
ATF_TC | ( | resigned_bad | ) |
ATF_TC_HEAD | ( | resigned_bad | , | |
tc | ||||
) |
Definition at line 702 of file dbversion_test.c.
ATF_TC_BODY | ( | resigned_bad | , | |
tc | ||||
) |
Definition at line 705 of file dbversion_test.c.
References local_callback(), resigned(), and UNUSED.
ATF_TP_ADD_TCS | ( | tp | ) |
Definition at line 715 of file dbversion_test.c.
References addrdataset(), allrdatasets(), attachversion(), closeversion(), deleterdataset(), dump(), find(), findrdataset(), getnsec3parameters(), resigned(), and subtractrdataset().
char tempname[11] = "dtXXXXXXXX" [static] |
Definition at line 43 of file dbversion_test.c.
Referenced by dns_master_dump3(), dns_master_dumpinc3(), dns_tkey_processdeleteresponse(), dns_tkey_processdhresponse(), dump(), local_callback(), notify_createmessage(), and opentmp().
Definition at line 56 of file dbversion_test.c.
dns_dbversion_t* v1 = NULL [static] |
Definition at line 57 of file dbversion_test.c.
Referenced by attachversion(), check_servers(), close_db(), closeversion(), resigned(), and setup_db().
dns_dbversion_t * v2 = NULL [static] |
Definition at line 57 of file dbversion_test.c.
Referenced by check_servers(), close_db(), and setup_db().