Blob Blame History Raw
From 6e4fdd7d353b9171d164dcee2ec434a1b55c7e27 Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Fri, 14 Jun 2019 16:36:34 +0200
Subject: [PATCH 2/2] integration-test: Do not copy config files when testing
 system instance

---
 src/tests/integration-test | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/tests/integration-test b/src/tests/integration-test
index 2bc78a2b..4652a8c2 100755
--- a/src/tests/integration-test
+++ b/src/tests/integration-test
@@ -129,6 +129,13 @@ class UDisksTestCase(unittest.TestCase):
         if (os.access(cls.daemon_path, os.X_OK)):
             print('Testing binaries from local build tree')
             cls.check_build_tree_config()
+            # copy required system files
+            testdir = os.path.abspath(os.path.dirname(__file__))
+            projdir = os.path.abspath(os.path.normpath(os.path.join(testdir, '..', '..')))
+            tmpdir = tempfile.mkdtemp(prefix='udisks-tst-')
+            atexit.register(shutil.rmtree, tmpdir)
+            files_to_restore = install_config_files(projdir, tmpdir)
+            atexit.register(restore_files, files_to_restore, tmpdir)
         else:
             print('Testing installed system binaries')
             cls.daemon_path = None
@@ -1899,14 +1906,6 @@ if __name__ == '__main__':
                            help='name of test class or method (e. g. "Drive", "FS.test_ext2")')
     cli_args = argparser.parse_args()
 
-    testdir = os.path.abspath(os.path.dirname(__file__))
-    projdir = os.path.abspath(os.path.normpath(os.path.join(testdir, '..', '..')))
-    tmpdir = tempfile.mkdtemp(prefix='udisks-tst-')
-    atexit.register(shutil.rmtree, tmpdir)
-
-    files_to_restore = install_config_files(projdir, tmpdir)
-    atexit.register(restore_files, files_to_restore, tmpdir)
-
     UDisksTestCase.init(logfile=cli_args.logfile)
     if cli_args.testname:
         tests = unittest.TestLoader().loadTestsFromNames(
-- 
2.21.0