2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

Merge branch 'fanf-tests-build-deps' into 'main'

A few build fixes for the unit tests

See merge request isc-projects/bind9!6369
This commit is contained in:
Ondřej Surý 2022-06-01 15:46:33 +00:00
commit c729f380db
21 changed files with 137 additions and 104 deletions

View File

@ -381,7 +381,7 @@ stages:
artifacts:
expire_in: "1 day"
paths:
- lib/*/tests/tsan.*
- tests/*/tsan.*
- tsan/
- junit.xml
when: always

View File

@ -45,13 +45,15 @@ check_PROGRAMS = \
zonemgr_test \
zt_test
CLEANFILES =
if HAVE_PERL
check_PROGRAMS += \
master_test
EXTRA_master_test_DEPENDENCIES = testdata/master/master12.data testdata/master/master13.data testdata/master/master14.data
CLEANFILES = $(EXTRA_master_test_DEPENDENCIES)
CLEANFILES += $(EXTRA_master_test_DEPENDENCIES)
testdata/master/master12.data: testdata/master/master12.data.in
mkdir -p testdata/master
@ -105,6 +107,13 @@ rsa_test_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(OPENSSL_CFLAGS)
EXTRA_sigs_test_DEPENDENCIES = testdata/master/master18.data
CLEANFILES += $(EXTRA_sigs_test_DEPENDENCIES)
testdata/master/master18.data: testdata/master/master18.data.in
mkdir -p testdata/master
sed -e 's,@TOP_SRCDIR@,$(abs_srcdir),' < $(srcdir)/testdata/master/master18.data.in > $@
EXTRA_DIST = \
Kdh.+002+18602.key \
Krsa.+005+29235.key \

View File

@ -253,8 +253,8 @@ ISC_RUN_TEST_IMPL(class) {
dns_rdataclass_in, 0, NULL, &db);
assert_int_equal(result, ISC_R_SUCCESS);
result = dns_db_load(db, "testdata/db/data.db", dns_masterformat_text,
0);
result = dns_db_load(db, TESTS_DIR "/testdata/db/data.db",
dns_masterformat_text, 0);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(dns_db_class(db), dns_rdataclass_in);
@ -273,8 +273,8 @@ ISC_RUN_TEST_IMPL(dbtype) {
result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_zone,
dns_rdataclass_in, 0, NULL, &db);
assert_int_equal(result, ISC_R_SUCCESS);
result = dns_db_load(db, "testdata/db/data.db", dns_masterformat_text,
0);
result = dns_db_load(db, TESTS_DIR "/testdata/db/data.db",
dns_masterformat_text, 0);
assert_int_equal(result, ISC_R_SUCCESS);
assert_true(dns_db_iszone(db));
assert_false(dns_db_iscache(db));
@ -284,8 +284,8 @@ ISC_RUN_TEST_IMPL(dbtype) {
result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_cache,
dns_rdataclass_in, 0, NULL, &db);
assert_int_equal(result, ISC_R_SUCCESS);
result = dns_db_load(db, "testdata/db/data.db", dns_masterformat_text,
0);
result = dns_db_load(db, TESTS_DIR "/testdata/db/data.db",
dns_masterformat_text, 0);
assert_int_equal(result, ISC_R_SUCCESS);
assert_true(dns_db_iscache(db));
assert_false(dns_db_iszone(db));
@ -305,7 +305,7 @@ ISC_RUN_TEST_IMPL(version) {
UNUSED(state);
result = dns_test_loaddb(&db, dns_dbtype_zone, "test.test",
"testdata/db/data.db");
TESTS_DIR "/testdata/db/data.db");
assert_int_equal(result, ISC_R_SUCCESS);
/* Open current version for reading */

View File

@ -55,8 +55,8 @@ ISC_RUN_TEST_IMPL(diffx_same) {
UNUSED(state);
test_create("testdata/diff/zone1.data", &olddb,
"testdata/diff/zone1.data", &newdb);
test_create(TESTS_DIR "/testdata/diff/zone1.data", &olddb,
TESTS_DIR "/testdata/diff/zone1.data", &newdb);
dns_diff_init(mctx, &diff);
@ -80,8 +80,8 @@ ISC_RUN_TEST_IMPL(diffx_add) {
UNUSED(state);
test_create("testdata/diff/zone1.data", &olddb,
"testdata/diff/zone2.data", &newdb);
test_create(TESTS_DIR "/testdata/diff/zone1.data", &olddb,
TESTS_DIR "/testdata/diff/zone2.data", &newdb);
dns_diff_init(mctx, &diff);
@ -112,8 +112,8 @@ ISC_RUN_TEST_IMPL(diffx_remove) {
UNUSED(state);
test_create("testdata/diff/zone1.data", &olddb,
"testdata/diff/zone3.data", &newdb);
test_create(TESTS_DIR "/testdata/diff/zone1.data", &olddb,
TESTS_DIR "/testdata/diff/zone3.data", &newdb);
dns_diff_init(mctx, &diff);

View File

@ -62,13 +62,13 @@ test_create(const char *filename) {
ISC_RUN_TEST_IMPL(create) {
UNUSED(state);
test_create("testdata/dbiterator/zone1.data");
test_create(TESTS_DIR "/testdata/dbiterator/zone1.data");
}
ISC_RUN_TEST_IMPL(create_nsec3) {
UNUSED(state);
test_create("testdata/dbiterator/zone2.data");
test_create(TESTS_DIR "/testdata/dbiterator/zone2.data");
}
/* walk: walk a database */
@ -111,13 +111,13 @@ test_walk(const char *filename, int nodes) {
ISC_RUN_TEST_IMPL(walk) {
UNUSED(state);
test_walk("testdata/dbiterator/zone1.data", 12);
test_walk(TESTS_DIR "/testdata/dbiterator/zone1.data", 12);
}
ISC_RUN_TEST_IMPL(walk_nsec3) {
UNUSED(state);
test_walk("testdata/dbiterator/zone2.data", 33);
test_walk(TESTS_DIR "/testdata/dbiterator/zone2.data", 33);
}
/* reverse: walk database backwards */
@ -160,13 +160,13 @@ test_reverse(const char *filename) {
ISC_RUN_TEST_IMPL(reverse) {
UNUSED(state);
test_reverse("testdata/dbiterator/zone1.data");
test_reverse(TESTS_DIR "/testdata/dbiterator/zone1.data");
}
ISC_RUN_TEST_IMPL(reverse_nsec3) {
UNUSED(state);
test_reverse("testdata/dbiterator/zone2.data");
test_reverse(TESTS_DIR "/testdata/dbiterator/zone2.data");
}
/* seek: walk database starting at a particular node */
@ -215,13 +215,13 @@ test_seek_node(const char *filename, int nodes) {
ISC_RUN_TEST_IMPL(seek_node) {
UNUSED(state);
test_seek_node("testdata/dbiterator/zone1.data", 9);
test_seek_node(TESTS_DIR "/testdata/dbiterator/zone1.data", 9);
}
ISC_RUN_TEST_IMPL(seek_node_nsec3) {
UNUSED(state);
test_seek_node("testdata/dbiterator/zone2.data", 30);
test_seek_node(TESTS_DIR "/testdata/dbiterator/zone2.data", 30);
}
/*
@ -257,13 +257,13 @@ test_seek_empty(const char *filename) {
ISC_RUN_TEST_IMPL(seek_empty) {
UNUSED(state);
test_seek_empty("testdata/dbiterator/zone1.data");
test_seek_empty(TESTS_DIR "/testdata/dbiterator/zone1.data");
}
ISC_RUN_TEST_IMPL(seek_empty_nsec3) {
UNUSED(state);
test_seek_empty("testdata/dbiterator/zone2.data");
test_seek_empty(TESTS_DIR "/testdata/dbiterator/zone2.data");
}
/*
@ -304,13 +304,13 @@ test_seek_nx(const char *filename) {
ISC_RUN_TEST_IMPL(seek_nx) {
UNUSED(state);
test_seek_nx("testdata/dbiterator/zone1.data");
test_seek_nx(TESTS_DIR "/testdata/dbiterator/zone1.data");
}
ISC_RUN_TEST_IMPL(seek_nx_nsec3) {
UNUSED(state);
test_seek_nx("testdata/dbiterator/zone2.data");
test_seek_nx(TESTS_DIR "/testdata/dbiterator/zone2.data");
}
/*

View File

@ -74,8 +74,8 @@ ISC_RUN_TEST_IMPL(dh_computesecret) {
assert_int_equal(result, ISC_R_SUCCESS);
result = dst_key_fromfile(name, 18602, DST_ALG_DH,
DST_TYPE_PUBLIC | DST_TYPE_KEY, "./", mctx,
&key);
DST_TYPE_PUBLIC | DST_TYPE_KEY, TESTS_DIR,
mctx, &key);
assert_int_equal(result, ISC_R_SUCCESS);
isc_buffer_init(&buf, array, sizeof(array));

View File

@ -188,25 +188,26 @@ ISC_RUN_TEST_IMPL(dns_dt_send) {
isc_time_set(&p, now - 3600, 0); /* past */
isc_time_set(&f, now + 3600, 0); /* future */
result = dns_test_getdata("testdata/dnstap/query.auth", qambuffer,
sizeof(qambuffer), &qasize);
result = dns_test_getdata(TESTS_DIR "/testdata/dnstap/query.auth",
qambuffer, sizeof(qambuffer), &qasize);
assert_int_equal(result, ISC_R_SUCCESS);
isc_buffer_init(&qamsg, qambuffer, qasize);
isc_buffer_add(&qamsg, qasize);
result = dns_test_getdata("testdata/dnstap/response.auth", rambuffer,
sizeof(rambuffer), &rasize);
result = dns_test_getdata(TESTS_DIR "/testdata/dnstap/response.auth",
rambuffer, sizeof(rambuffer), &rasize);
assert_int_equal(result, ISC_R_SUCCESS);
isc_buffer_init(&ramsg, rambuffer, rasize);
isc_buffer_add(&ramsg, rasize);
result = dns_test_getdata("testdata/dnstap/query.recursive", qrmbuffer,
sizeof(qrmbuffer), &qrsize);
result = dns_test_getdata(TESTS_DIR "/testdata/dnstap/query.recursive",
qrmbuffer, sizeof(qrmbuffer), &qrsize);
assert_int_equal(result, ISC_R_SUCCESS);
isc_buffer_init(&qrmsg, qrmbuffer, qrsize);
isc_buffer_add(&qrmsg, qrsize);
result = dns_test_getdata("testdata/dnstap/response.recursive",
result = dns_test_getdata(TESTS_DIR
"/testdata/dnstap/response.recursive",
rrmbuffer, sizeof(rrmbuffer), &rrsize);
assert_int_equal(result, ISC_R_SUCCESS);
isc_buffer_init(&rrmsg, rrmbuffer, rrsize);

View File

@ -171,8 +171,8 @@ check_sig(const char *datapath, const char *sigpath, const char *keyname,
isc_buffer_add(&b, strlen(keyname));
result = dns_name_fromtext(name, &b, dns_rootname, 0, NULL);
assert_int_equal(result, ISC_R_SUCCESS);
result = dst_key_fromfile(name, id, alg, type, "testdata/dst", mctx,
&key);
result = dst_key_fromfile(name, id, alg, type,
TESTS_DIR "/testdata/dst", mctx, &key);
assert_int_equal(result, ISC_R_SUCCESS);
isc_buffer_init(&databuf, data, (unsigned int)size);
@ -256,16 +256,20 @@ ISC_RUN_TEST_IMPL(sig_test) {
dns_secalg_t alg;
bool expect;
} testcases[] = {
{ "testdata/dst/test1.data", "testdata/dst/test1.ecdsa256sig",
"test.", 49130, DST_ALG_ECDSA256, true },
{ "testdata/dst/test1.data", "testdata/dst/test1.rsasha256sig",
"test.", 11349, DST_ALG_RSASHA256, true },
{ TESTS_DIR "/testdata/dst/test1.data",
TESTS_DIR "/testdata/dst/test1.ecdsa256sig", "test.", 49130,
DST_ALG_ECDSA256, true },
{ TESTS_DIR "/testdata/dst/test1.data",
TESTS_DIR "/testdata/dst/test1.rsasha256sig", "test.", 11349,
DST_ALG_RSASHA256, true },
{ /* wrong sig */
"testdata/dst/test1.data", "testdata/dst/test1.ecdsa256sig",
"test.", 11349, DST_ALG_RSASHA256, false },
TESTS_DIR "/testdata/dst/test1.data",
TESTS_DIR "/testdata/dst/test1.ecdsa256sig", "test.", 11349,
DST_ALG_RSASHA256, false },
{ /* wrong data */
"testdata/dst/test2.data", "testdata/dst/test1.ecdsa256sig",
"test.", 49130, DST_ALG_ECDSA256, false },
TESTS_DIR "/testdata/dst/test2.data",
TESTS_DIR "/testdata/dst/test1.ecdsa256sig", "test.", 49130,
DST_ALG_ECDSA256, false },
};
unsigned int i;
@ -302,8 +306,8 @@ check_cmp(const char *key1_name, dns_keytag_t key1_id, const char *key2_name,
isc_buffer_add(&b1, strlen(key1_name));
result = dns_name_fromtext(name1, &b1, dns_rootname, 0, NULL);
assert_int_equal(result, ISC_R_SUCCESS);
result = dst_key_fromfile(name1, key1_id, alg, type, "comparekeys",
mctx, &key1);
result = dst_key_fromfile(name1, key1_id, alg, type,
TESTS_DIR "/comparekeys", mctx, &key1);
assert_int_equal(result, ISC_R_SUCCESS);
/*
@ -314,8 +318,8 @@ check_cmp(const char *key1_name, dns_keytag_t key1_id, const char *key2_name,
isc_buffer_add(&b2, strlen(key2_name));
result = dns_name_fromtext(name2, &b2, dns_rootname, 0, NULL);
assert_int_equal(result, ISC_R_SUCCESS);
result = dst_key_fromfile(name2, key2_id, alg, type, "comparekeys",
mctx, &key2);
result = dst_key_fromfile(name2, key2_id, alg, type,
TESTS_DIR "/comparekeys", mctx, &key2);
assert_int_equal(result, ISC_R_SUCCESS);
/*

View File

@ -171,7 +171,7 @@ ISC_RUN_TEST_IMPL(load) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master1.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master1.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, ISC_R_SUCCESS);
}
@ -185,7 +185,7 @@ ISC_RUN_TEST_IMPL(unexpected) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master2.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master2.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, ISC_R_UNEXPECTEDEND);
}
@ -200,7 +200,7 @@ ISC_RUN_TEST_IMPL(noowner) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master3.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master3.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, DNS_R_NOOWNER);
}
@ -215,7 +215,7 @@ ISC_RUN_TEST_IMPL(nottl) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master4.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master4.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, ISC_R_SUCCESS);
}
@ -230,7 +230,7 @@ ISC_RUN_TEST_IMPL(badclass) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master5.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master5.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, DNS_R_BADCLASS);
}
@ -244,7 +244,7 @@ ISC_RUN_TEST_IMPL(toobig) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master15.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master15.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, ISC_R_NOSPACE);
}
@ -258,7 +258,7 @@ ISC_RUN_TEST_IMPL(maxrdata) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master16.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master16.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, ISC_R_SUCCESS);
}
@ -272,7 +272,7 @@ ISC_RUN_TEST_IMPL(dnskey) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master6.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master6.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, ISC_R_SUCCESS);
}
@ -289,7 +289,7 @@ ISC_RUN_TEST_IMPL(dnsnokey) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master7.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master7.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, ISC_R_UNEXPECTEDEND);
}
@ -303,7 +303,7 @@ ISC_RUN_TEST_IMPL(include) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master8.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master8.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, DNS_R_SEENINCLUDE);
}
@ -325,9 +325,9 @@ ISC_RUN_TEST_IMPL(master_includelist) {
assert_int_equal(result, ISC_R_SUCCESS);
result = dns_master_loadfile(
"testdata/master/master8.data", &dns_origin, &dns_origin,
dns_rdataclass_in, 0, true, &callbacks, include_callback,
&filename, mctx, dns_masterformat_text, 0);
TESTS_DIR "/testdata/master/master8.data", &dns_origin,
&dns_origin, dns_rdataclass_in, 0, true, &callbacks,
include_callback, &filename, mctx, dns_masterformat_text, 0);
assert_int_equal(result, DNS_R_SEENINCLUDE);
assert_non_null(filename);
if (filename != NULL) {
@ -345,7 +345,7 @@ ISC_RUN_TEST_IMPL(includefail) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master9.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master9.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, DNS_R_BADCLASS);
}
@ -359,7 +359,7 @@ ISC_RUN_TEST_IMPL(blanklines) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master10.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master10.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, ISC_R_SUCCESS);
}
@ -374,7 +374,7 @@ ISC_RUN_TEST_IMPL(leadingzero) {
UNUSED(state);
result = test_master(SRCDIR, "testdata/master/master11.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master11.data",
dns_masterformat_text, nullmsg, nullmsg);
assert_int_equal(result, ISC_R_SUCCESS);
}
@ -479,7 +479,7 @@ ISC_RUN_TEST_IMPL(dumpraw) {
result = isc_dir_chdir(SRCDIR);
assert_int_equal(result, ISC_R_SUCCESS);
result = dns_db_load(db, "testdata/master/master1.data",
result = dns_db_load(db, TESTS_DIR "/testdata/master/master1.data",
dns_masterformat_text, 0);
assert_int_equal(result, ISC_R_SUCCESS);
@ -551,7 +551,7 @@ ISC_RUN_TEST_IMPL(neworigin) {
UNUSED(state);
warn_expect_value = "record with inherited owner";
result = test_master(SRCDIR, "testdata/master/master17.data",
result = test_master(SRCDIR, TESTS_DIR "/testdata/master/master17.data",
dns_masterformat_text, warn_expect, nullmsg);
assert_int_equal(result, ISC_R_SUCCESS);
assert_true(warn_expect_result);

View File

@ -114,11 +114,11 @@ nsec3param_salttotext_test(const nsec3param_salttotext_test_params_t *params) {
ISC_RUN_TEST_IMPL(max_iterations) {
UNUSED(state);
iteration_test("testdata/nsec3/1024.db", 150);
iteration_test("testdata/nsec3/2048.db", 150);
iteration_test("testdata/nsec3/4096.db", 150);
iteration_test("testdata/nsec3/min-1024.db", 150);
iteration_test("testdata/nsec3/min-2048.db", 150);
iteration_test(TESTS_DIR "/testdata/nsec3/1024.db", 150);
iteration_test(TESTS_DIR "/testdata/nsec3/2048.db", 150);
iteration_test(TESTS_DIR "/testdata/nsec3/4096.db", 150);
iteration_test(TESTS_DIR "/testdata/nsec3/min-1024.db", 150);
iteration_test(TESTS_DIR "/testdata/nsec3/min-2048.db", 150);
}
/* check dns_nsec3param_salttotext() */

View File

@ -116,9 +116,9 @@ nsec3param_change_test(const nsec3param_change_test_params_t *test) {
result = dns_test_makezone("nsec3", &zone, NULL, false);
assert_int_equal(result, ISC_R_SUCCESS);
result = dns_zone_setfile(zone, "testdata/nsec3param/nsec3.db.signed",
dns_masterformat_text,
&dns_master_style_default);
result = dns_zone_setfile(
zone, TESTS_DIR "/testdata/nsec3param/nsec3.db.signed",
dns_masterformat_text, &dns_master_style_default);
assert_int_equal(result, ISC_R_SUCCESS);
result = dns_zone_load(zone, false);

View File

@ -151,7 +151,7 @@ ISC_RUN_TEST_IMPL(isc_rsa_verify) {
assert_int_equal(ret, ISC_R_SUCCESS);
ret = dst_key_fromfile(name, 29235, DST_ALG_RSASHA1, DST_TYPE_PUBLIC,
"./", mctx, &key);
TESTS_DIR, mctx, &key);
assert_int_equal(ret, ISC_R_SUCCESS);
/* RSASHA1 */

View File

@ -310,7 +310,7 @@ ISC_RUN_TEST_IMPL(updatesigs_next) {
"testdata/master/master18.data");
assert_int_equal(result, DNS_R_SEENINCLUDE);
result = dns_zone_setkeydirectory(zone, "testkeys");
result = dns_zone_setkeydirectory(zone, TESTS_DIR "/testkeys");
assert_int_equal(result, ISC_R_SUCCESS);
isc_stdtime_get(&now);

View File

@ -6,5 +6,5 @@ $TTL 1000
604800 ;expiration
3600 ) ;minimum
$INCLUDE "testkeys/Kexample.+008+20386.key";
$INCLUDE "testkeys/Kexample.+008+37464.key";
$INCLUDE "@TOP_SRCDIR@/testkeys/Kexample.+008+20386.key";
$INCLUDE "@TOP_SRCDIR@/testkeys/Kexample.+008+37464.key";

View File

@ -180,7 +180,7 @@ ISC_RUN_TEST_IMPL(dns_zt_asyncload_zone) {
assert_false(atomic_load(&done));
zonefile = fopen("./zone.data", "wb");
assert_non_null(zonefile);
origfile = fopen("./testdata/zt/zone1.db", "r+b");
origfile = fopen(TESTS_DIR "/testdata/zt/zone1.db", "r+b");
assert_non_null(origfile);
n = fread(buf, 1, 4096, origfile);
fclose(origfile);
@ -273,19 +273,19 @@ ISC_RUN_TEST_IMPL(dns_zt_asyncload_zt) {
result = dns_test_makezone("foo", &zone1, NULL, true);
assert_int_equal(result, ISC_R_SUCCESS);
dns_zone_setfile(zone1, "testdata/zt/zone1.db", dns_masterformat_text,
&dns_master_style_default);
dns_zone_setfile(zone1, TESTS_DIR "/testdata/zt/zone1.db",
dns_masterformat_text, &dns_master_style_default);
view = dns_zone_getview(zone1);
result = dns_test_makezone("bar", &zone2, view, false);
assert_int_equal(result, ISC_R_SUCCESS);
dns_zone_setfile(zone2, "testdata/zt/zone1.db", dns_masterformat_text,
&dns_master_style_default);
dns_zone_setfile(zone2, TESTS_DIR "/testdata/zt/zone1.db",
dns_masterformat_text, &dns_master_style_default);
/* This one will fail to load */
result = dns_test_makezone("fake", &zone3, view, false);
assert_int_equal(result, ISC_R_SUCCESS);
dns_zone_setfile(zone3, "testdata/zt/nonexistent.db",
dns_zone_setfile(zone3, TESTS_DIR "/testdata/zt/nonexistent.db",
dns_masterformat_text, &dns_master_style_default);
zt = view->zonetable;

View File

@ -52,6 +52,11 @@ doh_test_CPPFLAGS = \
doh_test_LDADD = \
$(LDADD) \
$(LIBNGHTTP2_LIBS)
doh_test_SOURCES = \
doh_test.c \
uv_wrap.h
endif HAVE_LIBNGHTTP2
hmac_test_CPPFLAGS = \
@ -70,6 +75,18 @@ md_test_LDADD = \
$(LDADD) \
$(OPENSSL_LIBS)
netmgr_test_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(OPENSSL_CFLAGS)
netmgr_test_LDADD = \
$(LDADD) \
$(OPENSSL_LIBS)
netmgr_test_SOURCES = \
netmgr_test.c \
uv_wrap.h
random_test_LDADD = \
$(LDADD) \
-lm

View File

@ -4,12 +4,14 @@ AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBISCCFG_CFLAGS) \
$(LIBUV_CFLAGS) \
-I$(top_srcdir)/lib/isc
LDADD += \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS) \
$(LIBISCCFG_LIBS)
$(LIBISCCFG_LIBS) \
$(LIBUV_LIBS)
check_PROGRAMS = \
duration_test \

View File

@ -14,13 +14,10 @@ LDADD += \
check_LTLIBRARIES = libtest.la
noinst_libtest_ladir = ..
noinst_libtest_la_HEADERS = \
libtest_la_SOURCES = \
../include/tests/dns.h \
../include/tests/isc.h \
../include/tests/ns.h
libtest_la_SOURCES = \
$(noinst_libtest_la_HEADERS) \
../include/tests/ns.h \
dns.c \
isc.c \
ns.c

View File

@ -4,13 +4,15 @@ AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBNS_CFLAGS) \
$(LIBUV_CFLAGS) \
-I$(top_srcdir)/lib/isc \
-I$(top_srcdir)/lib/dns
LDADD += \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS) \
$(LIBNS_LIBS)
$(LIBNS_LIBS) \
$(LIBUV_LIBS)
check_PROGRAMS = \
listenlist_test \

View File

@ -91,7 +91,8 @@ ISC_RUN_TEST_IMPL(ns_notify_start) {
result = dns_test_makeview("view", false, &client->view);
assert_int_equal(result, ISC_R_SUCCESS);
result = ns_test_serve_zone("example.com", "testdata/notify/zone1.db",
result = ns_test_serve_zone("example.com",
TESTS_DIR "/testdata/notify/zone1.db",
client->view);
assert_int_equal(result, ISC_R_SUCCESS);
@ -100,8 +101,8 @@ ISC_RUN_TEST_IMPL(ns_notify_start) {
* (XXX: use better message mocking method when available.)
*/
result = ns_test_getdata("testdata/notify/notify1.msg", ndata,
sizeof(ndata), &nsize);
result = ns_test_getdata(TESTS_DIR "/testdata/notify/notify1.msg",
ndata, sizeof(ndata), &nsize);
assert_int_equal(result, ISC_R_SUCCESS);
isc_buffer_init(&nbuf, ndata, nsize);
isc_buffer_add(&nbuf, nsize);

View File

@ -473,7 +473,7 @@ ISC_RUN_TEST_IMPL(ns_query_start) {
.qflags = DNS_MESSAGEFLAG_RD,
.recursive_service = true,
.auth_zone_origin = "foo",
.auth_zone_path = "testdata/query/foo.db",
.auth_zone_path = TESTS_DIR "/testdata/query/foo.db",
.expected_result = NS__QUERY_START_R_AUTH,
},
/*
@ -487,7 +487,7 @@ ISC_RUN_TEST_IMPL(ns_query_start) {
.qflags = DNS_MESSAGEFLAG_RD,
.recursive_service = false,
.auth_zone_origin = "foo",
.auth_zone_path = "testdata/query/foo.db",
.auth_zone_path = TESTS_DIR "/testdata/query/foo.db",
.expected_result = NS__QUERY_START_R_REFUSE,
},
/*
@ -502,7 +502,7 @@ ISC_RUN_TEST_IMPL(ns_query_start) {
.qflags = DNS_MESSAGEFLAG_RD,
.recursive_service = true,
.auth_zone_origin = "foo",
.auth_zone_path = "testdata/query/foo.db",
.auth_zone_path = TESTS_DIR "/testdata/query/foo.db",
.expected_result = NS__QUERY_START_R_CACHE,
},
/*
@ -517,7 +517,7 @@ ISC_RUN_TEST_IMPL(ns_query_start) {
.qflags = DNS_MESSAGEFLAG_RD,
.recursive_service = true,
.auth_zone_origin = "foo",
.auth_zone_path = "testdata/query/foo.db",
.auth_zone_path = TESTS_DIR "/testdata/query/foo.db",
.expected_result = NS__QUERY_START_R_AUTH,
},
/*
@ -532,7 +532,7 @@ ISC_RUN_TEST_IMPL(ns_query_start) {
.qflags = 0,
.recursive_service = true,
.auth_zone_origin = "foo",
.auth_zone_path = "testdata/query/foo.db",
.auth_zone_path = TESTS_DIR "/testdata/query/foo.db",
.expected_result = NS__QUERY_START_R_AUTH,
},
/*
@ -547,7 +547,7 @@ ISC_RUN_TEST_IMPL(ns_query_start) {
.qflags = DNS_MESSAGEFLAG_RD,
.recursive_service = true,
.auth_zone_origin = "foo",
.auth_zone_path = "testdata/query/foo.db",
.auth_zone_path = TESTS_DIR "/testdata/query/foo.db",
.expected_result = NS__QUERY_START_R_CACHE,
},
/*
@ -562,7 +562,7 @@ ISC_RUN_TEST_IMPL(ns_query_start) {
.qflags = 0,
.recursive_service = true,
.auth_zone_origin = "foo",
.auth_zone_path = "testdata/query/foo.db",
.auth_zone_path = TESTS_DIR "/testdata/query/foo.db",
.expected_result = NS__QUERY_START_R_AUTH,
},
/*
@ -1402,7 +1402,7 @@ run_hookasync_e2e_test(const ns__query_hookasync_e2e_test_params_t *test) {
qctx->client->sendcb = send_noop;
/* Load a zone. it should have ns.foo/A */
result = ns_test_serve_zone("foo", "testdata/query/foo.db",
result = ns_test_serve_zone("foo", TESTS_DIR "/testdata/query/foo.db",
qctx->client->view);
INSIST(result == ISC_R_SUCCESS);