tests/posixacl: move setUp and tearDown to top
authorJoe Guo <joeg@catalyst.net.nz>
Thu, 5 Jul 2018 22:32:17 +0000 (10:32 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Jul 2018 02:32:03 +0000 (04:32 +0200)
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>
python/samba/tests/posixacl.py

index 5c4cdad9d31a9c1d1ff24e58494c77f450c55996..175fcb2c177a5ace69ebc55e16958bc07e36c00c 100644 (file)
@@ -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()