[Bugs] [Bug 1630804] libgfapi-python: test_listdir_with_stat and test_scandir failure on release 5 branch
bugzilla at redhat.com
bugzilla at redhat.com
Wed Sep 19 11:06:51 UTC 2018
https://bugzilla.redhat.com/show_bug.cgi?id=1630804
--- Comment #1 from Prashanth Pai <ppai at redhat.com> ---
$ git diff
diff --git a/test/functional/libgfapi-python-tests.py
b/test/functional/libgfapi-python-tests.py
index f6cc0fb..320ba4b 100644
--- a/test/functional/libgfapi-python-tests.py
+++ b/test/functional/libgfapi-python-tests.py
@@ -905,6 +905,7 @@ class DirOpsTest(unittest.TestCase):
file_count = 0
symlink_count = 0
for index, (name, stat_info) in enumerate(dir_list_sorted):
+ print name, stat_info.st_mode
self.assertTrue(isinstance(stat_info, Stat))
if stat.S_ISREG(stat_info.st_mode):
self.assertEqual(stat_info.st_size, len(self.data))
@@ -914,6 +915,7 @@ class DirOpsTest(unittest.TestCase):
dir_count += 1
elif stat.S_ISLNK(stat_info.st_mode):
symlink_count += 1
+ print self.vol.stat(os.path.join(self.dir_path, "testfile")).st_mode
self.assertEqual(dir_count, 3)
self.assertEqual(file_count, 1)
self.assertEqual(symlink_count, 2)
$ nosetests -v --exe
test/functional/libgfapi-python-tests.py:DirOpsTest.test_listdir_with_stat
test_listdir_with_stat (test.functional.libgfapi-python-tests.DirOpsTest) ...
FAIL
======================================================================
FAIL: test_listdir_with_stat (test.functional.libgfapi-python-tests.DirOpsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/ppai/src/libgfapi-python/test/functional/libgfapi-python-tests.py", line
920, in test_listdir_with_stat
self.assertEqual(file_count, 1)
AssertionError: 0 != 1
-------------------- >> begin captured stdout << ---------------------
test_symlink_dir 41471
test_symlink_file 41471
testdir0 16895
testdir1 16895
testdir2 16895
testfile 0
33206
--------------------- >> end captured stdout << ----------------------
----------------------------------------------------------------------
Ran 1 test in 1.007s
FAILED (failures=1)
Seems like st_mode isn't populated in glfs_readdirplus_r() response for a
regular file. A subsequent stat call gives the right result.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are on the CC list for the bug.
You are the assignee for the bug.
More information about the Bugs
mailing list