1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

pytest/samba_tool_drs: 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 3f0aab45c8)
This commit is contained in:
Douglas Bagnall 2022-06-08 19:53:57 +12:00 committed by Jule Anger
parent 6a6db20068
commit 42b5bfa68e

View File

@ -19,7 +19,6 @@
"""Blackbox tests for samba-tool drs.""" """Blackbox tests for samba-tool drs."""
import samba.tests import samba.tests
import shutil
import os import os
import ldb import ldb
import drs_base import drs_base
@ -42,15 +41,9 @@ class SambaToolDrsTests(drs_base.DrsBaseTestCase):
self._enable_inbound_repl(self.dnsname_dc1) self._enable_inbound_repl(self.dnsname_dc1)
self._enable_inbound_repl(self.dnsname_dc2) self._enable_inbound_repl(self.dnsname_dc2)
try: self.rm_files('names.tdb', allow_missing=True)
shutil.rmtree(os.path.join(self.tempdir, "private")) self.rm_dirs('etc', 'msg.lock', 'private', 'state', 'bind-dns',
shutil.rmtree(os.path.join(self.tempdir, "etc")) allow_missing=True)
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
super(SambaToolDrsTests, self).tearDown() super(SambaToolDrsTests, self).tearDown()