dlz: Add test to ensure there are writable zones
authorGarming Sam <garming@catalyst.net.nz>
Thu, 21 Mar 2019 03:12:26 +0000 (16:12 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 26 Mar 2019 03:03:23 +0000 (03:03 +0000)
This is currently broken since 28e2a518ff32

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13841

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/knownfail.d/bind9-dlz [new file with mode: 0644]
source4/torture/dns/dlz_bind9.c

diff --git a/selftest/knownfail.d/bind9-dlz b/selftest/knownfail.d/bind9-dlz
new file mode 100644 (file)
index 0000000..84fc82f
--- /dev/null
@@ -0,0 +1,2 @@
+^samba4.dlz_bind9.configure.configure.*
+^samba4.dlz_bind9.multipleconfigure.multipleconfigure.*
index a627e2351f7f912f40a45fb423166b1a7b5c16c9..e5aec26e20a5b768c180288777d2e0decda32d0c 100644 (file)
@@ -85,6 +85,8 @@ static bool test_dlz_bind9_create(struct torture_context *tctx)
        return true;
 }
 
+static bool calls_zone_hook = false;
+
 static isc_result_t dlz_bind9_writeable_zone_hook(dns_view_t *view,
                                           const char *zone_name)
 {
@@ -119,6 +121,8 @@ static isc_result_t dlz_bind9_writeable_zone_hook(dns_view_t *view,
        }
        talloc_free(msg);
 
+       calls_zone_hook = true;
+
        return ISC_R_SUCCESS;
 }
 
@@ -138,12 +142,15 @@ static bool test_dlz_bind9_configure(struct torture_context *tctx)
                                 ISC_R_SUCCESS,
                                 "Failed to create samba_dlz");
 
+       calls_zone_hook = false;
        torture_assert_int_equal(tctx, dlz_configure((void*)tctx, dbdata),
                                                     ISC_R_SUCCESS,
                                 "Failed to configure samba_dlz");
 
        dlz_destroy(dbdata);
 
+       torture_assert_int_equal(tctx, calls_zone_hook, 1, "Hasn't called zone hook");
+
        return true;
 }