samba_dnsupdate: Add additional debugging
authorGarming Sam <garming@catalyst.net.nz>
Sun, 26 Feb 2017 22:39:51 +0000 (11:39 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 27 Mar 2017 22:04:54 +0000 (00:04 +0200)
Tests are still flapping, because it claims it needs a cache rebuild.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Mar 28 00:04:54 CEST 2017 on sn-devel-144

python/samba/tests/blackbox/samba_dnsupdate.py
source4/scripting/bin/samba_dnsupdate

index ee8ae2673f45d02ff6dc493be167d39171631ebc..7ddaab7cff49d153cbf28bf2653e2e5e2947b3f6 100644 (file)
@@ -49,11 +49,11 @@ class SambaDnsUpdateTests(samba.tests.BlackboxTestCase):
 
         self.assertTrue("No DNS updates needed" in out, out)
         try:
-            out = self.check_output("samba_dnsupdate --verbose --use-samba-tool --rpc-server-ip=%s" % self.server_ip)
+            rpc_out = self.check_output("samba_dnsupdate --verbose --use-samba-tool --rpc-server-ip=%s" % self.server_ip)
         except samba.tests.BlackboxProcessError as e:
             self.fail("Error calling samba_dnsupdate: %s" % e)
 
-        self.assertTrue(" DNS updates and" in out, out)
-        self.assertTrue(" DNS deletes needed" in out, out)
+        self.assertTrue(" DNS updates and" in rpc_out, rpc_out)
+        self.assertTrue(" DNS deletes needed" in rpc_out, rpc_out)
         out = self.check_output("samba_dnsupdate --verbose")
-        self.assertTrue("No DNS updates needed" in out, out)
+        self.assertTrue("No DNS updates needed" in out, out + rpc_out)
index 1633561e17331360806eceef2f43acf40b57ecf1..06877038e1f859b1b774d5a01d84a4c0b950f420 100755 (executable)
@@ -749,6 +749,8 @@ for d in dns_list:
             break
     if not found:
         rebuild_cache = True
+        if opts.verbose:
+            print "need cache add: %s" % d
     if opts.all_names:
         update_list.append(d)
         if opts.verbose:
@@ -768,6 +770,8 @@ for c in cache_list:
     if found:
         continue
     rebuild_cache = True
+    if opts.verbose:
+        print "need cache remove: %s" % c
     if not opts.all_names and not check_dns_name(c):
         continue
     delete_list.append(c)