diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2023-11-03 17:09:34 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-11-13 18:31:51 +0100 |
commit | 28596730eb3ef6231537d702ea16e54d144459bc (patch) | |
tree | fa3fc669abfc6fb35867f9fce8eaf0d499c05ba4 /test/end-to-end/cli | |
parent | 04e2f0aa0ccfe4f39c5f6c713bde182c6b7704dd (diff) | |
download | justbuild-28596730eb3ef6231537d702ea16e54d144459bc.tar.gz |
test: Verify unlink of symlinks
Diffstat (limited to 'test/end-to-end/cli')
-rw-r--r-- | test/end-to-end/cli/install.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/end-to-end/cli/install.sh b/test/end-to-end/cli/install.sh index ee2eb271..1e64b347 100644 --- a/test/end-to-end/cli/install.sh +++ b/test/end-to-end/cli/install.sh @@ -27,6 +27,11 @@ cat > src/TARGETS <<'EOF' , "outs": ["hello.txt"] , "cmds": ["echo Hello World > hello.txt"] } +, "symlink": + { "type": "generic" + , "outs": ["hello.txt", "content.txt"] + , "cmds": ["echo Hello World > content.txt", "ln -s content.txt hello.txt"] + } } EOF SRCDIR=$(realpath src) @@ -66,4 +71,28 @@ cd "${OUTDIR}" grep World "${ID}" grep Original unrelated.txt +# Verify non-interference of install symlinks (overwrite existing file) +cd "${SRCDIR}" +"${TOOL}" install --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 + +echo +ls -al "${OUTDIR}" +cd "${OUTDIR}" +grep World hello.txt +grep Original unrelated.txt +[ "$(realpath --relative-to=$(pwd) hello.txt)" = "content.txt" ] + +# Verify non-interference of install symlinks (overwrite existing symlink) +rm -f ${OUTDIR}/hello.txt +ln -s /noexistent ${OUTDIR}/hello.txt +cd "${SRCDIR}" +"${TOOL}" install --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 + +echo +ls -al "${OUTDIR}" +cd "${OUTDIR}" +grep World hello.txt +grep Original unrelated.txt +[ "$(realpath --relative-to=$(pwd) hello.txt)" = "content.txt" ] + echo OK |