tests/samba-tool: test dns serverinfo/zoneinfo
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 29 May 2019 01:38:12 +0000 (13:38 +1200)
committerNoel Power <npower@samba.org>
Wed, 29 May 2019 10:10:23 +0000 (10:10 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
python/samba/tests/samba_tool/dnscmd.py
selftest/knownfail.d/sambatool-dns [new file with mode: 0644]

index 5e882972f464f53e9e02049f4f97bdbf5304f567..e1459fee9acbd1930f467734497760f7df6f7a41 100644 (file)
@@ -883,3 +883,29 @@ class DnsCmdTestCase(SambaToolCmdTest):
                 print(msg)
             self.fail("Failed to accept valid commands. %d total failures."
                       "Errors above." % num_failures)
                 print(msg)
             self.fail("Failed to accept valid commands. %d total failures."
                       "Errors above." % num_failures)
+
+    def test_serverinfo(self):
+        for v in ['w2k', 'dotnet', 'longhorn']:
+            result, out, err = self.runsubcmd("dns",
+                                              "serverinfo",
+                                              "--client-version", v,
+                                              os.environ["SERVER"],
+                                              self.creds_string)
+            self.assertCmdSuccess(result,
+                                  out,
+                                  err,
+                                  "Failed to print serverinfo with "
+                                  "client version %s" % v)
+            self.assertTrue(out != '')
+
+    def test_zoneinfo(self):
+        result, out, err = self.runsubcmd("dns",
+                                          "zoneinfo",
+                                          os.environ["SERVER"],
+                                          self.zone,
+                                          self.creds_string)
+        self.assertCmdSuccess(result,
+                              out,
+                              err,
+                              "Failed to print zoneinfo")
+        self.assertTrue(out != '')
diff --git a/selftest/knownfail.d/sambatool-dns b/selftest/knownfail.d/sambatool-dns
new file mode 100644 (file)
index 0000000..382d740
--- /dev/null
@@ -0,0 +1 @@
+samba.tests.samba_tool.dnscmd.samba.tests.samba_tool.dnscmd.DnsCmdTestCase.test_serverinfo