diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2011-02-18 04:09:45 +0200 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2011-02-20 23:13:10 +0200 |
commit | 288e20cfb7c7e39bfd07626c77a9a0eaa8955bcf (patch) | |
tree | 5e9f7dc49e6fe6049fc03f7c24478fde0079096f /source4 | |
parent | 75856d53cb0d733c4df3a58708eb9f272260c176 (diff) | |
download | samba-288e20cfb7c7e39bfd07626c77a9a0eaa8955bcf.tar.gz samba-288e20cfb7c7e39bfd07626c77a9a0eaa8955bcf.tar.bz2 samba-288e20cfb7c7e39bfd07626c77a9a0eaa8955bcf.zip |
s4/drs-tests: Split samba-tool command line generation into separate method
so we can use to exec samba-tool passing different commands
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/drs/python/drs_base.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source4/torture/drs/python/drs_base.py b/source4/torture/drs/python/drs_base.py index f6ae439e79..7a56e43720 100644 --- a/source4/torture/drs/python/drs_base.py +++ b/source4/torture/drs/python/drs_base.py @@ -88,17 +88,22 @@ class DrsBaseTestCase(samba.tests.BlackboxTestCase): def _make_obj_name(self, prefix): return prefix + time.strftime("%s", time.gmtime()) - def _net_drs_replicate(self, DC, fromDC, nc_dn=None): - if nc_dn is None: - nc_dn = self.domain_dn + def _samba_tool_cmdline(self, drs_command): # find out where is net command samba_tool_cmd = os.path.abspath("./bin/samba-tool") # make command line credentials string creds = self.get_credentials() - cmd_line_auth = "-U%s/%s%%%s" % (creds.get_domain(), - creds.get_username(), creds.get_password()) + cmdline_auth = "-U%s/%s%%%s" % (creds.get_domain(), + creds.get_username(), creds.get_password()) + # bin/samba-tool drs <drs_command> <cmdline_auth> + return "%s drs %s %s" % (samba_tool_cmd, drs_command, cmdline_auth) + + def _net_drs_replicate(self, DC, fromDC, nc_dn=None): + if nc_dn is None: + nc_dn = self.domain_dn + # make base command line + samba_tool_cmdline = self._samba_tool_cmdline("replicate") # bin/samba-tool drs replicate <Dest_DC_NAME> <Src_DC_NAME> <Naming Context> - cmd_line = "%s drs replicate %s %s %s %s" % (samba_tool_cmd, DC, fromDC, - nc_dn, cmd_line_auth) + cmd_line = "%s %s %s %s" % (samba_tool_cmdline, DC, fromDC, nc_dn) self.check_run(cmd_line) |