summaryrefslogtreecommitdiff
path: root/source4/scripting/python/samba/tests/posixacl.py
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/python/samba/tests/posixacl.py')
-rw-r--r--source4/scripting/python/samba/tests/posixacl.py52
1 files changed, 11 insertions, 41 deletions
diff --git a/source4/scripting/python/samba/tests/posixacl.py b/source4/scripting/python/samba/tests/posixacl.py
index ba0911d78c..b323f91f1a 100644
--- a/source4/scripting/python/samba/tests/posixacl.py
+++ b/source4/scripting/python/samba/tests/posixacl.py
@@ -35,9 +35,6 @@ from samba.samba3 import param as s3param
# print "uid: %d" % entry.uid
# print "gid: %d" % entry.gid
-def is_minus_one(val):
- return (val == -1 or val == 4294967295)
-
class PosixAclMappingTests(TestCase):
def test_setntacl(self):
@@ -162,48 +159,35 @@ class PosixAclMappingTests(TestCase):
self.assertEquals(posix_acl.acl[0].a_type, smb_acl.SMB_ACL_GROUP)
self.assertEquals(posix_acl.acl[0].a_perm, 7)
- self.assertEquals(posix_acl.acl[0].gid, BA_gid)
- self.assertTrue(is_minus_one(posix_acl.acl[0].uid))
+ self.assertEquals(posix_acl.acl[0].info.gid, BA_gid)
self.assertEquals(posix_acl.acl[1].a_type, smb_acl.SMB_ACL_USER)
self.assertEquals(posix_acl.acl[1].a_perm, 6)
- self.assertEquals(posix_acl.acl[1].uid, LA_uid)
- self.assertTrue(is_minus_one(posix_acl.acl[1].gid))
+ self.assertEquals(posix_acl.acl[1].info.uid, LA_uid)
self.assertEquals(posix_acl.acl[2].a_type, smb_acl.SMB_ACL_OTHER)
self.assertEquals(posix_acl.acl[2].a_perm, 0)
- self.assertTrue(is_minus_one(posix_acl.acl[2].uid))
- self.assertTrue(is_minus_one(posix_acl.acl[2].gid))
self.assertEquals(posix_acl.acl[3].a_type, smb_acl.SMB_ACL_USER_OBJ)
self.assertEquals(posix_acl.acl[3].a_perm, 6)
- self.assertTrue(is_minus_one(posix_acl.acl[3].uid))
- self.assertTrue(is_minus_one(posix_acl.acl[3].gid))
self.assertEquals(posix_acl.acl[4].a_type, smb_acl.SMB_ACL_GROUP_OBJ)
self.assertEquals(posix_acl.acl[4].a_perm, 7)
- self.assertTrue(is_minus_one(posix_acl.acl[4].uid))
- self.assertTrue(is_minus_one(posix_acl.acl[4].gid))
self.assertEquals(posix_acl.acl[5].a_type, smb_acl.SMB_ACL_GROUP)
self.assertEquals(posix_acl.acl[5].a_perm, 5)
- self.assertEquals(posix_acl.acl[5].gid, SO_gid)
- self.assertTrue(is_minus_one(posix_acl.acl[5].uid))
+ self.assertEquals(posix_acl.acl[5].info.gid, SO_gid)
self.assertEquals(posix_acl.acl[6].a_type, smb_acl.SMB_ACL_GROUP)
self.assertEquals(posix_acl.acl[6].a_perm, 7)
- self.assertEquals(posix_acl.acl[6].gid, SY_gid)
- self.assertTrue(is_minus_one(posix_acl.acl[6].uid))
+ self.assertEquals(posix_acl.acl[6].info.gid, SY_gid)
self.assertEquals(posix_acl.acl[7].a_type, smb_acl.SMB_ACL_GROUP)
self.assertEquals(posix_acl.acl[7].a_perm, 5)
- self.assertEquals(posix_acl.acl[7].gid, AU_gid)
- self.assertTrue(is_minus_one(posix_acl.acl[7].uid))
+ self.assertEquals(posix_acl.acl[7].info.gid, AU_gid)
self.assertEquals(posix_acl.acl[8].a_type, smb_acl.SMB_ACL_MASK)
self.assertEquals(posix_acl.acl[8].a_perm, 7)
- self.assertTrue(is_minus_one(posix_acl.acl[8].uid))
- self.assertTrue(is_minus_one(posix_acl.acl[8].gid))
# check that it matches:
@@ -304,53 +288,39 @@ class PosixAclMappingTests(TestCase):
self.assertEquals(posix_acl.acl[0].a_type, smb_acl.SMB_ACL_GROUP)
self.assertEquals(posix_acl.acl[0].a_perm, 7)
- self.assertEquals(posix_acl.acl[0].gid, BA_gid)
- self.assertTrue(is_minus_one(posix_acl.acl[0].uid))
+ self.assertEquals(posix_acl.acl[0].info.gid, BA_gid)
self.assertEquals(posix_acl.acl[1].a_type, smb_acl.SMB_ACL_USER)
self.assertEquals(posix_acl.acl[1].a_perm, 6)
- self.assertEquals(posix_acl.acl[1].uid, LA_uid)
- self.assertTrue(is_minus_one(posix_acl.acl[1].gid))
+ self.assertEquals(posix_acl.acl[1].info.uid, LA_uid)
self.assertEquals(posix_acl.acl[2].a_type, smb_acl.SMB_ACL_OTHER)
self.assertEquals(posix_acl.acl[2].a_perm, 0)
- self.assertTrue(is_minus_one(posix_acl.acl[2].uid))
- self.assertTrue(is_minus_one(posix_acl.acl[2].gid))
self.assertEquals(posix_acl.acl[3].a_type, smb_acl.SMB_ACL_USER_OBJ)
self.assertEquals(posix_acl.acl[3].a_perm, 6)
- self.assertTrue(is_minus_one(posix_acl.acl[3].uid))
- self.assertTrue(is_minus_one(posix_acl.acl[3].gid))
self.assertEquals(posix_acl.acl[4].a_type, smb_acl.SMB_ACL_GROUP_OBJ)
self.assertEquals(posix_acl.acl[4].a_perm, 7)
- self.assertTrue(is_minus_one(posix_acl.acl[4].uid))
- self.assertTrue(is_minus_one(posix_acl.acl[4].gid))
self.assertEquals(posix_acl.acl[5].a_type, smb_acl.SMB_ACL_GROUP)
self.assertEquals(posix_acl.acl[5].a_perm, 5)
- self.assertEquals(posix_acl.acl[5].gid, SO_gid)
- self.assertTrue(is_minus_one(posix_acl.acl[5].uid))
+ self.assertEquals(posix_acl.acl[5].info.gid, SO_gid)
self.assertEquals(posix_acl.acl[6].a_type, smb_acl.SMB_ACL_GROUP)
self.assertEquals(posix_acl.acl[6].a_perm, 7)
- self.assertEquals(posix_acl.acl[6].gid, SY_gid)
- self.assertTrue(is_minus_one(posix_acl.acl[6].uid))
+ self.assertEquals(posix_acl.acl[6].info.gid, SY_gid)
self.assertEquals(posix_acl.acl[7].a_type, smb_acl.SMB_ACL_GROUP)
self.assertEquals(posix_acl.acl[7].a_perm, 5)
- self.assertEquals(posix_acl.acl[7].gid, AU_gid)
- self.assertTrue(is_minus_one(posix_acl.acl[7].uid))
+ self.assertEquals(posix_acl.acl[7].info.gid, AU_gid)
self.assertEquals(posix_acl.acl[8].a_type, smb_acl.SMB_ACL_GROUP)
self.assertEquals(posix_acl.acl[8].a_perm, 7)
- self.assertEquals(posix_acl.acl[8].gid, PA_gid)
- self.assertTrue(is_minus_one(posix_acl.acl[8].uid))
+ self.assertEquals(posix_acl.acl[8].info.gid, PA_gid)
self.assertEquals(posix_acl.acl[9].a_type, smb_acl.SMB_ACL_MASK)
self.assertEquals(posix_acl.acl[9].a_perm, 7)
- self.assertTrue(is_minus_one(posix_acl.acl[9].uid))
- self.assertTrue(is_minus_one(posix_acl.acl[9].gid))
# check that it matches: