mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
samba-tool tests: add test case for 'computer list --full-dn'
Check if the --full-dn option displays DN instead of the sAMAccountName. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
29326e3264
commit
2e767e81be
@ -190,6 +190,25 @@ class ComputerCmdTestCase(SambaToolCmdTest):
|
||||
found = self.assertMatch(out, str(name),
|
||||
"computer '%s' not found" % name)
|
||||
|
||||
def test_list_full_dn(self):
|
||||
(result, out, err) = self.runsubcmd("computer", "list", "--full-dn")
|
||||
self.assertCmdSuccess(result, out, err, "Error running list")
|
||||
|
||||
search_filter = ("(sAMAccountType=%u)" %
|
||||
dsdb.ATYPE_WORKSTATION_TRUST)
|
||||
|
||||
computerlist = self.samdb.search(base=self.samdb.domain_dn(),
|
||||
scope=ldb.SCOPE_SUBTREE,
|
||||
expression=search_filter,
|
||||
attrs=[])
|
||||
|
||||
self.assertTrue(len(computerlist) > 0, "no computers found in samdb")
|
||||
|
||||
for computerobj in computerlist:
|
||||
name = computerobj.get("dn", idx=0)
|
||||
found = self.assertMatch(out, str(name),
|
||||
"computer '%s' not found" % name)
|
||||
|
||||
def test_move(self):
|
||||
parentou = self._randomOU({"name": "parentOU"})
|
||||
(result, out, err) = self._create_ou(parentou)
|
||||
|
Loading…
Reference in New Issue
Block a user