summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShahwat Dalal <sdalal29@bloomberg.net>2019-07-30 17:49:47 +0100
committerShahwat Dalal <sdalal29@bloomberg.net>2019-09-05 11:12:26 +0100
commitad63e38da8cfd1141ac5de7da9eb5a58e609666e (patch)
treef99e28fc0fadf44b402203883dd0f21b976baad7
parenta0a8015177306efda0823175945ce54342e03e45 (diff)
downloadbuildstream-ad63e38da8cfd1141ac5de7da9eb5a58e609666e.tar.gz
tests/workspaces: Test edge case when linking files to RO directory
When we open a workspace, we are linking the sources to the directory specified. As such testing that we are able to open a workspace on a read-only directory should show that we are able to link files to a RO directory when we are staging complex sources (eg. Docker source).
-rw-r--r--tests/integration/workspace.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/integration/workspace.py b/tests/integration/workspace.py
index fe5e76ea3..9e74e574f 100644
--- a/tests/integration/workspace.py
+++ b/tests/integration/workspace.py
@@ -37,6 +37,20 @@ def test_workspace_mount(cli, datafiles):
@pytest.mark.datafiles(DATA_DIR)
+def test_workspace_mount_on_read_only_directory(cli, datafiles):
+ project = str(datafiles)
+ workspace = os.path.join(cli.directory, 'workspace')
+ os.makedirs(workspace)
+ element_name = 'workspace/workspace-mount.bst'
+
+ # make directory RO
+ os.chmod(workspace, 0o555)
+
+ res = cli.run(project=project, args=['workspace', 'open', '--directory', workspace, element_name])
+ assert res.exit_code == 0
+
+
+@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox')
@pytest.mark.xfail(HAVE_SANDBOX == 'buildbox', reason='Not working with BuildBox', strict=True)
def test_workspace_commanddir(cli, datafiles):