summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrashanth Pai <ppai@redhat.com>2016-07-01 23:01:09 +0530
committerPrashanth Pai <ppai@redhat.com>2016-07-01 23:11:16 +0530
commitdc83b6cdf65ebee8542603baba2d88aee1b28c08 (patch)
tree66f06013faa5809b2779c5c52e55b9aa6b0ee705
parent835f87bb0dd3c068896f52bfef98a88b16fa13a5 (diff)
Fix failing CentOS CI tests
pep8 and functests were failing in CentOS CI as reported here: http://comments.gmane.org/gmane.comp.file-systems.gluster.devel/15697 Functional tests were failing because test_copy2() was invoking copy() method instead of copy2(). Further, tests were doing assertions on atime which gets changed every time the file is read. Change-Id: I692e9f44911c32c18b1f92c17b6b455ba2d196a1 Signed-off-by: Prashanth Pai <ppai@redhat.com>
-rw-r--r--setup.py2
-rw-r--r--test/functional/libgfapi-python-tests.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index 633cd37..6f68a01 100644
--- a/setup.py
+++ b/setup.py
@@ -31,7 +31,7 @@ setup(
classifiers=[
'Development Status :: 5 - Production/Stable'
'Intended Audience :: Developers'
- 'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)'
+ 'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)' # noqa
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)'
'Operating System :: POSIX :: Linux'
'Programming Language :: Python'
diff --git a/test/functional/libgfapi-python-tests.py b/test/functional/libgfapi-python-tests.py
index 7dab995..ad2fc08 100644
--- a/test/functional/libgfapi-python-tests.py
+++ b/test/functional/libgfapi-python-tests.py
@@ -658,10 +658,9 @@ class FileOpsTest(unittest.TestCase):
self.assertEqual(src_file_checksum.hexdigest(),
dest_file_checksum.hexdigest())
- # The destination file should not have same atime and mtime
+ # The destination file should not have same mtime
src_stat = self.vol.stat(src_file)
dest_stat = self.vol.stat(dest_file)
- self.assertNotEqual(src_stat.st_atime, dest_stat.st_atime)
self.assertNotEqual(src_stat.st_mtime, dest_stat.st_mtime)
# Test over-writing destination that exists
@@ -766,6 +765,8 @@ class FileOpsTest(unittest.TestCase):
for i in xrange(2):
f.write(os.urandom(128 * 1024))
f.write(os.urandom(25 * 1024))
+ (atime, mtime) = (692884800, 692884800)
+ self.vol.utime(src_file, (atime, mtime))
# Calculate checksum of source file.
src_file_checksum = hashlib.md5()
@@ -775,7 +776,7 @@ class FileOpsTest(unittest.TestCase):
# Copy file into dir
dest_dir = uuid4().hex
self.vol.mkdir(dest_dir)
- self.vol.copy(src_file, dest_dir)
+ self.vol.copy2(src_file, dest_dir)
# Calculate checksum of destination
dest_file = os.path.join(dest_dir, src_file)
@@ -791,7 +792,6 @@ class FileOpsTest(unittest.TestCase):
src_stat = self.vol.stat(src_file)
dest_stat = self.vol.stat(dest_file)
self.assertEqual(src_stat.st_mode, dest_stat.st_mode)
- self.assertEqual(src_stat.st_atime, dest_stat.st_atime)
self.assertEqual(src_stat.st_mtime, dest_stat.st_mtime)