diff options
-rwxr-xr-x | test/end-to-end/just-mr/git-env.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/end-to-end/just-mr/git-env.sh b/test/end-to-end/just-mr/git-env.sh index 5a41127e..0e8d9eca 100755 --- a/test/end-to-end/just-mr/git-env.sh +++ b/test/end-to-end/just-mr/git-env.sh @@ -44,7 +44,7 @@ mkdir -p "${MOCK_TOOLS}" MOCK_GIT="${MOCK_TOOLS}/mock-git" cat > "${MOCK_GIT}" <<'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 EOF cat >> "${MOCK_GIT}" <<EOF @@ -67,6 +67,8 @@ cd "${WRKDIR}" 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" mkdir repo cd repo @@ -89,15 +91,22 @@ echo cat repos.json echo +cat > local.json <<'EOF' +{"extra inherit env": ["LOCAL_CREDENTIAL_PATH"]} +EOF + # Succesfull build "${JUST_MR}" --norc --just "${JUST}" --local-build-root "${LBR}" \ - --git "${MOCK_GIT}" --log-limit 5 \ + --checkout-locations local.json --git "${MOCK_GIT}" --log-limit 5 \ install -o "${OUT}" '' sources.txt 2>&1 grep checked-out "${OUT}/sources.txt" +# Verify the local.json is needed +"${JUST_MR}" --norc --git "${MOCK_GIT}" --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 --git "${MOCK_GIT}" --local-build-root "${LBR2}" --checkout-locations local.json setup 2>&1 && exit 1 || : echo DONE |