summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2022-06-15 13:23:32 +1200
committerJule Anger <janger@samba.org>2022-10-07 08:45:15 +0000
commitdd2c5f96981e6ea06447490dbf65d883134060b2 (patch)
tree174ad81274ce002a8cfec9d5e94a32c13a612170 /source4
parent42b5bfa68e25a2878bc0f441061a2e8195874573 (diff)
downloadsamba-dd2c5f96981e6ea06447490dbf65d883134060b2.tar.gz
pytest/samba_tool_drs_no_dns: use TestCaseInTempDir.rm_files/.rm_dirs
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15191 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15189 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org> (cherry picked from commit 24f7d71416753b792d6fe029da6f366adb10383e)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/drs/python/samba_tool_drs_no_dns.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/source4/torture/drs/python/samba_tool_drs_no_dns.py b/source4/torture/drs/python/samba_tool_drs_no_dns.py
index 33b43b48d05..fb1551a1b43 100644
--- a/source4/torture/drs/python/samba_tool_drs_no_dns.py
+++ b/source4/torture/drs/python/samba_tool_drs_no_dns.py
@@ -24,7 +24,6 @@ Adapted from samba_tool_drs.py
"""
import samba.tests
-import shutil
import os
import ldb
import drs_base
@@ -47,16 +46,9 @@ class SambaToolDrsNoDnsTests(drs_base.DrsBaseTestCase):
def tearDown(self):
self._enable_inbound_repl(self.dnsname_dc1)
-
- try:
- shutil.rmtree(os.path.join(self.tempdir, "private"))
- shutil.rmtree(os.path.join(self.tempdir, "etc"))
- shutil.rmtree(os.path.join(self.tempdir, "msg.lock"))
- os.remove(os.path.join(self.tempdir, "names.tdb"))
- shutil.rmtree(os.path.join(self.tempdir, "state"))
- shutil.rmtree(os.path.join(self.tempdir, "bind-dns"))
- except Exception:
- pass
+ self.rm_files('names.tdb', allow_missing=True)
+ self.rm_dirs('etc', 'msg.lock', 'private', 'state', 'bind-dns',
+ allow_missing=True)
super(SambaToolDrsNoDnsTests, self).tearDown()