mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
fixed closing comment error introduced by my last revision
This commit is contained in:
parent
2fda9d9e1b
commit
e38d22f566
@ -36,7 +36,8 @@
|
||||
|
||||
static isc_result_t
|
||||
t_create(char *db_type, char *origin, char *class, char *cache,
|
||||
isc_mem_t *mctx, dns_db_t **db) {
|
||||
isc_mem_t *mctx, dns_db_t **db)
|
||||
{
|
||||
int len;
|
||||
isc_result_t dns_result;
|
||||
isc_boolean_t iscache;
|
||||
@ -84,7 +85,6 @@ t_create(char *db_type, char *origin, char *class, char *cache,
|
||||
|
||||
static int
|
||||
t_dns_db_load(char **av) {
|
||||
|
||||
char *filename;
|
||||
char *db_type;
|
||||
char *origin;
|
||||
@ -201,8 +201,7 @@ t_dns_db_load(char **av) {
|
||||
dns_result_totext(dns_result),
|
||||
dns_result_totext(exp_find_result));
|
||||
result = T_FAIL;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
result = T_PASS;
|
||||
}
|
||||
|
||||
@ -224,7 +223,7 @@ static char *a1 =
|
||||
"the database in filename into db.";
|
||||
|
||||
static void
|
||||
t1() {
|
||||
t1(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_load", 1, T_REQUIRED, a1);
|
||||
@ -240,7 +239,8 @@ static char *a2 =
|
||||
static int
|
||||
t_dns_db_zc_x(char *filename, char *db_type, char *origin, char *class,
|
||||
isc_boolean_t cache, isc_boolean_t(*cf)(dns_db_t *),
|
||||
isc_boolean_t exp_result) {
|
||||
isc_boolean_t exp_result)
|
||||
{
|
||||
int result;
|
||||
int len;
|
||||
dns_db_t *db;
|
||||
@ -303,8 +303,7 @@ t_dns_db_zc_x(char *filename, char *db_type, char *origin, char *class,
|
||||
result = T_PASS;
|
||||
else
|
||||
result = T_FAIL;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
t_info("dns_db_load failed %s\n",
|
||||
dns_result_totext(dns_result));
|
||||
result = T_FAIL;
|
||||
@ -317,7 +316,8 @@ t_dns_db_zc_x(char *filename, char *db_type, char *origin, char *class,
|
||||
|
||||
static int
|
||||
test_dns_db_zc_x(char *filename, isc_boolean_t cache,
|
||||
isc_boolean_t(*cf)(dns_db_t *), isc_boolean_t exp_result) {
|
||||
isc_boolean_t(*cf)(dns_db_t *), isc_boolean_t exp_result)
|
||||
{
|
||||
|
||||
FILE *fp;
|
||||
char *p;
|
||||
@ -346,39 +346,36 @@ test_dns_db_zc_x(char *filename, isc_boolean_t cache,
|
||||
|
||||
cnt = t_bustline(p, tokens);
|
||||
if (cnt == 4) {
|
||||
result = t_dns_db_zc_x(
|
||||
tokens[0], /* filename */
|
||||
result = t_dns_db_zc_x(tokens[0], /* file */
|
||||
tokens[1], /* type */
|
||||
tokens[2], /* origin */
|
||||
tokens[3], /* class */
|
||||
cache, /* cache */
|
||||
cf, /* check func */
|
||||
exp_result); /* exp result */
|
||||
exp_result);/* expect */
|
||||
if (result != T_PASS) {
|
||||
if (result == T_FAIL)
|
||||
++nfails;
|
||||
else
|
||||
++nprobs;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
t_info("bad format in %s at line %d\n",
|
||||
filename, line);
|
||||
++nprobs;
|
||||
}
|
||||
|
||||
(void) free(p);
|
||||
(void)free(p);
|
||||
}
|
||||
(void) fclose(fp);
|
||||
}
|
||||
else {
|
||||
(void)fclose(fp);
|
||||
} else {
|
||||
t_info("Missing datafile %s\n", filename);
|
||||
++nprobs;
|
||||
}
|
||||
|
||||
result = T_UNRESOLVED;
|
||||
|
||||
if ((nfails == 0) && (nprobs == 0))
|
||||
if (nfails == 0 && nprobs == 0)
|
||||
result = T_PASS;
|
||||
else if (nfails)
|
||||
result = T_FAIL;
|
||||
@ -387,7 +384,7 @@ test_dns_db_zc_x(char *filename, isc_boolean_t cache,
|
||||
}
|
||||
|
||||
static void
|
||||
t2() {
|
||||
t2(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_iscache", 2, T_REQUIRED, a2);
|
||||
@ -403,7 +400,7 @@ static char *a3 =
|
||||
|
||||
|
||||
static void
|
||||
t3() {
|
||||
t3(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_iscache", 3, T_REQUIRED, a3);
|
||||
@ -419,7 +416,7 @@ static char *a4 =
|
||||
|
||||
|
||||
static void
|
||||
t4() {
|
||||
t4(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_iszone", 4, T_REQUIRED, a4);
|
||||
@ -434,7 +431,7 @@ static char *a5 =
|
||||
"dns_db_iszone(db) returns ISC_FALSE.";
|
||||
|
||||
static void
|
||||
t5() {
|
||||
t5(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_iszone", 5, T_REQUIRED, a5);
|
||||
@ -509,11 +506,11 @@ t_dns_db_origin(char **av) {
|
||||
isc_mem_destroy(&mctx);
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
order = dns_name_compare(dns_fixedname_name(&dns_origin), dns_db_origin(db));
|
||||
order = dns_name_compare(dns_fixedname_name(&dns_origin),
|
||||
dns_db_origin(db));
|
||||
if (order == 0) {
|
||||
result = T_PASS;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
t_info("dns_name_compare returned %d\n", order);
|
||||
result = T_FAIL;
|
||||
}
|
||||
@ -528,7 +525,7 @@ static char *a6 =
|
||||
"A call to dns_db_origin(db) returns the origin of the database.";
|
||||
|
||||
static void
|
||||
t6() {
|
||||
t6(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_origin", 6, T_REQUIRED, a6);
|
||||
@ -619,7 +616,7 @@ t_dns_db_class(char **av) {
|
||||
|
||||
}
|
||||
static void
|
||||
t7() {
|
||||
t7(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_class", 7, T_REQUIRED, a7);
|
||||
@ -770,7 +767,9 @@ t_dns_db_currentversion(char **av) {
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
/* delete the found rdataset in the new version */
|
||||
/*
|
||||
* Delete the found rdataset in the new version.
|
||||
*/
|
||||
dns_result = dns_db_deleterdataset(db, nodep, nversionp, rdatatype, 0);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
t_info("dns_db_deleterdataset failed %s\n",
|
||||
@ -784,12 +783,16 @@ t_dns_db_currentversion(char **av) {
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
/* don't need these now */
|
||||
/*
|
||||
* Don't need these now.
|
||||
*/
|
||||
dns_rdataset_disassociate(&rdataset);
|
||||
dns_db_detachnode(db, &nodep);
|
||||
nodep = NULL;
|
||||
|
||||
/* find the deleted rdataset and expect it to fail */
|
||||
/*
|
||||
* Find the deleted rdataset and expect it to fail.
|
||||
*/
|
||||
dns_result = dns_db_find(db,
|
||||
dns_fixedname_name(&dns_findname),
|
||||
nversionp,
|
||||
@ -810,25 +813,25 @@ t_dns_db_currentversion(char **av) {
|
||||
return(T_FAIL);
|
||||
}
|
||||
|
||||
/* close/commit the new version */
|
||||
/*
|
||||
* Close/commit the new version.
|
||||
*/
|
||||
dns_db_closeversion(db, &nversionp, ISC_TRUE);
|
||||
|
||||
/* find the deleted rdata in the current version */
|
||||
dns_result = dns_db_find(db,
|
||||
dns_fixedname_name(&dns_findname),
|
||||
cversionp,
|
||||
rdatatype,
|
||||
DNS_DBFIND_GLUEOK,
|
||||
0,
|
||||
&nodep,
|
||||
dns_fixedname_name(&dns_foundname),
|
||||
/*
|
||||
* Find the deleted rdata in the current version.
|
||||
*/
|
||||
dns_result = dns_db_find(db, dns_fixedname_name(&dns_findname),
|
||||
cversionp, rdatatype, DNS_DBFIND_GLUEOK,
|
||||
0, &nodep, dns_fixedname_name(&dns_foundname),
|
||||
&rdataset, NULL);
|
||||
|
||||
/* and expect it to succeed */
|
||||
/*
|
||||
* And expect it to succeed.
|
||||
*/
|
||||
if (dns_result == ISC_R_SUCCESS) {
|
||||
result = T_PASS;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
t_info("cound not find %s using current version\n", findname);
|
||||
dns_db_closeversion(db, &cversionp, ISC_FALSE);
|
||||
dns_db_detach(&db);
|
||||
@ -847,7 +850,7 @@ t_dns_db_currentversion(char **av) {
|
||||
}
|
||||
|
||||
static void
|
||||
t8() {
|
||||
t8(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_currentversion", 8, T_REQUIRED, a8);
|
||||
@ -905,9 +908,10 @@ t_dns_db_newversion(char **av) {
|
||||
db = NULL;
|
||||
mctx = NULL;
|
||||
|
||||
/* open a new version, add some data, commit it,
|
||||
/*
|
||||
* Open a new version, add some data, commit it,
|
||||
* close it, open a new version, and check that changes
|
||||
* are present
|
||||
* are present.
|
||||
*/
|
||||
|
||||
t_info("testing using file %s and name %s\n", filename, newname);
|
||||
@ -935,7 +939,7 @@ t_dns_db_newversion(char **av) {
|
||||
}
|
||||
|
||||
/*
|
||||
* add a new name
|
||||
* Add a new name.
|
||||
*/
|
||||
|
||||
dns_fixedname_init(&dns_newname);
|
||||
@ -964,7 +968,7 @@ t_dns_db_newversion(char **av) {
|
||||
}
|
||||
|
||||
/*
|
||||
* open a new version and associate some rdata with the new name
|
||||
* Open a new version and associate some rdata with the new name.
|
||||
*/
|
||||
|
||||
textregion.base = newtype;
|
||||
@ -1040,34 +1044,34 @@ t_dns_db_newversion(char **av) {
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
/* close and commit the version */
|
||||
/*
|
||||
* Close and commit the version.
|
||||
*/
|
||||
dns_db_closeversion(db, &nversionp, ISC_TRUE);
|
||||
dns_db_detachnode(db, &nodep);
|
||||
if (dns_rdataset_isassociated(&added_rdataset))
|
||||
dns_rdataset_disassociate(&added_rdataset);
|
||||
nodep = NULL;
|
||||
|
||||
/* open a new version and find the data we added */
|
||||
/*
|
||||
* Open a new version and find the data we added.
|
||||
*/
|
||||
dns_fixedname_init(&dns_foundname);
|
||||
dns_rdataset_init(&found_rdataset);
|
||||
nversionp = NULL;
|
||||
found_nodep = NULL;
|
||||
dns_db_newversion(db, &nversionp);
|
||||
|
||||
/* find the recently added name and rdata */
|
||||
dns_result = dns_db_find(db,
|
||||
dns_fixedname_name(&dns_newname),
|
||||
nversionp,
|
||||
rdatatype,
|
||||
0,
|
||||
0,
|
||||
&found_nodep,
|
||||
/*
|
||||
* Find the recently added name and rdata.
|
||||
*/
|
||||
dns_result = dns_db_find(db, dns_fixedname_name(&dns_newname),
|
||||
nversionp, rdatatype, 0, 0, &found_nodep,
|
||||
dns_fixedname_name(&dns_foundname),
|
||||
&found_rdataset,
|
||||
NULL);
|
||||
&found_rdataset, NULL);
|
||||
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
/* ZZZ - NXRRSET ??? reference counts ??? */
|
||||
/* XXXWPK - NXRRSET ??? reference counts ??? */
|
||||
t_info("dns_db_find failed %s\n",
|
||||
dns_result_totext(dns_result));
|
||||
dns_db_closeversion(db, &nversionp, ISC_FALSE);
|
||||
@ -1092,19 +1096,22 @@ t_dns_db_newversion(char **av) {
|
||||
return(T_FAIL);
|
||||
}
|
||||
|
||||
/* now make sure its what we expect */
|
||||
/*
|
||||
* Now make sure its what we expect.
|
||||
*/
|
||||
dns_rdata_init(&found_rdata);
|
||||
dns_rdataset_current(&found_rdataset, &found_rdata);
|
||||
rval = dns_rdata_compare(&added_rdata, &found_rdata);
|
||||
if (rval == 0) {
|
||||
result = T_PASS;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
t_info("dns_rdata_compare returned %d\n", rval);
|
||||
result = T_FAIL;
|
||||
}
|
||||
|
||||
/* don't need these now */
|
||||
/*
|
||||
* Don't need these now.
|
||||
*/
|
||||
dns_db_closeversion(db, &nversionp, ISC_FALSE);
|
||||
if (dns_rdataset_isassociated(&found_rdataset))
|
||||
dns_rdataset_disassociate(&found_rdataset);
|
||||
@ -1116,7 +1123,7 @@ t_dns_db_newversion(char **av) {
|
||||
}
|
||||
|
||||
static void
|
||||
t9() {
|
||||
t9(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_newversion", 9, T_REQUIRED, a9);
|
||||
@ -1182,9 +1189,10 @@ t_dns_db_closeversion_1(char **av) {
|
||||
db = NULL;
|
||||
mctx = NULL;
|
||||
|
||||
/* open a new version, add some data,
|
||||
/*
|
||||
* Open a new version, add some data,
|
||||
* remove some data, close with commit, open the current
|
||||
* version and check that changes are present
|
||||
* version and check that changes are present.
|
||||
*/
|
||||
|
||||
t_info("testing using file %s and name %s\n", filename, new_name);
|
||||
@ -1212,7 +1220,7 @@ t_dns_db_closeversion_1(char **av) {
|
||||
}
|
||||
|
||||
/*
|
||||
* remove all rdata for an existing name
|
||||
* Remove all rdata for an existing name.
|
||||
*/
|
||||
|
||||
dns_fixedname_init(&dns_existingname);
|
||||
@ -1265,7 +1273,8 @@ t_dns_db_closeversion_1(char **av) {
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
dns_result = dns_db_deleterdataset(db, nodep, nversionp, existing_rdatatype, 0);
|
||||
dns_result = dns_db_deleterdataset(db, nodep, nversionp,
|
||||
existing_rdatatype, 0);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
t_info("dns_db_deleterdataset failed %s\n",
|
||||
dns_result_totext(dns_result));
|
||||
@ -1397,7 +1406,7 @@ t_dns_db_closeversion_1(char **av) {
|
||||
&found_rdataset, NULL);
|
||||
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
/* ZZZ NXRRSET ??? reference counting ??? */
|
||||
/* XXXWPK NXRRSET ??? reference counting ??? */
|
||||
t_info("dns_db_find failed %s\n",
|
||||
dns_result_totext(dns_result));
|
||||
dns_db_closeversion(db, &cversionp, ISC_FALSE);
|
||||
@ -1422,7 +1431,9 @@ t_dns_db_closeversion_1(char **av) {
|
||||
return(T_FAIL);
|
||||
}
|
||||
|
||||
/* now make sure its what we expect */
|
||||
/*
|
||||
* Now make sure its what we expect.
|
||||
*/
|
||||
dns_rdata_init(&found_rdata);
|
||||
dns_rdataset_current(&found_rdataset, &found_rdata);
|
||||
rval = dns_rdata_compare(&added_rdata, &found_rdata);
|
||||
@ -1431,7 +1442,9 @@ t_dns_db_closeversion_1(char **av) {
|
||||
++nfails;
|
||||
}
|
||||
|
||||
/* now check the rdata deletion */
|
||||
/*
|
||||
* Now check the rdata deletion.
|
||||
*/
|
||||
|
||||
if (dns_rdataset_isassociated(&found_rdataset))
|
||||
dns_rdataset_disassociate(&found_rdataset);
|
||||
@ -1440,13 +1453,9 @@ t_dns_db_closeversion_1(char **av) {
|
||||
nodep = NULL;
|
||||
dns_fixedname_init(&dns_foundname);
|
||||
|
||||
dns_result = dns_db_find(db,
|
||||
dns_fixedname_name(&dns_existingname),
|
||||
cversionp,
|
||||
existing_rdatatype,
|
||||
0,
|
||||
0,
|
||||
&nodep,
|
||||
dns_result = dns_db_find(db, dns_fixedname_name(&dns_existingname),
|
||||
cversionp, existing_rdatatype,
|
||||
0, 0, &nodep,
|
||||
dns_fixedname_name(&dns_foundname),
|
||||
&found_rdataset, NULL);
|
||||
|
||||
@ -1472,7 +1481,7 @@ t_dns_db_closeversion_1(char **av) {
|
||||
}
|
||||
|
||||
static void
|
||||
t10() {
|
||||
t10(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_closeversion", 10, T_REQUIRED, a10);
|
||||
@ -1539,9 +1548,10 @@ t_dns_db_closeversion_2(char **av) {
|
||||
db = NULL;
|
||||
mctx = NULL;
|
||||
|
||||
/* open a new version, add some data,
|
||||
/*
|
||||
* Open a new version, add some data,
|
||||
* remove some data, close with commit, open the current
|
||||
* version and check that changes are present
|
||||
* version and check that changes are present.
|
||||
*/
|
||||
|
||||
t_info("testing using file %s and name %s\n", filename, new_name);
|
||||
@ -1569,7 +1579,7 @@ t_dns_db_closeversion_2(char **av) {
|
||||
}
|
||||
|
||||
/*
|
||||
* remove all rdata for an existing name
|
||||
* Remove all rdata for an existing name.
|
||||
*/
|
||||
|
||||
dns_fixedname_init(&dns_existingname);
|
||||
@ -1610,7 +1620,9 @@ t_dns_db_closeversion_2(char **av) {
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
/* open a new version */
|
||||
/*
|
||||
* Open a new version.
|
||||
*/
|
||||
nversionp = NULL;
|
||||
dns_result = dns_db_newversion(db, &nversionp);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
@ -1622,7 +1634,8 @@ t_dns_db_closeversion_2(char **av) {
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
dns_result = dns_db_deleterdataset(db, nodep, nversionp, existing_rdatatype, 0);
|
||||
dns_result = dns_db_deleterdataset(db, nodep, nversionp,
|
||||
existing_rdatatype, 0);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
t_info("dns_db_deleterdataset failed %s\n",
|
||||
dns_result_totext(dns_result));
|
||||
@ -1727,24 +1740,23 @@ t_dns_db_closeversion_2(char **av) {
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
/* check that our changes took */
|
||||
/*
|
||||
* Check that our changes took.
|
||||
*/
|
||||
dns_db_detachnode(db, &nodep);
|
||||
nodep = NULL;
|
||||
dns_fixedname_init(&dns_foundname);
|
||||
dns_rdataset_init(&found_rdataset);
|
||||
|
||||
/* find the recently added name and rdata */
|
||||
dns_result = dns_db_find(db,
|
||||
dns_fixedname_name(&dns_newname),
|
||||
nversionp,
|
||||
new_rdatatype,
|
||||
0,
|
||||
0,
|
||||
&nodep,
|
||||
/*
|
||||
* Find the recently added name and rdata.
|
||||
*/
|
||||
dns_result = dns_db_find(db, dns_fixedname_name(&dns_newname),
|
||||
nversionp, new_rdatatype, 0, 0, &nodep,
|
||||
dns_fixedname_name(&dns_foundname),
|
||||
&found_rdataset, NULL);
|
||||
|
||||
if ( (dns_result == ISC_R_NOTFOUND) ||
|
||||
if ((dns_result == ISC_R_NOTFOUND) ||
|
||||
(dns_result == DNS_R_NXDOMAIN) ||
|
||||
(dns_result == DNS_R_NXRRSET)) {
|
||||
|
||||
@ -1772,7 +1784,9 @@ t_dns_db_closeversion_2(char **av) {
|
||||
return(T_FAIL);
|
||||
}
|
||||
|
||||
/* now make sure its what we expect */
|
||||
/*
|
||||
* Now make sure its what we expect.
|
||||
*/
|
||||
dns_rdata_init(&found_rdata);
|
||||
dns_rdataset_current(&found_rdataset, &found_rdata);
|
||||
rval = dns_rdata_compare(&added_rdata, &found_rdata);
|
||||
@ -1781,8 +1795,9 @@ t_dns_db_closeversion_2(char **av) {
|
||||
++nfails;
|
||||
}
|
||||
|
||||
/* now check the rdata deletion */
|
||||
|
||||
/*
|
||||
* Now check the rdata deletion.
|
||||
*/
|
||||
if (dns_rdataset_isassociated(&found_rdataset))
|
||||
dns_rdataset_disassociate(&found_rdataset);
|
||||
dns_rdataset_init(&found_rdataset);
|
||||
@ -1811,16 +1826,22 @@ t_dns_db_closeversion_2(char **av) {
|
||||
}
|
||||
|
||||
|
||||
/* close the version without a commit */
|
||||
/*
|
||||
* Close the version without a commit.
|
||||
*/
|
||||
dns_db_closeversion(db, &nversionp, ISC_FALSE);
|
||||
|
||||
/* open the current version and check changes */
|
||||
/*
|
||||
* Open the current version and check changes.
|
||||
*/
|
||||
dns_fixedname_init(&dns_foundname);
|
||||
dns_rdataset_init(&found_rdataset);
|
||||
cversionp = NULL;
|
||||
dns_db_currentversion(db, &cversionp);
|
||||
|
||||
/* find the recently added name and rdata */
|
||||
/*
|
||||
* Find the recently added name and rdata.
|
||||
*/
|
||||
dns_result = dns_db_find(db,
|
||||
dns_fixedname_name(&dns_newname),
|
||||
cversionp,
|
||||
@ -1842,24 +1863,20 @@ t_dns_db_closeversion_2(char **av) {
|
||||
return(T_FAIL);
|
||||
}
|
||||
|
||||
/* now check the rdata deletion */
|
||||
|
||||
/*
|
||||
* Now check the rdata deletion.
|
||||
*/
|
||||
nodep = NULL;
|
||||
dns_rdataset_init(&found_rdataset);
|
||||
dns_fixedname_init(&dns_foundname);
|
||||
|
||||
dns_result = dns_db_find(db,
|
||||
dns_fixedname_name(&dns_existingname),
|
||||
cversionp,
|
||||
existing_rdatatype,
|
||||
0,
|
||||
0,
|
||||
&nodep,
|
||||
dns_fixedname_name(&dns_foundname),
|
||||
dns_result = dns_db_find(db, dns_fixedname_name(&dns_existingname),
|
||||
cversionp, existing_rdatatype, 0, 0,
|
||||
&nodep, dns_fixedname_name(&dns_foundname),
|
||||
&found_rdataset, NULL);
|
||||
|
||||
|
||||
if ( (dns_result == ISC_R_NOTFOUND) ||
|
||||
if ((dns_result == ISC_R_NOTFOUND) ||
|
||||
(dns_result == DNS_R_NXDOMAIN) ||
|
||||
(dns_result == DNS_R_NXRRSET)) {
|
||||
|
||||
@ -1885,7 +1902,7 @@ t_dns_db_closeversion_2(char **av) {
|
||||
}
|
||||
|
||||
static void
|
||||
t11() {
|
||||
t11(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_closeversion", 11, T_REQUIRED, a11);
|
||||
@ -1937,8 +1954,9 @@ t_dns_db_expirenode(char **av) {
|
||||
|
||||
result = T_UNRESOLVED;
|
||||
|
||||
/* find a node, mark it as stale,
|
||||
* do a dns_db_find on the name and expect it to fail
|
||||
/*
|
||||
* Find a node, mark it as stale, do a dns_db_find on the name and
|
||||
* expect it to fail.
|
||||
*/
|
||||
|
||||
t_info("testing using file %s and name %s\n", filename, existing_name);
|
||||
@ -1987,11 +2005,11 @@ t_dns_db_expirenode(char **av) {
|
||||
|
||||
nodep = NULL;
|
||||
|
||||
/* check that the node is there */
|
||||
dns_result = dns_db_findnode(db,
|
||||
dns_fixedname_name(&dns_existingname),
|
||||
ISC_FALSE,
|
||||
&nodep);
|
||||
/*
|
||||
* Check that the node is there.
|
||||
*/
|
||||
dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_existingname),
|
||||
ISC_FALSE, &nodep);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
t_info("unable to find %s\n", existing_name);
|
||||
dns_db_detach(&db);
|
||||
@ -1999,7 +2017,9 @@ t_dns_db_expirenode(char **av) {
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
/* expire it */
|
||||
/*
|
||||
* Expire it.
|
||||
*/
|
||||
if (node_expire_time != 0)
|
||||
node_expire_time += now;
|
||||
|
||||
@ -2033,20 +2053,19 @@ t_dns_db_expirenode(char **av) {
|
||||
|
||||
if (dns_result == exp_result) {
|
||||
result = T_PASS;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
t_info("dns_db_find %s returned %s\n", existing_name,
|
||||
dns_result_totext(dns_result));
|
||||
result = T_FAIL;
|
||||
}
|
||||
|
||||
if ( (dns_result != ISC_R_NOTFOUND) &&
|
||||
if ((dns_result != ISC_R_NOTFOUND) &&
|
||||
(dns_result != DNS_R_NXDOMAIN) &&
|
||||
(dns_result != DNS_R_NXRRSET)) {
|
||||
|
||||
/*
|
||||
* don't need to disassociate the rdataset because
|
||||
* we're searching with dns_rdatatype_any
|
||||
* Don't need to disassociate the rdataset because
|
||||
* we're searching with dns_rdatatype_any.
|
||||
*/
|
||||
dns_db_detachnode(db, &nodep);
|
||||
}
|
||||
@ -2059,7 +2078,7 @@ t_dns_db_expirenode(char **av) {
|
||||
}
|
||||
|
||||
static void
|
||||
t12() {
|
||||
t12(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_expirenode", 12, T_REQUIRED, a12);
|
||||
@ -2187,16 +2206,14 @@ t_dns_db_findnode_1(char **av) {
|
||||
if (dns_result == ISC_R_SUCCESS) {
|
||||
dns_rdataset_disassociate(&rdataset);
|
||||
result = T_PASS;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
t_info("dns_db_findrdataset failed %s\n",
|
||||
dns_result_totext(dns_result));
|
||||
result = T_FAIL;
|
||||
}
|
||||
dns_db_closeversion(db, &cversionp, ISC_FALSE);
|
||||
dns_db_detachnode(db, &nodep);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
result = T_PASS;
|
||||
}
|
||||
|
||||
@ -2207,7 +2224,7 @@ t_dns_db_findnode_1(char **av) {
|
||||
}
|
||||
|
||||
static void
|
||||
t13() {
|
||||
t13(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_findnode", 13, T_REQUIRED, a13);
|
||||
@ -2284,7 +2301,9 @@ t_dns_db_findnode_2(char **av) {
|
||||
nodep = NULL;
|
||||
dns_fixedname_init(&dns_name);
|
||||
|
||||
/* make sure the name isn't there */
|
||||
/*
|
||||
* Make sure the name isn't there
|
||||
*/
|
||||
len = strlen(newname);
|
||||
isc_buffer_init(&name_buffer, newname, len);
|
||||
isc_buffer_add(&name_buffer, len);
|
||||
@ -2293,10 +2312,9 @@ t_dns_db_findnode_2(char **av) {
|
||||
|
||||
dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_name),
|
||||
ISC_FALSE, &nodep);
|
||||
if ( (dns_result != ISC_R_NOTFOUND) &&
|
||||
if ((dns_result != ISC_R_NOTFOUND) &&
|
||||
(dns_result != DNS_R_NXDOMAIN) &&
|
||||
(dns_result != DNS_R_NXRRSET)) {
|
||||
|
||||
t_info("dns_db_findnode %s\n",
|
||||
dns_result_totext(dns_result));
|
||||
dns_db_detachnode(db, &nodep);
|
||||
@ -2305,7 +2323,9 @@ t_dns_db_findnode_2(char **av) {
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
|
||||
/* add it */
|
||||
/*
|
||||
* Add it.
|
||||
*/
|
||||
dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_name),
|
||||
ISC_TRUE, &nodep);
|
||||
if (dns_result != ISC_R_SUCCESS) {
|
||||
@ -2316,14 +2336,18 @@ t_dns_db_findnode_2(char **av) {
|
||||
return(T_FAIL);
|
||||
}
|
||||
|
||||
/* check it */
|
||||
/*
|
||||
* Check it.
|
||||
*/
|
||||
newnodep = NULL;
|
||||
dns_rdataset_init(&rdataset);
|
||||
dns_fixedname_init(&dns_foundname);
|
||||
cversionp = NULL;
|
||||
dns_db_currentversion(db, &cversionp);
|
||||
|
||||
/* first try dns_db_find DNS_R_NXDOMAIN */
|
||||
/*
|
||||
* First try dns_db_find DNS_R_NXDOMAIN.
|
||||
*/
|
||||
dns_result = dns_db_find(db,
|
||||
dns_fixedname_name(&dns_name),
|
||||
cversionp,
|
||||
@ -2343,13 +2367,15 @@ t_dns_db_findnode_2(char **av) {
|
||||
++nfails;
|
||||
}
|
||||
|
||||
/* then try dns_db_findnode ISC_R_SUCCESS */
|
||||
dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_name), ISC_FALSE, &newnodep);
|
||||
/*
|
||||
* Then try dns_db_findnode ISC_R_SUCCESS.
|
||||
*/
|
||||
dns_result = dns_db_findnode(db, dns_fixedname_name(&dns_name),
|
||||
ISC_FALSE, &newnodep);
|
||||
t_info("dns_db_findnode %s\n", dns_result_totext(dns_result));
|
||||
if (dns_result == ISC_R_SUCCESS) {
|
||||
dns_db_detachnode(db, &newnodep);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
t_info("dns_db_findnode %s failed %s\n", newname,
|
||||
dns_result_totext(dns_result));
|
||||
++nfails;
|
||||
@ -2370,7 +2396,7 @@ t_dns_db_findnode_2(char **av) {
|
||||
}
|
||||
|
||||
static void
|
||||
t14() {
|
||||
t14(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_findnode", 14, T_REQUIRED, a14);
|
||||
@ -2426,7 +2452,8 @@ t_dns_db_find_x(char **av) {
|
||||
mctx = NULL;
|
||||
opts = 0;
|
||||
|
||||
t_info("testing using %s, name %s, type %s\n", dbfile, findname, findtype);
|
||||
t_info("testing using %s, name %s, type %s\n", dbfile, findname,
|
||||
findtype);
|
||||
|
||||
isc_result = isc_mem_create(0, 0, &mctx);
|
||||
if (isc_result != ISC_R_SUCCESS) {
|
||||
@ -2512,8 +2539,7 @@ t_dns_db_find_x(char **av) {
|
||||
findname, findtype, dns_result_totext(dns_result),
|
||||
dns_result_totext(exp_result));
|
||||
result = T_FAIL;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
result = T_PASS;
|
||||
}
|
||||
|
||||
@ -2540,7 +2566,7 @@ static char *a15 =
|
||||
"of 'db'.";
|
||||
|
||||
static void
|
||||
t15() {
|
||||
t15(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_find", 15, T_REQUIRED, a15);
|
||||
@ -2556,7 +2582,7 @@ static char *a16 =
|
||||
"returns DNS_R_GLUE.";
|
||||
|
||||
static void
|
||||
t16() {
|
||||
t16(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_find", 16, T_REQUIRED, a16);
|
||||
@ -2569,7 +2595,7 @@ static char *a17 =
|
||||
"requested is beneath a zone cut.";
|
||||
|
||||
static void
|
||||
t17() {
|
||||
t17(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_find", 17, T_REQUIRED, a17);
|
||||
@ -2582,7 +2608,7 @@ static char *a18 =
|
||||
"dns_rdatatype_any and the desired node is a zone cut.";
|
||||
|
||||
static void
|
||||
t18() {
|
||||
t18(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_find", 18, T_REQUIRED, a18);
|
||||
@ -2595,7 +2621,7 @@ static char *a19 =
|
||||
"requested is beneath a DNAME.";
|
||||
|
||||
static void
|
||||
t19() {
|
||||
t19(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_find", 19, T_REQUIRED, a19);
|
||||
@ -2608,7 +2634,7 @@ static char *a20 =
|
||||
"rdataset was not found but there is a CNAME at the desired name.";
|
||||
|
||||
static void
|
||||
t20() {
|
||||
t20(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_find", 20, T_REQUIRED, a20);
|
||||
@ -2621,7 +2647,7 @@ static char *a21 =
|
||||
"does not exist.";
|
||||
|
||||
static void
|
||||
t21() {
|
||||
t21(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_find", 21, T_REQUIRED, a21);
|
||||
@ -2634,7 +2660,7 @@ static char *a22 =
|
||||
"the desired name exists, but the desired type does not.";
|
||||
|
||||
static void
|
||||
t22() {
|
||||
t22(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_find", 22, T_REQUIRED, a22);
|
||||
@ -2648,7 +2674,7 @@ static char *a23 =
|
||||
"and no delegation could be found.";
|
||||
|
||||
static void
|
||||
t23() {
|
||||
t23(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_find", 23, T_REQUIRED, a23);
|
||||
@ -2661,7 +2687,7 @@ static char *a24 =
|
||||
"if at least one rdataset at the found node expires after 'now'.";
|
||||
|
||||
static void
|
||||
t24() {
|
||||
t24(void) {
|
||||
int result;
|
||||
|
||||
t_assert("dns_db_find", 24, T_REQUIRED, a24);
|
||||
|
Loading…
x
Reference in New Issue
Block a user