/*
* Copyright (C) 2011-2013 Internet Systems Consortium, Inc. ("ISC")
*
* 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 ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC 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$ */
/*! \file */
#include <config.h>
#include <atf-c.h>
#include <unistd.h>
#include <dns/callbacks.h>
#include <dns/masterdump.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include "dnstest.h"
/*
* Helper functions
*/
static isc_result_t
static isc_result_t
&target);
return(result);
}
static int
void (*warn)(struct dns_rdatacallbacks *, const char *, ...),
void (*error)(struct dns_rdatacallbacks *, const char *, ...))
{
int len;
0, &target);
if (result != ISC_R_SUCCESS)
return(result);
/*
* atf-run changes us to a /tmp directory, so tests
* that access test data files must first chdir to the proper
* location.
*/
return (ISC_R_FAILURE);
return (result);
}
/*
* Individual unit tests
*/
/* Successful load test */
"valid master file and returns success");
}
dns_test_end();
}
/* Unepxected end of file test */
"DNS_R_UNEXPECTED when file ends "
"too soon");
}
dns_test_end();
}
/* No owner test */
"zones with no TTL for first record "
"if it is an SOA");
}
dns_test_end();
}
/* No TTL test */
"DNS_R_NOOWNER when no owner name "
"is specified");
}
dns_test_end();
}
/* Bad class test */
"DNS_R_BADCLASS when record class "
"doesn't match zone class");
}
dns_test_end();
}
/* Too big rdata test */
"ISC_R_NOSPACE when record is too big");
}
dns_test_end();
}
/* Maximum rdata test */
"ISC_R_SUCCESS when record is maximum "
"size");
}
dns_test_end();
}
/* DNSKEY test */
"DNSKEY with key material");
}
dns_test_end();
}
/* DNSKEY with no key material test */
"DNSKEY with no key material");
}
dns_test_end();
}
/* Include test */
ATF_TC(include);
"$INCLUDE");
}
dns_test_end();
}
/* Include failure test */
"$INCLUDE failures");
}
dns_test_end();
}
/* Non-empty blank lines test */
"non-empty blank lines");
}
dns_test_end();
}
/* SOA leading zeroes test */
"leading zeroes in SOA");
}
dns_test_end();
}
}
/* First, test with an empty rdataset */
&target);
/*
* XXX: We will also need to add tests for dumping various
* rdata types, classes, etc, and comparing the results against
* known-good output.
*/
dns_test_end();
}
static const char *warn_expect_value;
static void
}
/* Origin change test */
"zones with inherited name following "
"$ORIGIN");
}
warn_expect_value = "record with inherited owner";
dns_test_end();
}
/*
* Main
*/
ATF_TP_ADD_TC(tp, include);
return (atf_no_error());
}