1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

tests/posixacl: move setUp and tearDown to top

Make it clear to find out what we have in test.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13521

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
This commit is contained in:
Joe Guo 2018-07-06 10:32:17 +12:00 committed by Andrew Bartlett
parent 6875f4354a
commit 1c09fc2de3

View File

@ -32,6 +32,20 @@ ACL = "O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695
class PosixAclMappingTests(TestCaseInTempDir): class PosixAclMappingTests(TestCaseInTempDir):
def setUp(self):
super(PosixAclMappingTests, self).setUp()
s3conf = s3param.get_context()
s3conf.load(self.get_loadparm().configfile)
s3conf.set("xattr_tdb:file", os.path.join(self.tempdir, "xattr.tdb"))
self.lp = s3conf
self.tempf = os.path.join(self.tempdir, "test")
open(self.tempf, 'w').write("empty")
def tearDown(self):
smbd.unlink(self.tempf)
os.unlink(os.path.join(self.tempdir, "xattr.tdb"))
super(PosixAclMappingTests, self).tearDown()
def print_posix_acl(self, posix_acl): def print_posix_acl(self, posix_acl):
aclstr = "" aclstr = ""
for entry in posix_acl.acl: for entry in posix_acl.acl:
@ -774,19 +788,3 @@ class PosixAclMappingTests(TestCaseInTempDir):
# a_perm: 7 # a_perm: 7
# uid: -1 # uid: -1
# gid: -1 # gid: -1
#
def setUp(self):
super(PosixAclMappingTests, self).setUp()
s3conf = s3param.get_context()
s3conf.load(self.get_loadparm().configfile)
s3conf.set("xattr_tdb:file", os.path.join(self.tempdir,"xattr.tdb"))
self.lp = s3conf
self.tempf = os.path.join(self.tempdir, "test")
open(self.tempf, 'w').write("empty")
def tearDown(self):
smbd.unlink(self.tempf)
os.unlink(os.path.join(self.tempdir,"xattr.tdb"))
super(PosixAclMappingTests, self).tearDown()