remove (or hide behind a 'verbose' flag) extra output from system tests
This commit is contained in:
@@ -65,6 +65,15 @@ _teardown(void **state) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
nullmsg(dns_rdatacallbacks_t *cb, const char *fmt, ...) {
|
||||
va_list ap;
|
||||
|
||||
UNUSED(cb);
|
||||
UNUSED(fmt);
|
||||
UNUSED(ap);
|
||||
}
|
||||
|
||||
#define BUFLEN 255
|
||||
#define BIGBUFLEN (70 * 1024)
|
||||
#define TEST_ORIGIN "test"
|
||||
@@ -152,6 +161,17 @@ test_master(const char *testfile, dns_masterformat_t format,
|
||||
return(result);
|
||||
}
|
||||
|
||||
dns_rdatacallbacks_init_stdio(&callbacks);
|
||||
callbacks.add = add_callback;
|
||||
callbacks.rawdata = rawdata_callback;
|
||||
callbacks.zone = NULL;
|
||||
if (warn != NULL) {
|
||||
callbacks.warn = warn;
|
||||
}
|
||||
if (error != NULL) {
|
||||
callbacks.error = error;
|
||||
}
|
||||
|
||||
result = dns_master_loadfile(testfile, &dns_origin, &dns_origin,
|
||||
dns_rdataclass_in, true, 0,
|
||||
&callbacks, NULL, NULL, mctx, format, 0);
|
||||
@@ -175,7 +195,7 @@ load_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master1.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -191,7 +211,7 @@ unexpected_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master2.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, ISC_R_UNEXPECTEDEND);
|
||||
}
|
||||
|
||||
@@ -207,7 +227,7 @@ noowner_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master3.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, DNS_R_NOOWNER);
|
||||
}
|
||||
|
||||
@@ -223,7 +243,7 @@ nottl_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master4.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -239,7 +259,7 @@ badclass_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master5.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, DNS_R_BADCLASS);
|
||||
}
|
||||
|
||||
@@ -254,7 +274,7 @@ toobig_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master15.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, ISC_R_NOSPACE);
|
||||
}
|
||||
|
||||
@@ -269,7 +289,7 @@ maxrdata_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master16.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -284,7 +304,7 @@ dnskey_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master6.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -300,7 +320,7 @@ dnsnokey_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master7.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -315,7 +335,7 @@ include_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master8.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, DNS_R_SEENINCLUDE);
|
||||
}
|
||||
|
||||
@@ -330,7 +350,7 @@ master_includelist_test(void **state) {
|
||||
|
||||
UNUSED(state);
|
||||
|
||||
result = setup_master(NULL, NULL);
|
||||
result = setup_master(nullmsg, nullmsg);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_master_loadfile("testdata/master/master8.data",
|
||||
@@ -357,7 +377,7 @@ includefail_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master9.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, DNS_R_BADCLASS);
|
||||
}
|
||||
|
||||
@@ -372,7 +392,7 @@ blanklines_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master10.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -388,7 +408,7 @@ leadingzero_test(void **state) {
|
||||
UNUSED(state);
|
||||
|
||||
result = test_master("testdata/master/master11.data",
|
||||
dns_masterformat_text, NULL, NULL);
|
||||
dns_masterformat_text, nullmsg, nullmsg);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -439,21 +459,21 @@ loadraw_test(void **state) {
|
||||
|
||||
/* Raw format version 0 */
|
||||
result = test_master("testdata/master/master12.data",
|
||||
dns_masterformat_raw, NULL, NULL);
|
||||
dns_masterformat_raw, nullmsg, nullmsg);
|
||||
assert_string_equal(isc_result_totext(result), "success");
|
||||
assert_true(headerset);
|
||||
assert_int_equal(header.flags, 0);
|
||||
|
||||
/* Raw format version 1, no source serial */
|
||||
result = test_master("testdata/master/master13.data",
|
||||
dns_masterformat_raw, NULL, NULL);
|
||||
dns_masterformat_raw, nullmsg, nullmsg);
|
||||
assert_string_equal(isc_result_totext(result), "success");
|
||||
assert_true(headerset);
|
||||
assert_int_equal(header.flags, 0);
|
||||
|
||||
/* Raw format version 1, source serial == 2011120101 */
|
||||
result = test_master("testdata/master/master14.data",
|
||||
dns_masterformat_raw, NULL, NULL);
|
||||
dns_masterformat_raw, nullmsg, nullmsg);
|
||||
assert_string_equal(isc_result_totext(result), "success");
|
||||
assert_true(headerset);
|
||||
assert_true((header.flags & DNS_MASTERRAW_SOURCESERIALSET) != 0);
|
||||
@@ -503,7 +523,8 @@ dumpraw_test(void **state) {
|
||||
dns_masterformat_raw, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = test_master("test.dump", dns_masterformat_raw, NULL, NULL);
|
||||
result = test_master("test.dump", dns_masterformat_raw,
|
||||
nullmsg, nullmsg);
|
||||
assert_string_equal(isc_result_totext(result), "success");
|
||||
assert_true(headerset);
|
||||
assert_int_equal(header.flags, 0);
|
||||
@@ -518,7 +539,8 @@ dumpraw_test(void **state) {
|
||||
dns_masterformat_raw, &header);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = test_master("test.dump", dns_masterformat_raw, NULL, NULL);
|
||||
result = test_master("test.dump", dns_masterformat_raw,
|
||||
nullmsg, nullmsg);
|
||||
assert_string_equal(isc_result_totext(result), "success");
|
||||
assert_true(headerset);
|
||||
assert_true((header.flags & DNS_MASTERRAW_SOURCESERIALSET) != 0);
|
||||
@@ -564,7 +586,7 @@ neworigin_test(void **state) {
|
||||
|
||||
warn_expect_value = "record with inherited owner";
|
||||
result = test_master("testdata/master/master17.data",
|
||||
dns_masterformat_text, warn_expect, NULL);
|
||||
dns_masterformat_text, warn_expect, nullmsg);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
assert_true(warn_expect_result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user