mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
samba-tool: Test creating unix user with modified template homedir
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
0c461f3bd5
commit
38fcad60a8
@ -41,6 +41,12 @@ class UserCmdTestCase(SambaToolCmdTest):
|
||||
super(UserCmdTestCase, self).setUp()
|
||||
self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"],
|
||||
"-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
|
||||
|
||||
# Modify the default template homedir
|
||||
lp = self.get_loadparm()
|
||||
self.template_homedir = lp.get('template homedir')
|
||||
lp.set('template homedir', '/home/test/%D/%U')
|
||||
|
||||
self.users = []
|
||||
self.users.append(self._randomUser({"name": "sambatool1", "company": "comp1"}))
|
||||
self.users.append(self._randomUser({"name": "sambatool2", "company": "comp1"}))
|
||||
@ -83,6 +89,7 @@ class UserCmdTestCase(SambaToolCmdTest):
|
||||
cachedb = lp.private_path("user-syncpasswords-cache.ldb")
|
||||
if os.path.exists(cachedb):
|
||||
os.remove(cachedb)
|
||||
lp.set('template homedir', self.template_homedir)
|
||||
|
||||
def test_newuser(self):
|
||||
# try to add all the users again, this should fail
|
||||
@ -645,6 +652,7 @@ template """
|
||||
self.assertEqual("%s" % found.get("gidNumber"), "%s" %
|
||||
user["gidNumber"])
|
||||
self.assertEqual("%s" % found.get("uid"), user["uid"])
|
||||
self.assertIn('/home/test/', "%s" % found.get("unixHomeDirectory"))
|
||||
self._check_user(user)
|
||||
|
||||
def _create_user(self, user):
|
||||
|
1
selftest/knownfail.d/samba-tool
Normal file
1
selftest/knownfail.d/samba-tool
Normal file
@ -0,0 +1 @@
|
||||
samba.tests.samba_tool.user.samba.tests.samba_tool.user.UserCmdTestCase
|
Loading…
Reference in New Issue
Block a user