Francesco Romani has uploaded a new change for review.
Change subject: tests: do not check permissions on dos filesystem
......................................................................
tests: do not check permissions on dos filesystem
commit 0b147dc2e247e787ad760ba30a8b8815eb65daca
introduced an extra step in unit tests, to check
the permissions of the files in the created filesystem.
This is fine for filesystems which support permissions,
but DOSFS/FAT/VFAT does not, then the tests on this
filesystem started to fail for no good reasons.
This patch fixes this misbehaviour by disabling the
permissions check in filesystem which do not support
them.
Change-Id: I9c14b3cc0538e2f8b09ea99a185ec86e067217f6
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/mkimageTests.py
1 file changed, 15 insertions(+), 14 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/22816/1
diff --git a/tests/mkimageTests.py b/tests/mkimageTests.py
index 463e048..606394b 100644
--- a/tests/mkimageTests.py
+++ b/tests/mkimageTests.py
@@ -103,7 +103,7 @@
self.assertEqual(bool(data.st_mode & perm), expected,
'%s: %s' % (filepath, oct(data.st_mode)))
- def _check_content(self):
+ def _check_content(self, checkPerms=True):
"""
Ensure that the workdir contains what we want
"""
@@ -117,18 +117,19 @@
else:
self.assertTrue(os.path.basename(filename) in out_subdir)
filepath = os.path.join(self.workdir, filename)
- self._check_permissions(filepath,
- ((stat.S_IRGRP, True),
- (stat.S_IWGRP, False),
- (stat.S_IXGRP, False)))
- self._check_permissions(filepath,
- ((stat.S_IRUSR, True),
- (stat.S_IWUSR, True),
- (stat.S_IXUSR, False)))
- self._check_permissions(filepath,
- ((stat.S_IROTH, False),
- (stat.S_IWOTH, False),
- (stat.S_IXOTH, False)))
+ if checkPerms:
+ self._check_permissions(filepath,
+ ((stat.S_IRGRP, True),
+ (stat.S_IWGRP, False),
+ (stat.S_IXGRP, False)))
+ self._check_permissions(filepath,
+ ((stat.S_IRUSR, True),
+ (stat.S_IWUSR, True),
+ (stat.S_IXUSR, False)))
+ self._check_permissions(filepath,
+ ((stat.S_IROTH, False),
+ (stat.S_IWOTH, False),
+ (stat.S_IXOTH, False)))
with open(filepath, "r") as fd:
content = fd.read()
self.assertEqual(content, self.expected_results[filename])
@@ -170,7 +171,7 @@
m = storage.mount.Mount(floppy, self.workdir)
m.mount(mntOpts='loop')
try:
- self._check_content()
+ self._check_content(checkPerms=False)
self._check_label(floppy, label)
finally:
m.umount(force=True)
--
To view, visit
http://gerrit.ovirt.org/22816
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c14b3cc0538e2f8b09ea99a185ec86e067217f6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>