]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest/downgradedatabase: use TestCaseInTempDir.rm_files
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 15 Jun 2022 01:19:28 +0000 (13:19 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Tue, 6 Sep 2022 21:12:36 +0000 (21:12 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
python/samba/tests/blackbox/downgradedatabase.py

index f6da011ede4659db074a044d5b7c3bc591d8a5cf..8d80ef6e804aadf9d0c4aeed8f9151150bca2d76 100644 (file)
@@ -18,7 +18,6 @@
 from samba.tests import BlackboxTestCase
 import os
 import ldb
-import shutil
 from subprocess import check_output
 from samba.samdb import SamDB
 
@@ -57,13 +56,12 @@ class DowngradeTestBase(BlackboxTestCase):
         self.dbs.append(self.sam_path)
 
     def tearDown(self):
-        shutil.rmtree(os.path.join(self.tempdir, "private"))
-        shutil.rmtree(os.path.join(self.tempdir, "etc"))
-        shutil.rmtree(os.path.join(self.tempdir, "state"))
-        shutil.rmtree(os.path.join(self.tempdir, "bind-dns"))
-        shutil.rmtree(os.path.join(self.tempdir, "msg.lock"))
-        os.unlink(os.path.join(self.tempdir, "names.tdb"))
-        os.unlink(os.path.join(self.tempdir, "gencache.tdb"))
+        self.rm_dirs("private",
+                     "etc",
+                     "state",
+                     "bind-dns",
+                     "msg.lock")
+        self.rm_files("names.tdb", "gencache.tdb")
         super(DowngradeTestBase, self).tearDown()
 
     # Parse out the comments above each record that ldbdump produces