pytest/join: use TestCaseInTempDir.rm_files/dirs
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 15 Jun 2022 01:21:16 +0000 (13:21 +1200)
committerJule Anger <janger@samba.org>
Fri, 7 Oct 2022 08:45:15 +0000 (08:45 +0000)
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 7455c53fa4f7871b3980f820d22b0fd411195704)

python/samba/tests/join.py

index db9d8a892b7c3c7985e601caf4517081561ca99e..da34171da280d01f13a67e715e08675be648ebe8 100644 (file)
@@ -74,10 +74,8 @@ class JoinTestCase(DNSTKeyTest):
         if paths is not None:
             shutil.rmtree(paths.private_dir)
             shutil.rmtree(paths.state_dir)
-            shutil.rmtree(os.path.join(self.tempdir, "etc"))
-            shutil.rmtree(os.path.join(self.tempdir, "msg.lock"))
-            os.unlink(os.path.join(self.tempdir, "names.tdb"))
-            shutil.rmtree(os.path.join(self.tempdir, "bind-dns"))
+            self.rm_dirs("etc", "msg.lock", "bind-dns")
+            self.rm_files("names.tdb")
 
         self.join_ctx.cleanup_old_join(force=True)