1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-30 19:42:05 +03:00

samba-tool tests: Add test-case for 'group 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:
Jule Anger
2019-08-27 11:49:12 +02:00
committed by Stefan Metzmacher
parent 51d4c82f3c
commit e64f7de31f

View File

@ -173,6 +173,27 @@ class GroupCmdTestCase(SambaToolCmdTest):
"Command='%s'\nLDAP='%s'" %(output_memberships,
ldap_memberships))
def test_list_full_dn(self):
(result, out, err) = self.runsubcmd("group", "list", "--full-dn",
"-H", "ldap://%s" % os.environ["DC_SERVER"],
"-U%s%%%s" % (os.environ["DC_USERNAME"],
os.environ["DC_PASSWORD"]))
self.assertCmdSuccess(result, out, err, "Error running list")
search_filter = "(objectClass=group)"
grouplist = self.samdb.search(base=self.samdb.domain_dn(),
scope=ldb.SCOPE_SUBTREE,
expression=search_filter,
attrs=[])
self.assertTrue(len(grouplist) > 0, "no groups found in samdb")
for groupobj in grouplist:
name = str(groupobj.get("dn", idx=0))
found = self.assertMatch(out, name,
"group '%s' not found" % name)
def test_listmembers(self):
(result, out, err) = self.runsubcmd("group", "listmembers", "Domain Users",
"-H", "ldap://%s" % os.environ["DC_SERVER"],