[ARVADOS] created: 1.3.0-1100-g84485330f

Git user git at public.curoverse.com
Mon Jun 17 14:56:36 UTC 2019


        at  84485330ff92a496763d1e471f8ed666e6da0a4f (commit)


commit 84485330ff92a496763d1e471f8ed666e6da0a4f
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Fri Jun 14 17:04:32 2019 -0400

    14965: Updates fuse tests with futurize stage1
    
    Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti at veritasgenetics.com>

diff --git a/services/fuse/tests/fstest.py b/services/fuse/tests/fstest.py
index 2b3e85ec4..17ce41cd6 100644
--- a/services/fuse/tests/fstest.py
+++ b/services/fuse/tests/fstest.py
@@ -2,23 +2,25 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import print_function
+from __future__ import absolute_import
 from multiprocessing import Process
 import os
 import subprocess
 import sys
-import prof
+from . import prof
 
 def fn(n):
     return "file%i" % n
 
 def createfiles(d, n):
     for j in xrange(1, 5):
-        print "Starting small file %s %i, %i" % (d, n, j)
+        print("Starting small file %s %i, %i" % (d, n, j))
         if d:
             os.mkdir(d)
             ld = os.listdir('.')
             if d not in ld:
-                print "ERROR %s missing" % d
+                print("ERROR %s missing" % d)
             os.chdir(d)
 
         for i in xrange(n, n+10):
@@ -28,12 +30,12 @@ def createfiles(d, n):
         ld = os.listdir('.')
         for i in xrange(n, n+10):
             if fn(i) not in ld:
-                print "ERROR %s missing" % fn(i)
+                print("ERROR %s missing" % fn(i))
 
         for i in xrange(n, n+10):
             with open(fn(i), "r") as f:
                 if f.read() != fn(i):
-                    print "ERROR %s doesn't have expected contents" % fn(i)
+                    print("ERROR %s doesn't have expected contents" % fn(i))
 
         for i in xrange(n, n+10):
             os.remove(fn(i))
@@ -41,25 +43,25 @@ def createfiles(d, n):
         ld = os.listdir('.')
         for i in xrange(n, n+10):
             if fn(i) in ld:
-                print "ERROR %s should have been removed" % fn(i)
+                print("ERROR %s should have been removed" % fn(i))
 
         if d:
             os.chdir('..')
             os.rmdir(d)
             ld = os.listdir('.')
             if d in ld:
-                print "ERROR %s should have been removed" % d
+                print("ERROR %s should have been removed" % d)
 
 
 def createbigfile(d, n):
     for j in xrange(1, 5):
-        print "Starting big file %s %i, %i" % (d, n, j)
+        print("Starting big file %s %i, %i" % (d, n, j))
         i = n
         if d:
             os.mkdir(d)
             ld = os.listdir('.')
             if d not in ld:
-                print "ERROR %s missing" % d
+                print("ERROR %s missing" % d)
             os.chdir(d)
 
         with open(fn(i), "w") as f:
@@ -68,26 +70,26 @@ def createbigfile(d, n):
 
         ld = os.listdir('.')
         if fn(i) not in ld:
-            print "ERROR %s missing" % fn(i)
+            print("ERROR %s missing" % fn(i))
 
         with open(fn(i), "r") as f:
             for j in xrange(0, 1000):
                 expect = (str(j) + fn(i)) * 10000
                 if f.read(len(expect)) != expect:
-                    print "ERROR %s doesn't have expected contents" % fn(i)
+                    print("ERROR %s doesn't have expected contents" % fn(i))
 
         os.remove(fn(i))
 
         ld = os.listdir('.')
         if fn(i) in ld:
-            print "ERROR %s should have been removed" % fn(i)
+            print("ERROR %s should have been removed" % fn(i))
 
         if d:
             os.chdir('..')
             os.rmdir(d)
             ld = os.listdir('.')
             if d in ld:
-                print "ERROR %s should have been removed" % d
+                print("ERROR %s should have been removed" % d)
 
 def do_ls():
     with open("/dev/null", "w") as nul:
@@ -112,26 +114,26 @@ def runit(target, indir):
         p.join()
 
     if os.listdir('.'):
-        print "ERROR there are left over files in the directory"
+        print("ERROR there are left over files in the directory")
 
 
 if __name__ == '__main__':
     if os.listdir('.'):
-        print "ERROR starting directory is not empty"
+        print("ERROR starting directory is not empty")
         sys.exit()
 
-    print "Single directory small files"
+    print("Single directory small files")
     with prof.CountTime():
         runit(createfiles, False)
 
-    print "Separate directories small files"
+    print("Separate directories small files")
     with prof.CountTime():
         runit(createfiles, True)
 
-    print "Single directory large files"
+    print("Single directory large files")
     with prof.CountTime():
         runit(createbigfile, False)
 
-    print "Separate directories large files"
+    print("Separate directories large files")
     with prof.CountTime():
         runit(createbigfile, True)
diff --git a/services/fuse/tests/integration_test.py b/services/fuse/tests/integration_test.py
index 3c11fa292..7072eae68 100644
--- a/services/fuse/tests/integration_test.py
+++ b/services/fuse/tests/integration_test.py
@@ -2,6 +2,7 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import arvados
 import arvados_fuse
 import arvados_fuse.command
@@ -11,7 +12,7 @@ import inspect
 import logging
 import multiprocessing
 import os
-import run_test_server
+from . import run_test_server
 import signal
 import sys
 import tempfile
diff --git a/services/fuse/tests/mount_test_base.py b/services/fuse/tests/mount_test_base.py
index d476fc771..60264131d 100644
--- a/services/fuse/tests/mount_test_base.py
+++ b/services/fuse/tests/mount_test_base.py
@@ -2,6 +2,7 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import arvados
 import arvados_fuse as fuse
 import arvados.safeapi
@@ -9,7 +10,7 @@ import llfuse
 import logging
 import multiprocessing
 import os
-import run_test_server
+from . import run_test_server
 import shutil
 import signal
 import subprocess
diff --git a/services/fuse/tests/performance/test_collection_performance.py b/services/fuse/tests/performance/test_collection_performance.py
index 6772a7de9..475e0e75e 100644
--- a/services/fuse/tests/performance/test_collection_performance.py
+++ b/services/fuse/tests/performance/test_collection_performance.py
@@ -2,6 +2,10 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
+from future.utils import viewitems
+from builtins import str
+from builtins import range
 import arvados
 import arvados_fuse as fuse
 import llfuse
@@ -15,7 +19,7 @@ from ..slow_test import slow_test
 
 logger = logging.getLogger('arvados.arv-mount')
 
-from performance_profiler import profiled
+from .performance_profiler import profiled
 
 def fuse_createCollectionWithMultipleBlocks(mounttmp, streams=1, files_per_stream=1, data='x'):
     class Test(unittest.TestCase):
@@ -330,7 +334,7 @@ class UsingMagicDir_CreateCollectionWithManyFilesAndMoveAndDeleteFile(MountTestB
         for j in range(0, files_per_stream):
             files[os.path.join(self.mounttmp, collection, 'file'+str(j)+'.txt')] = data
 
-        for k, v in files.items():
+        for k, v in viewItems(files):
             with open(os.path.join(self.mounttmp, collection, k)) as f:
                 self.assertEqual(v, f.read())
 
diff --git a/services/fuse/tests/prof.py b/services/fuse/tests/prof.py
index 021839c5b..6742799cc 100644
--- a/services/fuse/tests/prof.py
+++ b/services/fuse/tests/prof.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
 # Copyright (C) The Arvados Authors. All rights reserved.
 #
 # SPDX-License-Identifier: AGPL-3.0
@@ -18,4 +19,4 @@ class CountTime(object):
         th = ""
         if self.size:
             th = "throughput %s/sec" % (self.size / sec)
-        print "%s time %s micoseconds %s" % (self.tag, sec*1000000, th)
+        print("%s time %s micoseconds %s" % (self.tag, sec*1000000, th))
diff --git a/services/fuse/tests/test_command_args.py b/services/fuse/tests/test_command_args.py
index 0d85df33d..bc18749f5 100644
--- a/services/fuse/tests/test_command_args.py
+++ b/services/fuse/tests/test_command_args.py
@@ -2,6 +2,7 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import arvados
 import arvados_fuse
 import arvados_fuse.command
@@ -13,14 +14,14 @@ import llfuse
 import logging
 import mock
 import os
-import run_test_server
+from . import run_test_server
 import sys
 import tempfile
 import unittest
 
 def noexit(func):
     """If argparse or arvados_fuse tries to exit, fail the test instead"""
-    class SystemExitCaught(StandardError):
+    class SystemExitCaught(Exception):
         pass
     @functools.wraps(func)
     def wrapper(*args, **kwargs):
diff --git a/services/fuse/tests/test_crunchstat.py b/services/fuse/tests/test_crunchstat.py
index f3bf21121..c56cc55f1 100644
--- a/services/fuse/tests/test_crunchstat.py
+++ b/services/fuse/tests/test_crunchstat.py
@@ -2,9 +2,10 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import subprocess
 
-from integration_test import IntegrationTest
+from .integration_test import IntegrationTest
 
 
 class CrunchstatTest(IntegrationTest):
diff --git a/services/fuse/tests/test_exec.py b/services/fuse/tests/test_exec.py
index ab6e13136..2111d5351 100644
--- a/services/fuse/tests/test_exec.py
+++ b/services/fuse/tests/test_exec.py
@@ -2,11 +2,12 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import arvados_fuse.command
 import json
 import multiprocessing
 import os
-import run_test_server
+from . import run_test_server
 import tempfile
 import unittest
 
diff --git a/services/fuse/tests/test_mount.py b/services/fuse/tests/test_mount.py
index d25ab714d..57d5db201 100644
--- a/services/fuse/tests/test_mount.py
+++ b/services/fuse/tests/test_mount.py
@@ -2,6 +2,7 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import json
 import llfuse
 import logging
@@ -13,9 +14,9 @@ import unittest
 
 import arvados
 import arvados_fuse as fuse
-import run_test_server
+from . import run_test_server
 
-from mount_test_base import MountTestBase
+from .mount_test_base import MountTestBase
 
 logger = logging.getLogger('arvados.arv-mount')
 
diff --git a/services/fuse/tests/test_retry.py b/services/fuse/tests/test_retry.py
index 1c2ade271..58b7bacc3 100644
--- a/services/fuse/tests/test_retry.py
+++ b/services/fuse/tests/test_retry.py
@@ -2,6 +2,7 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import arvados
 import arvados_fuse.command
 import json
@@ -9,7 +10,7 @@ import mock
 import os
 import pycurl
 import Queue
-import run_test_server
+from . import run_test_server
 import tempfile
 import unittest
 
diff --git a/services/fuse/tests/test_unmount.py b/services/fuse/tests/test_unmount.py
index bf180beb7..8c60f9a0f 100644
--- a/services/fuse/tests/test_unmount.py
+++ b/services/fuse/tests/test_unmount.py
@@ -2,6 +2,7 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import arvados_fuse.unmount
 import os
 import subprocess
@@ -10,7 +11,7 @@ import tempfile
 import time
 import unittest
 
-from integration_test import IntegrationTest
+from .integration_test import IntegrationTest
 
 class UnmountTest(IntegrationTest):
     def setUp(self):

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list