summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPhil Dawson <phil.dawson@codethink.co.uk>2018-12-12 11:40:30 +0000
committerPhil Dawson <phil.dawson@codethink.co.uk>2018-12-12 13:55:19 +0000
commitd55b9e398ca4d95e2ffe70580cddf7911c161d20 (patch)
tree7d57ed6c67b96976dbe986268193eeb8d1f746a0 /tests
parenta5a53ddd243f0da0c485d539591d8a11e5bd5262 (diff)
downloadbuildstream-d55b9e398ca4d95e2ffe70580cddf7911c161d20.tar.gz
Add --tar option to source-checkout command
This commit is part of the work towards #672
Diffstat (limited to 'tests')
-rw-r--r--tests/frontend/source_checkout.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/frontend/source_checkout.py b/tests/frontend/source_checkout.py
index 08230ce5d..343448abc 100644
--- a/tests/frontend/source_checkout.py
+++ b/tests/frontend/source_checkout.py
@@ -1,5 +1,6 @@
import os
import pytest
+import tarfile
from tests.testutils import cli
@@ -56,6 +57,23 @@ def test_source_checkout(datafiles, cli, tmpdir_factory, with_workspace, guess_e
@pytest.mark.datafiles(DATA_DIR)
+def test_source_checkout_tar(datafiles, cli):
+ project = os.path.join(datafiles.dirname, datafiles.basename)
+ checkout = os.path.join(cli.directory, 'source-checkout.tar')
+ target = 'checkout-deps.bst'
+
+ result = cli.run(project=project, args=['source-checkout', '--tar', target, '--deps', 'none', checkout])
+ result.assert_success()
+
+ assert os.path.exists(checkout)
+ with tarfile.open(checkout) as tf:
+ expected_content = os.path.join(checkout, 'checkout-deps', 'etc', 'buildstream', 'config')
+ tar_members = [f.name for f in tf]
+ for member in tar_members:
+ assert member in expected_content
+
+
+@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize('deps', [('build'), ('none'), ('run'), ('all')])
def test_source_checkout_deps(datafiles, cli, deps):
project = os.path.join(datafiles.dirname, datafiles.basename)