summaryrefslogtreecommitdiff
path: root/tests/integration/shell.py
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2018-11-01 18:22:41 +0000
committerJonathan Maw <jonathan.maw@codethink.co.uk>2018-12-11 14:12:54 +0000
commit494cb7c65b62b915fe036d8ff39b522db0d1703c (patch)
treef845189dfc5344dce28b5762093322a53665a341 /tests/integration/shell.py
parentf145a3e4c66017ab5b2de492c4d6de538d4ec224 (diff)
downloadbuildstream-494cb7c65b62b915fe036d8ff39b522db0d1703c.tar.gz
tests: Test bst commands from an external workspace
This is a part of #222
Diffstat (limited to 'tests/integration/shell.py')
-rw-r--r--tests/integration/shell.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/integration/shell.py b/tests/integration/shell.py
index 68535bfdc..1cec21818 100644
--- a/tests/integration/shell.py
+++ b/tests/integration/shell.py
@@ -353,3 +353,29 @@ def test_integration_devices(cli, tmpdir, datafiles):
result = execute_shell(cli, project, ["true"], element=element_name)
assert result.exit_code == 0
+
+
+# Test that a shell can be opened from an external workspace
+@pytest.mark.datafiles(DATA_DIR)
+@pytest.mark.parametrize("build_shell", [("build"), ("nobuild")])
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
+def test_integration_external_workspace(cli, tmpdir_factory, datafiles, build_shell):
+ tmpdir = tmpdir_factory.mktemp("")
+ project = os.path.join(datafiles.dirname, datafiles.basename)
+ element_name = 'autotools/amhello.bst'
+ workspace_dir = os.path.join(str(tmpdir), 'workspace')
+
+ result = cli.run(project=project, args=[
+ 'workspace', 'open', '--directory', workspace_dir, element_name
+ ])
+ result.assert_success()
+
+ result = cli.run(project=project, args=['-C', workspace_dir, 'build', element_name])
+ result.assert_success()
+
+ command = ['shell']
+ if build_shell == 'build':
+ command.append('--build')
+ command.extend([element_name, '--', 'true'])
+ result = cli.run(project=project, cwd=workspace_dir, args=command)
+ result.assert_success()