summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2020-05-27 16:52:26 +0200
committerWilliam Salmon <will.salmon@codethink.co.uk>2020-05-28 08:36:11 +0000
commit0e6bef6c9d6c53840a9eb2bc5baedd007c8014fe (patch)
treefc1009e59d6abc16bd080817e1978eca1acd0bc8
parent1a94912ef15e2ad827332b93d97cb9d1c797ddb4 (diff)
downloadbuildstream-juerg/expandsandbox.tar.gz
tests/integration/sandbox.py: Test variable expansion in sandbox configjuerg/expandsandbox
-rw-r--r--tests/integration/project/elements/sandbox/build-arch.bst12
-rw-r--r--tests/integration/project/project.conf1
-rw-r--r--tests/integration/sandbox.py12
3 files changed, 25 insertions, 0 deletions
diff --git a/tests/integration/project/elements/sandbox/build-arch.bst b/tests/integration/project/elements/sandbox/build-arch.bst
new file mode 100644
index 000000000..d03f36792
--- /dev/null
+++ b/tests/integration/project/elements/sandbox/build-arch.bst
@@ -0,0 +1,12 @@
+kind: manual
+
+depends:
+ - filename: base.bst
+ type: build
+
+sandbox:
+ build-arch: '%{build_arch}'
+
+config:
+ build-commands:
+ - true
diff --git a/tests/integration/project/project.conf b/tests/integration/project/project.conf
index d30996041..2d3da467b 100644
--- a/tests/integration/project/project.conf
+++ b/tests/integration/project/project.conf
@@ -13,6 +13,7 @@ options:
arch:
type: arch
description: Current architecture
+ variable: build_arch
values:
- x86-64
- aarch64
diff --git a/tests/integration/sandbox.py b/tests/integration/sandbox.py
index da0073377..cfa177e5e 100644
--- a/tests/integration/sandbox.py
+++ b/tests/integration/sandbox.py
@@ -39,3 +39,15 @@ def test_sandbox_shm(cli, datafiles):
result = cli.run(project=project, args=["build", element_name])
assert result.exit_code == 0
+
+
+# Test that variable expansion works in build-arch sandbox config.
+# Regression test for https://gitlab.com/BuildStream/buildstream/-/issues/1303
+@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
+@pytest.mark.datafiles(DATA_DIR)
+def test_build_arch(cli, datafiles):
+ project = str(datafiles)
+ element_name = "sandbox/build-arch.bst"
+
+ result = cli.run(project=project, args=["build", element_name])
+ assert result.exit_code == 0