selftest: Run samba-tool domain demote while we have a clone of the DB handy
authorAndrew Bartlett <abartlet@samba.org>
Tue, 13 Oct 2015 02:23:55 +0000 (15:23 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 26 Oct 2015 04:11:22 +0000 (05:11 +0100)
This avoids needing to run the demote on the main replicated DB
of the selftest system

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/tests/blackbox/samba_tool_drs.py

index 2ba8d89b280ba29673a913eeea979a79afde9b87..b65f5af0f08969d9a3456b4b51c01113b7d91a4e 100644 (file)
@@ -162,6 +162,11 @@ class SambaToolDrsTests(samba.tests.BlackboxTestCase):
         # The clone should pretend to be the source server
         self.assertEqual(ds_name, server_ds_name)
         self.assertEqual(ldap_service_name, server_ldap_service_name)
+
+        # While we have this cloned, try demoting the other server on the clone
+        out = self.check_output("samba-tool domain demote --remove-other-dead-server=%s -H %s/private/sam.ldb"
+                                % (self.dc2,
+                                   self.tempdir))
         shutil.rmtree(os.path.join(self.tempdir, "private"))
         shutil.rmtree(os.path.join(self.tempdir, "etc"))
         shutil.rmtree(os.path.join(self.tempdir, "msg.lock"))