tests/samba-tool: test dns serverinfo/zoneinfo
[metze/samba/wip.git] / python / samba / tests / samba_tool / dnscmd.py
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)
+
+    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 != '')