diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-02-11 15:16:13 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-02-11 16:32:15 +0100 |
commit | 736571bd63aa129e7601182183faa34fd58888d1 (patch) | |
tree | 3e7830d84381b45909eba67f46becb8e26cf0e8f /test/end-to-end | |
parent | bbbd5ef5e87b8ecf721d7f0388f95d6724277c95 (diff) | |
download | justbuild-736571bd63aa129e7601182183faa34fd58888d1.tar.gz |
Extend git-tree-env test to also verify "extra inherit env"
... from the local file.
Diffstat (limited to 'test/end-to-end')
-rwxr-xr-x | test/end-to-end/just-mr/git-tree-env.sh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/end-to-end/just-mr/git-tree-env.sh b/test/end-to-end/just-mr/git-tree-env.sh index 255bd9e9..692d9b63 100755 --- a/test/end-to-end/just-mr/git-tree-env.sh +++ b/test/end-to-end/just-mr/git-tree-env.sh @@ -24,7 +24,7 @@ OUT="${TEST_TMPDIR}/out" mkdir -p bin cat > bin/mock-vcs <<'EOF' #!/bin/sh -if [ "$(cat ${CREDENTIAL_PATH:-/dev/null})" = "sEcReT" ] +if [ "$(cat ${CREDENTIAL_PATH:-/dev/null})" = "sEcReT" ] && [ "$(cat ${LOCAL_CREDENTIAL_PATH:-/dev/null})" = "local-SeCrEt" ] then echo 'checked-out sources' > sources.txt echo '{}' > TARGETS @@ -38,6 +38,8 @@ export PATH="$(pwd)/bin:${PATH}" mkdir -p etc echo -n sEcReT > etc/pass export CREDENTIAL_PATH="$(pwd)/etc/pass" +echo -n local-SeCrEt > etc/local-pass +export LOCAL_CREDENTIAL_PATH="$(pwd)/etc/local-pass" # Compute tree of our mock checkout mkdir work @@ -72,14 +74,24 @@ cat > repos.json <<EOF EOF cat repos.json +cat > local.json <<'EOF' +{"extra inherit env": ["LOCAL_CREDENTIAL_PATH"]} +EOF + # Succesfull build "${JUST_MR}" --norc --just "${JUST}" --local-build-root "${LBR}" \ + --checkout-locations local.json \ install -o "${OUT}" '' sources.txt 2>&1 grep checked-out "${OUT}/sources.txt" +# Verify the local.json is needed +"${JUST_MR}" --norc --local-build-root "${LBR2}" setup 2>&1 && exit 1 || : + # Verify the environment is needed export CREDENTIAL_PATH=/dev/null -"${JUST_MR}" --norc --local-build-root "${LBR2}" setup 2>&1 && exit 1 || : +"${JUST_MR}" --norc --local-build-root "${LBR2}" \ + --checkout-locations local.json \ + setup 2>&1 && exit 1 || : echo DONE |