summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2018-02-02 15:59:38 +1300
committerAndrew Bartlett <abartlet@samba.org>2018-02-15 00:18:29 +0100
commitcec3646c5d2ac47df129f16f8994c332e2ad06c3 (patch)
treea5f2ee724dd07a73b83e55570d7fc81b59105ac8
parent92ec01dcf080901eb4c208b208651ae03e77f538 (diff)
downloadsamba-cec3646c5d2ac47df129f16f8994c332e2ad06c3.tar.gz
tests: move samba-tool drs showrepl into its own suite
This is a simple copy of the sowrepl test to the new file, making room to expand the test and (soon) to test JSON output. pep-8 intentionally ignored to show this is a copy. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rwxr-xr-xsource4/selftest/tests.py5
-rw-r--r--source4/torture/drs/python/samba_tool_drs.py20
-rw-r--r--source4/torture/drs/python/samba_tool_drs_showrepl.py59
3 files changed, 64 insertions, 20 deletions
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index c64101ff463..49d1bbbd072 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -859,6 +859,11 @@ for env in ['vampire_dc', 'promoted_dc']:
name="samba4.drs.samba_tool_drs.python(%s)" % env,
environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
+ planoldpythontestsuite("%s:local" % env, "samba_tool_drs_showrepl",
+ extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
+ name="samba4.drs.samba_tool_drs_showrepl.python(%s)" % env,
+ environ={'DC1': '$DC_SERVER', 'DC2': '$%s_SERVER' % env.upper()},
+ extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
planoldpythontestsuite("%s:local" % env, "replica_sync",
extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
name="samba4.drs.replica_sync.python(%s)" % env,
diff --git a/source4/torture/drs/python/samba_tool_drs.py b/source4/torture/drs/python/samba_tool_drs.py
index 669f9e1e85f..fcc681dc9e4 100644
--- a/source4/torture/drs/python/samba_tool_drs.py
+++ b/source4/torture/drs/python/samba_tool_drs.py
@@ -80,26 +80,6 @@ class SambaToolDrsTests(drs_base.DrsBaseTestCase):
self.assertTrue("Consistency check on" in out)
self.assertTrue("successful" in out)
- def test_samba_tool_showrepl(self):
- """Tests 'samba-tool drs showrepl' command.
- """
- # Output should be like:
- # <site-name>/<domain-name>
- # DSA Options: <hex-options>
- # DSA object GUID: <DSA-object-GUID>
- # DSA invocationId: <DSA-invocationId>
- # <Inbound-connections-list>
- # <Outbound-connections-list>
- # <KCC-objects>
- # ...
- # TODO: Perhaps we should check at least for
- # DSA's objectGUDI and invocationId
- out = self.check_output("samba-tool drs showrepl %s %s" % (self.dc1,
- self.cmdline_creds))
- self.assertTrue("DSA Options:" in out)
- self.assertTrue("DSA object GUID:" in out)
- self.assertTrue("DSA invocationId:" in out)
-
def test_samba_tool_options(self):
"""Tests 'samba-tool drs options' command
"""
diff --git a/source4/torture/drs/python/samba_tool_drs_showrepl.py b/source4/torture/drs/python/samba_tool_drs_showrepl.py
new file mode 100644
index 00000000000..08babb200a9
--- /dev/null
+++ b/source4/torture/drs/python/samba_tool_drs_showrepl.py
@@ -0,0 +1,59 @@
+# Blackbox tests for "samba-tool drs" command
+# Copyright (C) Kamen Mazdrashki <kamenim@samba.org> 2011
+# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2017
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""Blackbox tests for samba-tool drs showrepl."""
+from __future__ import print_function
+import samba.tests
+import shutil
+import os
+import ldb
+import drs_base
+
+class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase):
+ """Blackbox test case for samba-tool drs."""
+
+ def setUp(self):
+ super(SambaToolDrsShowReplTests, self).setUp()
+
+ self.dc1 = samba.tests.env_get_var_value("DC1")
+ self.dc2 = samba.tests.env_get_var_value("DC2")
+
+ creds = self.get_credentials()
+ self.cmdline_creds = "-U%s/%s%%%s" % (creds.get_domain(),
+ creds.get_username(), creds.get_password())
+
+ def test_samba_tool_showrepl(self):
+ """Tests 'samba-tool drs showrepl' command.
+ """
+ # Output should be like:
+ # <site-name>/<domain-name>
+ # DSA Options: <hex-options>
+ # DSA object GUID: <DSA-object-GUID>
+ # DSA invocationId: <DSA-invocationId>
+ # <Inbound-connections-list>
+ # <Outbound-connections-list>
+ # <KCC-objects>
+ # ...
+ # TODO: Perhaps we should check at least for
+ # DSA's objectGUDI and invocationId
+ out = self.check_output("samba-tool drs showrepl %s %s" % (self.dc1,
+ self.cmdline_creds))
+
+ self.assertTrue("DSA Options:" in out)
+ self.assertTrue("DSA object GUID:" in out)
+ self.assertTrue("DSA invocationId:" in out)