From 85bc1552e3919d049d39a065824172a24933d38b Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 15 Jun 2022 13:19:28 +1200 Subject: [PATCH] pytest/downgradedatabase: use TestCaseInTempDir.rm_files Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power --- python/samba/tests/blackbox/downgradedatabase.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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 -- 2.47.3