summaryrefslogtreecommitdiff
path: root/source4/torture/dns
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2017-08-22 17:10:01 +0200
committerJeremy Allison <jra@samba.org>2017-09-05 23:58:20 +0200
commit3fa7c43ef73b6582e8985bf6d82465ffded9e5db (patch)
tree2511f5d780f4f03994ba9cfd737d583bac67280d /source4/torture/dns
parent4c9608fb27b0f1bef846b72291ecb515045d3507 (diff)
downloadsamba-3fa7c43ef73b6582e8985bf6d82465ffded9e5db.tar.gz
s4:bind_dlz: Use the 'binddns dir' if possible
The code makes sure we are backwards compatible. It will first check if we still have files in the private directory, if yes it will use those. If the the file is not in the private directory it will try the binddns dir. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Diffstat (limited to 'source4/torture/dns')
-rw-r--r--source4/torture/dns/dlz_bind9.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/source4/torture/dns/dlz_bind9.c b/source4/torture/dns/dlz_bind9.c
index c29f26802f5..893158fa730 100644
--- a/source4/torture/dns/dlz_bind9.c
+++ b/source4/torture/dns/dlz_bind9.c
@@ -19,7 +19,7 @@
#include "includes.h"
#include "torture/smbtorture.h"
-#include "dlz_minimal.h"
+#include "dns_server/dlz_minimal.h"
#include <talloc.h>
#include <ldb.h>
#include "lib/param/param.h"
@@ -54,13 +54,22 @@ static bool test_dlz_bind9_version(struct torture_context *tctx)
return true;
}
+static char *test_dlz_bind9_binddns_dir(struct torture_context *tctx,
+ const char *file)
+{
+ return talloc_asprintf(tctx,
+ "%s/%s",
+ lpcfg_binddns_dir(tctx->lp_ctx),
+ file);
+}
+
static bool test_dlz_bind9_create(struct torture_context *tctx)
{
void *dbdata;
const char *argv[] = {
"samba_dlz",
"-H",
- lpcfg_private_path(tctx, tctx->lp_ctx, "dns/sam.ldb"),
+ test_dlz_bind9_binddns_dir(tctx, "dns/sam.ldb"),
NULL
};
tctx_static = tctx;
@@ -79,7 +88,8 @@ static isc_result_t dlz_bind9_writeable_zone_hook(dns_view_t *view,
struct torture_context *tctx = talloc_get_type((void *)view, struct torture_context);
struct ldb_context *samdb = samdb_connect_url(tctx, NULL, tctx->lp_ctx,
system_session(tctx->lp_ctx),
- 0, lpcfg_private_path(tctx, tctx->lp_ctx, "dns/sam.ldb"));
+ 0,
+ test_dlz_bind9_binddns_dir(tctx, "dns/sam.ldb"));
struct ldb_message *msg;
int ret;
const char *attrs[] = {
@@ -108,7 +118,7 @@ static bool test_dlz_bind9_configure(struct torture_context *tctx)
const char *argv[] = {
"samba_dlz",
"-H",
- lpcfg_private_path(tctx, tctx->lp_ctx, "dns/sam.ldb"),
+ test_dlz_bind9_binddns_dir(tctx, "dns/sam.ldb"),
NULL
};
tctx_static = tctx;
@@ -143,7 +153,7 @@ static bool test_dlz_bind9_gensec(struct torture_context *tctx, const char *mech
const char *argv[] = {
"samba_dlz",
"-H",
- lpcfg_private_path(tctx, tctx->lp_ctx, "dns/sam.ldb"),
+ test_dlz_bind9_binddns_dir(tctx, "dns/sam.ldb"),
NULL
};
tctx_static = tctx;
@@ -323,7 +333,7 @@ static bool test_dlz_bind9_lookup(struct torture_context *tctx)
const char *argv[] = {
"samba_dlz",
"-H",
- lpcfg_private_path(tctx, tctx->lp_ctx, "dns/sam.ldb"),
+ test_dlz_bind9_binddns_dir(tctx, "dns/sam.ldb"),
NULL
};
struct test_expected_rr *expected1 = NULL;
@@ -448,7 +458,7 @@ static bool test_dlz_bind9_zonedump(struct torture_context *tctx)
const char *argv[] = {
"samba_dlz",
"-H",
- lpcfg_private_path(tctx, tctx->lp_ctx, "dns/sam.ldb"),
+ test_dlz_bind9_binddns_dir(tctx, "dns/sam.ldb"),
NULL
};
struct test_expected_rr *expected1 = NULL;
@@ -560,7 +570,7 @@ static bool test_dlz_bind9_update01(struct torture_context *tctx)
const char *argv[] = {
"samba_dlz",
"-H",
- lpcfg_private_path(tctx, tctx->lp_ctx, "dns/sam.ldb"),
+ test_dlz_bind9_binddns_dir(tctx, "dns/sam.ldb"),
NULL
};
struct test_expected_rr *expected1 = NULL;