diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-05-31 13:06:59 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-06-07 19:50:11 +0000 |
commit | ab376a97c972d2d5ebfb912ed90664c787860dc8 (patch) | |
tree | d0186e6a4bfb7ccc9a390a5ae568b40e341b8b87 | |
parent | 0d4738ee3b220476a23b3e30962881dec2cf5f72 (diff) | |
download | samba-ab376a97c972d2d5ebfb912ed90664c787860dc8.tar.gz |
selftest: Specifically remove files generated by provision
This allows the changes in 74d15c9bf76f0a2fb5fa7b7b1d80971d10c4fe45 to
be reverted, and aligns this test with others that use TestCaseInTempDir.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13978
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
-rw-r--r-- | python/samba/tests/blackbox/downgradedatabase.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/python/samba/tests/blackbox/downgradedatabase.py b/python/samba/tests/blackbox/downgradedatabase.py index b0becacc068..a5e540c1354 100644 --- a/python/samba/tests/blackbox/downgradedatabase.py +++ b/python/samba/tests/blackbox/downgradedatabase.py @@ -19,6 +19,7 @@ from __future__ import print_function from samba.tests import BlackboxTestCase import os import ldb +import shutil from subprocess import check_output from samba.samdb import SamDB @@ -34,9 +35,6 @@ class DowngradeTestBase(BlackboxTestCase): if not hasattr(self, "backend"): self.fail("Subclass this class and set 'backend'") - # Don't assert on empty tempdir contents on tearDown - self.check_tempdir_empty = False - prov_cmd = "samba-tool domain provision " +\ "--domain FOO --realm foo.example.com " +\ "--targetdir {self.tempdir} " +\ @@ -59,6 +57,16 @@ class DowngradeTestBase(BlackboxTestCase): for p in partitions] 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")) + super(DowngradeTestBase, self).tearDown() + # Parse out the comments above each record that ldbdump produces # containing pack format version and KV level key for each record. # Return all GUID keys and DN keys (without @attrs), and the set |