t_master.c revision 499b34cea04a46823d003d4c0520c8b03e8513cb
/*
* Copyright (C) 1998-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: t_master.c,v 1.29 2001/01/09 21:41:57 bwelling Exp $ */
#include <config.h>
#include <ctype.h>
#include <stdlib.h>
#include <dns/callbacks.h>
#include <dns/rdataclass.h>
#include <dns/rdataset.h>
#define BUFLEN 255
static isc_result_t
static isc_result_t
&target);
if (result != ISC_R_SUCCESS)
return(result);
}
static int
{
int result;
int len;
else
if (isc_result != ISC_R_SUCCESS) {
return(T_UNRESOLVED);
}
if (dns_result != ISC_R_SUCCESS) {
t_info("dns_name_fromtext failed %s\n",
return(T_UNRESOLVED);
}
if (dns_result != ISC_R_SUCCESS) {
t_info("dns_rdataclass_fromtext failed %s\n",
return(T_UNRESOLVED);
}
T1_mctx);
if (dns_result == exp_result)
else {
t_info("dns_master_loadfile: got %s, expected %s\n",
}
return(result);
}
static int
test_master_x(const char *filename) {
char *p;
int line;
int cnt;
int result;
line = 0;
++line;
/*
* Skip comment lines.
*/
continue;
/*
* Name of data file, origin, zclass, expected result.
*/
if (cnt == 4) {
Tokens[2],
} else {
t_info("bad format in %s at line %d\n",
}
(void)free(p);
}
} else {
}
return(result);
}
static const char *a1 = "dns_master_loadfile loads a valid master file and "
"returns ISC_R_SUCCESS";
static void
t1(void) {
int result;
}
static const char *a2 =
"dns_master_loadfile returns ISC_R_UNEXPECTEDEND when the "
"masterfile input ends unexpectedly";
static void
t2(void) {
int result;
}
static const char *a3 = "dns_master_loadfile returns DNS_R_NOOWNER when the "
"an ownername is not specified";
static void
t3() {
int result;
}
static const char *a4 = "dns_master_loadfile returns DNS_R_NOTTL when the "
"the ttl is not specified";
static void
t4() {
int result;
}
static const char *a5 = "dns_master_loadfile returns DNS_R_BADCLASS when the "
"the record class did not match the zone class";
static void
t5() {
int result;
}
static const char *a6 =
"dns_master_loadfile understands KEY RR specifications "
"containing key material";
static void
t6() {
int result;
}
static const char *a7 =
"dns_master_loadfile understands KEY RR specifications "
"containing no key material";
static void
t7() {
int result;
}
static const char *a8 =
"dns_master_loadfile understands $INCLUDE";
static void
t8() {
int result;
}
static const char *a9 =
"dns_master_loadfile understands $INCLUDE with failure";
static void
t9() {
int result;
}
static const char *a10 =
"dns_master_loadfile non-empty blank lines";
static void
t10() {
int result;
}
static const char *a11 =
"dns_master_loadfile allow leading zeros in SOA";
static void
t11() {
int result;
}
testspec_t T_testlist[] = {
{ t1, "ISC_R_SUCCESS" },
{ t2, "ISC_R_UNEXPECTEDEND" },
{ t3, "DNS_NOOWNER" },
{ t4, "DNS_NOTTL" },
{ t5, "DNS_BADCLASS" },
{ t6, "KEY RR 1" },
{ t7, "KEY RR 2" },
{ t8, "$INCLUDE" },
{ t9, "$INCLUDE w/ DNS_BADCLASS" },
{ t10, "non empty blank lines" },
{ t11, "leading zeros in serial" },
};