object-storage: Add a sorted list comparison to test
After the commit b0cb7aaf for bz#870589, which adds 2 tarballs with layout patterns, Swift tests sometimes fail (depending on the kind of filesystem they are running at and the phase of the moon). As pattern tarball is unpacked, the underlying filesystem is free to return directory listings in any order, and straightforward use of '==' operator fails. As it turns out, one of the two comparisons had set() applied to the list already. So, add it to the other one. BUG: 874390 Change-Id: I02de99593b9567a13076113d58e242b079fde002 Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Reviewed-on: http://review.gluster.org/4165 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
This commit is contained in:
parent
1f64e5e3dd
commit
f35d192b5f
@ -784,10 +784,10 @@ class TestUtils(unittest.TestCase):
|
||||
cd = utils._get_container_details_from_fs(td)
|
||||
assert cd.bytes_used == 30, repr(cd.bytes_used)
|
||||
assert cd.object_count == 8, repr(cd.object_count)
|
||||
assert cd.obj_list == ['file1', 'file3', 'file2',
|
||||
assert set(cd.obj_list) == set(['file1', 'file3', 'file2',
|
||||
'dir3', 'dir1', 'dir2',
|
||||
'dir1/file1', 'dir1/file2'
|
||||
], repr(cd.obj_list)
|
||||
]), repr(cd.obj_list)
|
||||
full_dir1 = os.path.join(td, 'dir1')
|
||||
full_dir2 = os.path.join(td, 'dir2')
|
||||
full_dir3 = os.path.join(td, 'dir3')
|
||||
|
Loading…
x
Reference in New Issue
Block a user