tests:samba_tool_drs: test samba-tool drs replicate with --async-op
authorStefan Metzmacher <metze@samba.org>
Thu, 28 Jul 2016 06:29:39 +0000 (08:29 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 28 Jul 2016 08:06:11 +0000 (10:06 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@samba.org>
python/samba/tests/blackbox/samba_tool_drs.py

index 27d3885e6ced8185d04b937a16df8d16ed3f6b07..90921f4a9be6c13ac59ee197e5c9528e986cdf06 100644 (file)
@@ -103,6 +103,18 @@ class SambaToolDrsTests(samba.tests.BlackboxTestCase):
         self.assertTrue("Replicate from" in out)
         self.assertTrue("was successful" in out)
 
+    def test_samba_tool_replicate_async(self):
+        """Tests 'samba-tool drs replicate --async-op' command."""
+
+        # Output should be like 'Replicate from <DC-SRC> to <DC-DEST> was started.'
+        nc_name = self._get_rootDSE(self.dc1)["defaultNamingContext"]
+        out = self.check_output("samba-tool drs replicate --async-op %s %s %s %s" % (self.dc1,
+                                                                          self.dc2,
+                                                                          nc_name,
+                                                                          self.cmdline_creds))
+        self.assertTrue("Replicate from" in out)
+        self.assertTrue("was started" in out)
+
     def test_samba_tool_replicate_local_online(self):
         """Tests 'samba-tool drs replicate --local-online' command."""
 
@@ -114,6 +126,17 @@ class SambaToolDrsTests(samba.tests.BlackboxTestCase):
         self.assertTrue("Replicate from" in out)
         self.assertTrue("was successful" in out)
 
+    def test_samba_tool_replicate_local_online_async(self):
+        """Tests 'samba-tool drs replicate --local-online --async-op' command."""
+
+        # Output should be like 'Replicate from <DC-SRC> to <DC-DEST> was started.'
+        nc_name = self._get_rootDSE(self.dc1)["defaultNamingContext"]
+        out = self.check_output("samba-tool drs replicate --local-online --async-op %s %s %s" % (self.dc1,
+                                                                                      self.dc2,
+                                                                                      nc_name))
+        self.assertTrue("Replicate from" in out)
+        self.assertTrue("was started" in out)
+
     def test_samba_tool_replicate_local_machine_creds(self):
         """Tests 'samba-tool drs replicate --local -P' command (uses machine creds)."""