summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Winship <douglas.winship@codethink.co.uk>2020-08-03 21:10:23 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2020-08-13 22:44:38 +0000
commita991708beac9db42b2b3037648cdb192792c87b3 (patch)
tree6890b12f078f5fe6ec0ac706c6fb595bffdd82b6
parent10e208d0c40ebacc43cc9da2ebaf73c10bbc37da (diff)
downloadbuildstream-a991708beac9db42b2b3037648cdb192792c87b3.tar.gz
regression-test for ".bst" artifact checkout bugdwinship/test_for_dot_bst_artifact_checkout_bug
-rw-r--r--tests/frontend/buildcheckout.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py
index e613b4194..7c1f910b6 100644
--- a/tests/frontend/buildcheckout.py
+++ b/tests/frontend/buildcheckout.py
@@ -69,6 +69,30 @@ def test_build_checkout(datafiles, cli, strict, hardlinks):
@pytest.mark.datafiles(DATA_DIR)
+def test_include_dot_bst_in_checkout_dirname(datafiles, cli):
+ # put '.bst' on the end of the checkout directory
+ # this is a regression test for a bug. The bug would
+ # remove '.bst' if it appeared at the end of of the
+ # "--directory" argument.
+ project = str(datafiles)
+ checkout = os.path.join(cli.directory, "checkout.bst")
+
+ # build the artifact
+ result = cli.run(project=project, args=["--no-strict", "build", "target.bst"])
+ result.assert_success()
+
+ # checkout
+ result = cli.run(project=project, args=["artifact", "checkout", "target.bst", "--directory", checkout])
+ result.assert_success()
+
+ # check that the executable hello file is found in the checkout (ie
+ # confirm files were checked out to directory called "checkout.bst"
+ # (as expected) and not to a directory calld "checkout")
+ filename = os.path.join(checkout, "usr", "bin", "hello")
+ assert os.path.exists(filename)
+
+
+@pytest.mark.datafiles(DATA_DIR)
def test_non_strict_build_strict_checkout(datafiles, cli):
project = str(datafiles)
checkout = os.path.join(cli.directory, "checkout")