From: Douglas Bagnall Date: Wed, 15 Jun 2022 01:19:28 +0000 (+1200) Subject: pytest/downgradedatabase: use TestCaseInTempDir.rm_files X-Git-Tag: talloc-2.4.0~1204 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85bc1552e3919d049d39a065824172a24933d38b;p=thirdparty%2Fsamba.git pytest/downgradedatabase: use TestCaseInTempDir.rm_files Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power --- diff --git a/python/samba/tests/blackbox/downgradedatabase.py b/python/samba/tests/blackbox/downgradedatabase.py index f6da011ede4..8d80ef6e804 100644 --- a/python/samba/tests/blackbox/downgradedatabase.py +++ b/python/samba/tests/blackbox/downgradedatabase.py @@ -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