Skip to content

Commit

Permalink
selftest: Use self.runsubcmd() to run samba-tool for _test_join in ri…
Browse files Browse the repository at this point in the history
…dalloc_exop.py

This is the standard way to run samba-tool from in the test scripts and allows
assertion that the command ran as expected

Signed-off-by: Andrew Bartlett <[email protected]>
Reviewed-by: Douglas Bagnall <[email protected]>
  • Loading branch information
abartlet committed Jul 27, 2017
1 parent f7089c0 commit 37cf29e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions source4/torture/drs/python/ridalloc_exop.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,14 @@ def test_offline_samba_tool_seized_ridalloc(self):
def _test_join(self, server, netbios_name):
tmpdir = os.path.join(self.tempdir, "targetdir")
creds = self.get_credentials()
cmd = cmd_sambatool.subcommands['domain'].subcommands['join']
result = cmd._run("samba-tool domain join",
creds.get_realm(),
"dc", "-U%s%%%s" % (creds.get_username(),
creds.get_password()),
'--targetdir=%s' % tmpdir,
'--server=%s' % server,
"--option=netbios name = %s" % netbios_name)
(result, out, err) = self.runsubcmd("domain", "join",
creds.get_realm(),
"dc", "-U%s%%%s" % (creds.get_username(),
creds.get_password()),
'--targetdir=%s' % tmpdir,
'--server=%s' % server,
"--option=netbios name = %s" % netbios_name)
self.assertCmdSuccess(result, out, err)
return tmpdir

def _test_force_demote(self, server, netbios_name):
Expand Down

0 comments on commit 37cf29e

Please sign in to comment.