summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-11-12 15:35:02 +0100
committerJürg Billeter <j@bitron.ch>2019-12-17 14:18:11 +0100
commitcea7e315b1e7776189cb8575f6687971977d1cd6 (patch)
tree90b2abb4b400cf65da276d26fc590a7d670afead
parentb696254824e5cc6715924bf16ef6f7c5e0ec2e89 (diff)
downloadbuildstream-cea7e315b1e7776189cb8575f6687971977d1cd6.tar.gz
testing/runcli.py: Add BST_CAS_STAGING_ROOT environment variable
This is required for testing with userchroot to create staging directories in a system-specific prefix.
-rw-r--r--src/buildstream/testing/runcli.py7
-rw-r--r--tox.ini1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/buildstream/testing/runcli.py b/src/buildstream/testing/runcli.py
index c0e278b11..1e868609a 100644
--- a/src/buildstream/testing/runcli.py
+++ b/src/buildstream/testing/runcli.py
@@ -842,6 +842,13 @@ def configured(directory, config=None):
if not config.get("logdir", False):
config["logdir"] = os.path.join(directory, "logs")
+ cas_stage_root = os.environ.get("BST_CAS_STAGING_ROOT")
+ if cas_stage_root:
+ symlink_path = os.path.join(config["cachedir"], "cas", "staging")
+ if not os.path.lexists(symlink_path):
+ os.makedirs(os.path.join(config["cachedir"], "cas"), exist_ok=True)
+ os.symlink(cas_stage_root, symlink_path)
+
# Dump it and yield the filename for test scripts to feed it
# to buildstream as an artument
filename = os.path.join(directory, "buildstream.conf")
diff --git a/tox.ini b/tox.ini
index b037e3984..62737b0ca 100644
--- a/tox.ini
+++ b/tox.ini
@@ -39,6 +39,7 @@ deps =
randomized: pytest-random-order
passenv =
ARTIFACT_CACHE_SERVICE
+ BST_CAS_STAGING_ROOT
BST_FORCE_BACKEND
BST_FORCE_SANDBOX
BST_FORCE_START_METHOD