From 1c09fc2de3cb4cb18cba35ea410fb74742cd9065 Mon Sep 17 00:00:00 2001 From: Joe Guo Date: Fri, 6 Jul 2018 10:32:17 +1200 Subject: [PATCH] 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 Reviewed-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- python/samba/tests/posixacl.py | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/python/samba/tests/posixacl.py b/python/samba/tests/posixacl.py index 5c4cdad9d31..175fcb2c177 100644 --- a/python/samba/tests/posixacl.py +++ b/python/samba/tests/posixacl.py @@ -32,6 +32,20 @@ ACL = "O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695 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): aclstr = "" for entry in posix_acl.acl: @@ -774,19 +788,3 @@ class PosixAclMappingTests(TestCaseInTempDir): # a_perm: 7 # uid: -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()