tests: Rework backup test inheritance to make LP constraints clearer
[amitay/samba.git] / python / samba / tests / domain_backup_offline.py
index f5fa1561de2bf87ae2bbaee96372a42d0d56f61a..8b7209ec24da3ad1c3ee892a5f6c6e1803f5309b 100644 (file)
@@ -19,11 +19,17 @@ import tarfile
 import os
 import shutil
 import tempfile
-from samba.tests.samba_tool.base import SambaToolCmdTest
-from samba.tests import TestCaseInTempDir
+from samba.tests import BlackboxTestCase
 from samba.netcmd import CommandError
 
-class DomainBackupOfflineCmp(SambaToolCmdTest, TestCaseInTempDir):
+# The backup tests require that a completely clean LoadParm object gets used
+# for the restore. Otherwise the same global LP gets re-used, and the LP
+# settings can bleed from one test case to another.
+# To do this, these tests should use check_output(), which executes the command
+# in a separate process (as opposed to runcmd(), runsubcmd()).
+# So although this is a samba-tool test, we don't inherit from SambaToolCmdTest
+# so that we never inadvertently use .runcmd() by accident.
+class DomainBackupOfflineCmp(BlackboxTestCase):
 
     def test_domain_backup_offline_untar_tdb(self):
         self.untar_testcase('tdb')