[ARVADOS] updated: 1.3.0-1101-gacb06e145
Git user
git at public.curoverse.com
Mon Jun 17 17:44:14 UTC 2019
Summary of changes:
services/fuse/tests/fstest.py | 24 +++++++++++++-----------
services/fuse/tests/mount_test_base.py | 2 +-
services/fuse/tests/prof.py | 5 +++--
services/fuse/tests/test_cache.py | 1 +
services/fuse/tests/test_mount.py | 15 +++++++++------
services/fuse/tests/test_retry.py | 6 ++++--
services/fuse/tests/test_tmp_collection.py | 1 +
services/fuse/tests/test_token_expiry.py | 1 +
8 files changed, 33 insertions(+), 22 deletions(-)
via acb06e145fc50740496a34d2804e3438b2ddb2b1 (commit)
from 84485330ff92a496763d1e471f8ed666e6da0a4f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit acb06e145fc50740496a34d2804e3438b2ddb2b1
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date: Mon Jun 17 13:44:08 2019 -0400
14965: Updates fuse tests with futurize stage2
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 17ce41cd6..51e3f311a 100644
--- a/services/fuse/tests/fstest.py
+++ b/services/fuse/tests/fstest.py
@@ -4,6 +4,8 @@
from __future__ import print_function
from __future__ import absolute_import
+from builtins import str
+from builtins import range
from multiprocessing import Process
import os
import subprocess
@@ -14,7 +16,7 @@ def fn(n):
return "file%i" % n
def createfiles(d, n):
- for j in xrange(1, 5):
+ for j in range(1, 5):
print("Starting small file %s %i, %i" % (d, n, j))
if d:
os.mkdir(d)
@@ -23,25 +25,25 @@ def createfiles(d, n):
print("ERROR %s missing" % d)
os.chdir(d)
- for i in xrange(n, n+10):
+ for i in range(n, n+10):
with open(fn(i), "w") as f:
f.write(fn(i))
ld = os.listdir('.')
- for i in xrange(n, n+10):
+ for i in range(n, n+10):
if fn(i) not in ld:
print("ERROR %s missing" % fn(i))
- for i in xrange(n, n+10):
+ for i in range(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))
- for i in xrange(n, n+10):
+ for i in range(n, n+10):
os.remove(fn(i))
ld = os.listdir('.')
- for i in xrange(n, n+10):
+ for i in range(n, n+10):
if fn(i) in ld:
print("ERROR %s should have been removed" % fn(i))
@@ -54,7 +56,7 @@ def createfiles(d, n):
def createbigfile(d, n):
- for j in xrange(1, 5):
+ for j in range(1, 5):
print("Starting big file %s %i, %i" % (d, n, j))
i = n
if d:
@@ -65,7 +67,7 @@ def createbigfile(d, n):
os.chdir(d)
with open(fn(i), "w") as f:
- for j in xrange(0, 1000):
+ for j in range(0, 1000):
f.write((str(j) + fn(i)) * 10000)
ld = os.listdir('.')
@@ -73,7 +75,7 @@ def createbigfile(d, n):
print("ERROR %s missing" % fn(i))
with open(fn(i), "r") as f:
- for j in xrange(0, 1000):
+ for j in range(0, 1000):
expect = (str(j) + fn(i)) * 10000
if f.read(len(expect)) != expect:
print("ERROR %s doesn't have expected contents" % fn(i))
@@ -93,12 +95,12 @@ def createbigfile(d, n):
def do_ls():
with open("/dev/null", "w") as nul:
- for j in xrange(1, 50):
+ for j in range(1, 50):
subprocess.call(["ls", "-l"], stdout=nul, stderr=nul)
def runit(target, indir):
procs = []
- for n in xrange(0, 20):
+ for n in range(0, 20):
if indir:
p = Process(target=target, args=("dir%i" % n, n*10,))
else:
diff --git a/services/fuse/tests/mount_test_base.py b/services/fuse/tests/mount_test_base.py
index 60264131d..fe2ff929d 100644
--- a/services/fuse/tests/mount_test_base.py
+++ b/services/fuse/tests/mount_test_base.py
@@ -97,4 +97,4 @@ class MountTestBase(unittest.TestCase):
path = self.mounttmp
if subdir:
path = os.path.join(path, subdir)
- self.assertEqual(sorted(expect_content), sorted(llfuse.listdir(path)))
+ self.assertEqual(sorted(expect_content), sorted(llfuse.listdir(str(path))))
diff --git a/services/fuse/tests/prof.py b/services/fuse/tests/prof.py
index 6742799cc..f9ce1881d 100644
--- a/services/fuse/tests/prof.py
+++ b/services/fuse/tests/prof.py
@@ -1,8 +1,9 @@
-from __future__ import print_function
# Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: AGPL-3.0
+from __future__ import print_function
+from builtins import object
import time
class CountTime(object):
@@ -18,5 +19,5 @@ class CountTime(object):
sec = (time.time() - self.start)
th = ""
if self.size:
- th = "throughput %s/sec" % (self.size / sec)
+ th = "throughput %s/sec" % (self.size // sec)
print("%s time %s micoseconds %s" % (self.tag, sec*1000000, th))
diff --git a/services/fuse/tests/test_cache.py b/services/fuse/tests/test_cache.py
index 3f6b804b9..46ed0be41 100644
--- a/services/fuse/tests/test_cache.py
+++ b/services/fuse/tests/test_cache.py
@@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0
+from builtins import range
import arvados
import arvados.collection
import arvados_fuse
diff --git a/services/fuse/tests/test_mount.py b/services/fuse/tests/test_mount.py
index 57d5db201..c7fb0009b 100644
--- a/services/fuse/tests/test_mount.py
+++ b/services/fuse/tests/test_mount.py
@@ -3,6 +3,9 @@
# SPDX-License-Identifier: AGPL-3.0
from __future__ import absolute_import
+from future.utils import viewitems
+from builtins import str
+from builtins import object
import json
import llfuse
import logging
@@ -32,7 +35,7 @@ class AssertWithTimeout(object):
self.done = False
return self
- def next(self):
+ def __next__(self):
if self.done:
raise StopIteration
return self.attempt
@@ -113,7 +116,7 @@ class FuseMountTest(MountTestBase):
'dir2/dir3/thing7.txt': 'data 7',
'dir2/dir3/thing8.txt': 'data 8'}
- for k, v in files.items():
+ for k, v in viewitems(files):
with open(os.path.join(self.mounttmp, k)) as f:
self.assertEqual(v, f.read())
@@ -168,7 +171,7 @@ class FuseMagicTest(MountTestBase):
files = {}
files[os.path.join(self.mounttmp, self.testcollection, 'thing1.txt')] = 'data 1'
- for k, v in files.items():
+ for k, v in viewitems(files):
with open(os.path.join(self.mounttmp, k)) as f:
self.assertEqual(v, f.read())
@@ -236,7 +239,7 @@ def fuseSharedTestHelper(mounttmp):
# check mtime on collection
st = os.stat(baz_path)
try:
- mtime = st.st_mtime_ns / 1000000000
+ mtime = st.st_mtime_ns // 1000000000
except AttributeError:
mtime = st.st_mtime
self.assertEqual(mtime, 1391448174)
@@ -290,7 +293,7 @@ class FuseHomeTest(MountTestBase):
'anonymously_accessible_project']
found_in = 0
found_not_in = 0
- for name, item in run_test_server.fixture('collections').iteritems():
+ for name, item in viewitems(run_test_server.fixture('collections')):
if 'name' not in item:
pass
elif item['owner_uuid'] == public_project['uuid']:
@@ -1165,7 +1168,7 @@ class FuseMagicTestPDHOnly(MountTestBase):
files = {}
files[os.path.join(self.mounttmp, self.testcollection, 'thing1.txt')] = 'data 1'
- for k, v in files.items():
+ for k, v in viewitems(files):
with open(os.path.join(self.mounttmp, k)) as f:
self.assertEqual(v, f.read())
diff --git a/services/fuse/tests/test_retry.py b/services/fuse/tests/test_retry.py
index 58b7bacc3..b69707af4 100644
--- a/services/fuse/tests/test_retry.py
+++ b/services/fuse/tests/test_retry.py
@@ -3,13 +3,15 @@
# SPDX-License-Identifier: AGPL-3.0
from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
import arvados
import arvados_fuse.command
import json
import mock
import os
import pycurl
-import Queue
+import queue
from . import run_test_server
import tempfile
import unittest
@@ -51,7 +53,7 @@ class RetryPUT(IntegrationTest):
def test_retry_write(self, sleep):
mockedCurl = mock.Mock(spec=pycurl.Curl(), wraps=pycurl.Curl())
mockedCurl.perform.side_effect = Exception('mock error (ok)')
- q = Queue.Queue()
+ q = queue.Queue()
q.put(mockedCurl)
q.put(pycurl.Curl())
q.put(pycurl.Curl())
diff --git a/services/fuse/tests/test_tmp_collection.py b/services/fuse/tests/test_tmp_collection.py
index b8e064615..a70df8822 100644
--- a/services/fuse/tests/test_tmp_collection.py
+++ b/services/fuse/tests/test_tmp_collection.py
@@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0
+from builtins import range
import arvados
import arvados_fuse
import arvados_fuse.command
diff --git a/services/fuse/tests/test_token_expiry.py b/services/fuse/tests/test_token_expiry.py
index 9756b2efe..8b89e0cc1 100644
--- a/services/fuse/tests/test_token_expiry.py
+++ b/services/fuse/tests/test_token_expiry.py
@@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0
+from builtins import range
import apiclient
import arvados
import arvados_fuse
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list