dnstest.c File Reference

#include <config.h>
#include <time.h>
#include <unistd.h>
#include <isc/app.h>
#include <isc/buffer.h>
#include <isc/entropy.h>
#include <isc/hash.h>
#include <isc/mem.h>
#include <isc/os.h>
#include <isc/string.h>
#include <isc/socket.h>
#include <isc/task.h>
#include <isc/timer.h>
#include <isc/util.h>
#include <dns/db.h>
#include <dns/fixedname.h>
#include <dns/log.h>
#include <dns/name.h>
#include <dns/result.h>
#include <dns/view.h>
#include <dns/zone.h>
#include "dnstest.h"

Go to the source code of this file.

Functions

static void cleanup_managers (void)
static isc_result_t create_managers (void)
isc_result_t dns_test_begin (FILE *logfile, isc_boolean_t start_managers)
void dns_test_end (void)
isc_result_t dns_test_makeview (const char *name, dns_view_t **viewp)
isc_result_t dns_test_makezone (const char *name, dns_zone_t **zonep, dns_view_t *view, isc_boolean_t keepview)
isc_result_t dns_test_setupzonemgr (void)
isc_result_t dns_test_managezone (dns_zone_t *zone)
void dns_test_releasezone (dns_zone_t *zone)
void dns_test_closezonemgr (void)
void dns_test_nap (isc_uint32_t usec)
isc_result_t dns_test_loaddb (dns_db_t **db, dns_dbtype_t dbtype, const char *origin, const char *testfile)

Variables

isc_mem_tmctx = NULL
isc_entropy_tectx = NULL
isc_log_tlctx = NULL
isc_taskmgr_ttaskmgr = NULL
isc_task_tmaintask = NULL
isc_timermgr_ttimermgr = NULL
isc_socketmgr_tsocketmgr = NULL
dns_zonemgr_tzonemgr = NULL
isc_boolean_t app_running = ISC_FALSE
int ncpus
static isc_boolean_t hash_active = ISC_FALSE
static isc_boolean_t dst_active = ISC_FALSE
static isc_logcategory_t categories []


Detailed Description

Definition in file dnstest.c.


Function Documentation

static void cleanup_managers ( void   )  [static]

Definition at line 77 of file dnstest.c.

References app_running, isc_app_finish(), isc_socketmgr_destroy(), isc_task_destroy(), isc_taskmgr_destroy(), and isc_timermgr_destroy().

static isc_result_t create_managers ( void   )  [static]

Definition at line 91 of file dnstest.c.

References CHECK, cleanup(), cleanup_managers(), isc_os_ncpus(), ISC_R_SUCCESS, isc_socketmgr_create(), isc_task_create(), isc_taskmgr_create(), isc_timermgr_create(), and ncpus.

isc_result_t dns_test_begin ( FILE *  logfile,
isc_boolean_t  start_managers 
)

Definition at line 111 of file dnstest.c.

References CHECK, cleanup(), create_managers(), dns_log_init(), dns_log_setcontext(), DNS_NAME_MAXWIRE, dns_result_register(), dns_test_end(), dst_active, dst_lib_init(), isc_logdestination::file, hash_active, isc_app_start(), ISC_ENTROPY_BLOCKING, isc_entropy_create(), isc_hash_create(), isc_log_create(), isc_log_createchannel(), ISC_LOG_DYNAMIC, isc_log_registercategories(), ISC_LOG_ROLLNEVER, isc_log_setcontext(), ISC_LOG_TOFILEDESC, isc_log_usechannel(), isc_mem_create(), isc_mem_debugging, ISC_MEM_DEBUGRECORD, ISC_R_FAILURE, ISC_R_SUCCESS, ISC_TRUE, isc_logfile::maximum_size, isc_logfile::name, isc_logfile::stream, and isc_logfile::versions.

Referenced by addrdataset(), allrdatasets(), ATF_TC_BODY(), attachversion(), closeversion(), deleterdataset(), dump(), find(), findrdataset(), getnsec3parameters(), resigned(), subtract(), test_create(), test_reverse(), test_seek(), test_seek_empty(), test_seek_nx(), and test_walk().

void dns_test_end ( void   ) 

Definition at line 168 of file dnstest.c.

References cleanup_managers(), dst_active, dst_lib_destroy(), hash_active, isc_entropy_detach(), ISC_FALSE, isc_hash_destroy(), isc_log_destroy(), and isc_mem_destroy().

Referenced by addrdataset(), allrdatasets(), ATF_TC_BODY(), attachversion(), closeversion(), deleterdataset(), dns_test_begin(), dump(), find(), findrdataset(), getnsec3parameters(), resigned(), subtract(), test_create(), test_reverse(), test_seek(), test_seek_empty(), test_seek_nx(), and test_walk().

isc_result_t dns_test_makeview ( const char *  name,
dns_view_t **  viewp 
)

Definition at line 192 of file dnstest.c.

References CHECK, cleanup(), dns_view_create(), dns_view_detach(), and ISC_R_SUCCESS.

isc_result_t dns_test_makezone ( const char *  name,
dns_zone_t **  zonep,
dns_view_t view,
isc_boolean_t  keepview 
)

Definition at line 218 of file dnstest.c.

References buffer, CHECK, cleanup(), dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_rootname, dns_view_addzone(), dns_view_create(), dns_view_detach(), dns_zone_create(), dns_zone_detach(), dns_zone_master, dns_zone_setclass(), dns_zone_setorigin(), dns_zone_settype(), dns_zone_setview(), isc_buffer_add, isc_buffer_constinit, ISC_R_SUCCESS, ISC_TRUE, origin, dns_view::rdclass, and zone.

Referenced by ATF_TC_BODY().

isc_result_t dns_test_setupzonemgr ( void   ) 

Definition at line 263 of file dnstest.c.

References dns_zonemgr_create(), and REQUIRE.

Referenced by ATF_TC_BODY().

isc_result_t dns_test_managezone ( dns_zone_t zone  ) 

Definition at line 273 of file dnstest.c.

References dns_zonemgr_managezone(), dns_zonemgr_setsize(), ISC_R_SUCCESS, and REQUIRE.

Referenced by ATF_TC_BODY().

void dns_test_releasezone ( dns_zone_t zone  ) 

Definition at line 286 of file dnstest.c.

References dns_zonemgr_releasezone(), and REQUIRE.

Referenced by ATF_TC_BODY().

void dns_test_closezonemgr ( void   ) 

Definition at line 292 of file dnstest.c.

References dns_zonemgr_detach(), dns_zonemgr_shutdown(), and REQUIRE.

Referenced by ATF_TC_BODY().

void dns_test_nap ( isc_uint32_t  usec  ) 

Definition at line 303 of file dnstest.c.

Referenced by ATF_TC_BODY().

isc_result_t dns_test_loaddb ( dns_db_t **  db,
dns_dbtype_t  dbtype,
const char *  origin,
const char *  testfile 
)

Definition at line 322 of file dnstest.c.

References dns_db_create(), dns_db_load(), dns_fixedname_init, dns_fixedname_name, dns_name_fromstring(), fixed, ISC_R_SUCCESS, and name.

Referenced by test_create(), test_reverse(), test_seek(), test_seek_empty(), test_seek_nx(), and test_walk().


Variable Documentation

isc_mem_t* mctx = NULL

Definition at line 48 of file dnstest.c.

isc_entropy_t* ectx = NULL

Definition at line 49 of file dnstest.c.

isc_log_t* lctx = NULL

Definition at line 50 of file dnstest.c.

isc_taskmgr_t* taskmgr = NULL

Definition at line 51 of file dnstest.c.

isc_task_t* maintask = NULL

Definition at line 52 of file dnstest.c.

isc_timermgr_t* timermgr = NULL

Definition at line 53 of file dnstest.c.

isc_socketmgr_t* socketmgr = NULL

Definition at line 54 of file dnstest.c.

dns_zonemgr_t* zonemgr = NULL

Definition at line 55 of file dnstest.c.

isc_boolean_t app_running = ISC_FALSE

Definition at line 56 of file dnstest.c.

Referenced by cleanup_managers().

int ncpus

Definition at line 57 of file dnstest.c.

isc_boolean_t hash_active = ISC_FALSE [static]

Definition at line 59 of file dnstest.c.

isc_boolean_t dst_active = ISC_FALSE [static]

Definition at line 59 of file dnstest.c.

Referenced by dns_test_begin(), and dns_test_end().

isc_logcategory_t categories[] [static]

Initial value:

 {
                { "",                0 },
                { "client",          0 },
                { "network",         0 },
                { "update",          0 },
                { "queries",         0 },
                { "unmatched",       0 },
                { "update-security", 0 },
                { "query-errors",    0 },
                { NULL,              0 }
}

Definition at line 64 of file dnstest.c.


Generated on Tue Apr 28 17:41:13 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha