Skip to content

Commit

Permalink
Merge pull request #1284 from ldoktor/unittest-fixes
Browse files Browse the repository at this point in the history
selftests: Few pre-release unittest fixes
  • Loading branch information
apahim authored Jul 4, 2016
2 parents 3a88697 + d43998e commit 01be14d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions selftests/unit/test_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,15 @@ def get_path(*args):
self.assertEqual(os.path.realpath(get_path("link_to_dir")),
get_path("dir"))
# File permissions
# TODO: Handle permission correctly for all users
# Default perm by user is 0o664 and by root 0o644
default_perm = 0o664 if os.getuid() else 0o644
self.assertEqual(os.stat(get_path("dir", "file2")).st_mode & 0o777,
0o664)
default_perm)
self.assertEqual(os.stat(get_path("file")).st_mode & 0o777, 0o753)
self.assertEqual(os.stat(get_path("dir")).st_mode & 0o777, 0o775)
self.assertEqual(os.stat(get_path("link_to_file2")).st_mode & 0o777,
0o664)
default_perm)
self.assertEqual(os.stat(get_path("link_to_dir")).st_mode & 0o777,
0o775)
self.assertEqual(os.stat(get_path("link_to_file")).st_mode & 0o777,
Expand Down
2 changes: 2 additions & 0 deletions selftests/unit/test_utils_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class TestPartition(unittest.TestCase):
Unit tests for avocado.utils.partition
"""

@unittest.skipIf(process.system("which mkfs", ignore_status=True),
"mkfs is required for these tests to run.")
def setUp(self):
try:
process.system("/bin/true", sudo=True)
Expand Down

0 comments on commit 01be14d

Please sign in to comment.