summaryrefslogtreecommitdiff
path: root/tests/sources/remote.py
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2020-06-10 08:26:54 +0200
committerJürg Billeter <j@bitron.ch>2020-06-10 11:22:04 +0200
commit0df31342e9c3c32af55f0ea114a60ab858356173 (patch)
tree869a7c60db613e9f806da61fd1448156d0cf665f /tests/sources/remote.py
parentc0bc6cfa9b2461e86ff39fa157e10cc9ef77d199 (diff)
downloadbuildstream-juerg/object-file-mode.tar.gz
cascache.py: Fix file modes in checkout()juerg/object-file-mode
Do not copy file mode from casd object file. Do not change non-executable mode bits if file is executable.
Diffstat (limited to 'tests/sources/remote.py')
-rw-r--r--tests/sources/remote.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/sources/remote.py b/tests/sources/remote.py
index d546c6131..416d2d53c 100644
--- a/tests/sources/remote.py
+++ b/tests/sources/remote.py
@@ -5,6 +5,7 @@ import os
import stat
import pytest
+from buildstream import utils
from buildstream.testing import ErrorDomain
from buildstream.testing import generate_project
from buildstream.testing import cli # pylint: disable=unused-import
@@ -71,8 +72,12 @@ def test_simple_file_build(cli, tmpdir, datafiles):
mode = os.stat(checkout_file).st_mode
# Assert not executable by anyone
assert not mode & (stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
- # Assert not writeable by anyone other than me
- assert not mode & (stat.S_IWGRP | stat.S_IWOTH)
+
+ # Assert not writeable by anyone other than me (unless umask allows it)
+ if utils.get_umask() & stat.S_IWGRP:
+ assert not mode & stat.S_IWGRP
+ if utils.get_umask() & stat.S_IWOTH:
+ assert not mode & stat.S_IWOTH
@pytest.mark.datafiles(os.path.join(DATA_DIR, "single-file-custom-name"))