diff options
author | Jürg Billeter <j@bitron.ch> | 2019-01-28 19:21:31 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-02-14 16:05:38 +0100 |
commit | 55bccf630f1ffec9a4d5c1a601e7580a8c2ced3f (patch) | |
tree | 65ec73ba05c518b4e5850347223c74e2eb1dd1bd /tests | |
parent | c05708718b06d8fdc0151d7bb474e9beb2eb336b (diff) | |
download | buildstream-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.py | 11 |
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) |