]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/test/test_runner.py
Makefile: add 'make tmpfstest', which uses a tmpfs for _trial_temp.
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / test / test_runner.py
index 6aaed8034eea740cb47868ee57c9964214f68f01..596246267773f1f28f7fb4a9e494a6064094d782 100644 (file)
@@ -88,6 +88,10 @@ class BinTahoe(common_util.SignalMixin, unittest.TestCase, RunBinTahoeMixin):
         if os.path.basename(root_from_cwd) == 'src':
             root_from_cwd = os.path.dirname(root_from_cwd)
 
+        # This is needed if we are running in a temporary directory created by 'make tmpfstest'.
+        if os.path.basename(root_from_cwd).startswith('tmp'):
+            root_from_cwd = os.path.dirname(root_from_cwd)
+
         same = (root_from_cwd == root_to_check)
         if not same:
             try:
@@ -105,6 +109,10 @@ class BinTahoe(common_util.SignalMixin, unittest.TestCase, RunBinTahoeMixin):
             if os.path.basename(root_from_cwdu) == u'src':
                 root_from_cwdu = os.path.dirname(root_from_cwdu)
 
+            # This is needed if we are running in a temporary directory created by 'make tmpfstest'.
+            if os.path.basename(root_from_cwdu).startswith(u'tmp'):
+                root_from_cwdu = os.path.dirname(root_from_cwdu)
+
             if not isinstance(root_from_cwd, unicode) and root_from_cwd.decode(get_filesystem_encoding(), 'replace') != root_from_cwdu:
                 msg += ("However, this may be a false alarm because the current directory path\n"
                         "is not representable in the filesystem encoding. Please run the tests\n"