diff options
author | Brendan Powers <brendan0powers@gmail.com> | 2009-12-14 20:51:10 -0500 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-12-18 14:27:44 +1100 |
commit | 7cb858e1516e7900fddc08d8f69dfa8d003a587f (patch) | |
tree | 0d175a1e2c2664121d8f77affe50fc566fae82f2 /source4 | |
parent | 08060068bf9ad7cc5f450e805b0caab30d407a56 (diff) | |
download | samba-7cb858e1516e7900fddc08d8f69dfa8d003a587f.tar.gz samba-7cb858e1516e7900fddc08d8f69dfa8d003a587f.tar.bz2 samba-7cb858e1516e7900fddc08d8f69dfa8d003a587f.zip |
s4-dsdb: Add a test for adding, deleting, and appending a posixAccount objectClass to a user
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/lib/ldb/tests/python/ldap.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py index d0a0ed2da5..54b623a903 100755 --- a/source4/lib/ldb/tests/python/ldap.py +++ b/source4/lib/ldb/tests/python/ldap.py @@ -1719,6 +1719,36 @@ member: CN=ldaptestutf8user èùéìòà,CN=Users,""" + self.base_dn + """ res = ldb.search(self.base_dn, expression="objectCategory=group", scope=SCOPE_SUBTREE, attrs=["cn"], controls=["domain_scope:1"]) self.assertTrue(len(res) > 0) + print "Testing creating a user with the posixAccount objectClass" + self.ldb.add_ldif("""dn: cn=posixuser,CN=Users,%s +objectClass: top +objectClass: person +objectClass: posixAccount +objectClass: user +objectClass: organizationalPerson +cn: posixuser +uid: posixuser +sn: posixuser +uidNumber: 10126 +gidNumber: 10126 +homeDirectory: /home/posixuser +loginShell: /bin/bash +gecos: Posix User;;; +description: A POSIX user"""% (self.base_dn)) + + print "Testing removing the posixAccount objectClass from an existing user" + self.ldb.modify_ldif("""dn: cn=posixuser,CN=Users,%s +changetype: modify +delete: objectClass +objectClass: posixAccount"""% (self.base_dn)) + + print "Testing adding the posixAccount objectClass to an existing user" + self.ldb.modify_ldif("""dn: cn=posixuser,CN=Users,%s +changetype: modify +add: objectClass +objectClass: posixAccount"""% (self.base_dn)) + + self.delete_force(self.ldb, "cn=posixuser,cn=users," + self.base_dn) self.delete_force(self.ldb, "cn=ldaptestuser,cn=users," + self.base_dn) self.delete_force(self.ldb, "cn=ldaptestuser2,cn=users," + self.base_dn) self.delete_force(self.ldb, "cn=ldaptestuser3,cn=users," + self.base_dn) |