diff options
author | Michael Adam <obnox@samba.org> | 2012-03-18 23:40:18 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-03-19 02:30:39 +0100 |
commit | ee0e1ca5d8bbd03be5df23ecce504115e2e5012f (patch) | |
tree | 3a124063b6d7cc3032265953721e1cd05b64197c | |
parent | 704f0683f0d9e9ec9b1270b621096cfc238af7e0 (diff) | |
download | samba-ee0e1ca5d8bbd03be5df23ecce504115e2e5012f.tar.gz samba-ee0e1ca5d8bbd03be5df23ecce504115e2e5012f.tar.bz2 samba-ee0e1ca5d8bbd03be5df23ecce504115e2e5012f.zip |
s4:selftest: add test for "samba-tool group list"
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon Mar 19 02:30:39 CET 2012 on sn-devel-104
-rw-r--r-- | source4/scripting/python/samba/tests/samba_tool/group.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/samba_tool/group.py b/source4/scripting/python/samba/tests/samba_tool/group.py index 7831674418..be10716f46 100644 --- a/source4/scripting/python/samba/tests/samba_tool/group.py +++ b/source4/scripting/python/samba/tests/samba_tool/group.py @@ -97,6 +97,28 @@ class GroupCmdTestCase(SambaToolCmdTest): "%s" % group["name"]) + def test_list(self): + (result, out, err) = self.runsubcmd("group", "list", + "-H", "ldap://%s" % os.environ["DC_SERVER"], + "-U%s%%%s" % (os.environ["DC_USERNAME"], + os.environ["DC_PASSWORD"])) + self.assertCmdSuccess(result, "Error running list") + + search_filter = "(objectClass=group)" + + grouplist = self.samdb.search(base=self.samdb.domain_dn(), + scope=ldb.SCOPE_SUBTREE, + expression=search_filter, + attrs=["samaccountname"]) + + self.assertTrue(len(grouplist) > 0, "no groups found in samdb") + + for groupobj in grouplist: + name = groupobj.get("samaccountname", idx=0) + found = self.assertMatch(out, name, + "group '%s' not found" % name) + + def _randomGroup(self, base={}): """create a group with random attribute values, you can specify base attributes""" group = { |