summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-01-28 19:21:31 +0000
committerJürg Billeter <j@bitron.ch>2019-02-14 16:05:38 +0100
commit55bccf630f1ffec9a4d5c1a601e7580a8c2ced3f (patch)
tree65ec73ba05c518b4e5850347223c74e2eb1dd1bd /tests
parentc05708718b06d8fdc0151d7bb474e9beb2eb336b (diff)
downloadbuildstream-55bccf630f1ffec9a4d5c1a601e7580a8c2ced3f.tar.gz
utils.py: Do not mangle absolute symlinks
Copy symlinks as they are, absolute or relative. We no longer resolve symlinks when copying files, which makes this safe.
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/symlinks.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/integration/symlinks.py b/tests/integration/symlinks.py
index 5674b5778..5db09d3d0 100644
--- a/tests/integration/symlinks.py
+++ b/tests/integration/symlinks.py
@@ -20,7 +20,7 @@ DATA_DIR = os.path.join(
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox')
-def test_absolute_symlinks_made_relative(cli, tmpdir, datafiles):
+def test_absolute_symlinks(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
element_name = 'symlinks/dangling-symlink.bst'
@@ -34,12 +34,9 @@ def test_absolute_symlinks_made_relative(cli, tmpdir, datafiles):
symlink = os.path.join(checkout, 'opt', 'orgname')
assert os.path.islink(symlink)
- # The symlink is created to point to /usr/orgs/orgname, but BuildStream
- # should make all symlink target relative when assembling the artifact.
- # This is done so that nothing points outside the sandbox and so that
- # staging artifacts in locations other than / doesn't cause the links to
- # all break.
- assert os.readlink(symlink) == '../usr/orgs/orgname'
+ # The symlink is created to point to /usr/orgs/orgname and BuildStream
+ # should not mangle symlinks.
+ assert os.readlink(symlink) == '/usr/orgs/orgname'
@pytest.mark.datafiles(DATA_DIR)