summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-11-21 07:16:26 +0100
committerJürg Billeter <j@bitron.ch>2019-12-03 12:06:31 +0000
commite090301959d7ef5a5de8e4c0e3a1f373d2c4c7c5 (patch)
tree68ee4807563ac0828377feaeaa8d577a28ca5a0b
parent1f124cfd0e4cc913531f3846c928a6d56ffc409f (diff)
downloadbuildstream-juerg/casd-separate-user.tar.gz
tests: source_determinism.py: Do not use too restrictive test umasksjuerg/casd-separate-user
To protect the local cache of buildbox-casd from corruption without the use of FUSE, buildbox-casd has to run as a different user. Use less restrictive umasks in the source determinism tests to allow buildbox-casd to function when it is running as a separate user.
-rw-r--r--src/buildstream/testing/_sourcetests/source_determinism.py9
-rw-r--r--tests/integration/source-determinism.py9
2 files changed, 14 insertions, 4 deletions
diff --git a/src/buildstream/testing/_sourcetests/source_determinism.py b/src/buildstream/testing/_sourcetests/source_determinism.py
index 27664e0c2..f84d18ba2 100644
--- a/src/buildstream/testing/_sourcetests/source_determinism.py
+++ b/src/buildstream/testing/_sourcetests/source_determinism.py
@@ -23,7 +23,7 @@ import os
import pytest
from buildstream import _yaml
-from .._utils.site import HAVE_SANDBOX
+from .._utils.site import HAVE_SANDBOX, CASD_SEPARATE_USER
from .. import create_repo
from .. import cli # pylint: disable=unused-import
from .utils import kind # pylint: disable=unused-import
@@ -101,4 +101,9 @@ def test_deterministic_source_umask(cli, tmpdir, datafiles, kind):
os.umask(old_umask)
cli.remove_artifact_from_cache(project, element_name)
- assert get_value_for_umask(0o022) == get_value_for_umask(0o077)
+ if CASD_SEPARATE_USER:
+ # buildbox-casd running as separate user of the same group can't
+ # function in a test environment with a too restrictive umask.
+ assert get_value_for_umask(0o002) == get_value_for_umask(0o007)
+ else:
+ assert get_value_for_umask(0o022) == get_value_for_umask(0o077)
diff --git a/tests/integration/source-determinism.py b/tests/integration/source-determinism.py
index a349f9eeb..14559759d 100644
--- a/tests/integration/source-determinism.py
+++ b/tests/integration/source-determinism.py
@@ -6,7 +6,7 @@ import pytest
from buildstream import _yaml
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_SANDBOX
+from buildstream.testing._utils.site import HAVE_SANDBOX, CASD_SEPARATE_USER
DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project")
@@ -69,4 +69,9 @@ def test_deterministic_source_local(cli, tmpdir, datafiles):
finally:
cli.remove_artifact_from_cache(project, element_name)
- assert get_value_for_mask(0o7777) == get_value_for_mask(0o0700)
+ if CASD_SEPARATE_USER:
+ # buildbox-casd running as separate user of the same group can't
+ # read files with too restrictive permissions.
+ assert get_value_for_mask(0o7777) == get_value_for_mask(0o0770)
+ else:
+ assert get_value_for_mask(0o7777) == get_value_for_mask(0o0700)