From bbbd5ef5e87b8ecf721d7f0388f95d6724277c95 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 11 Feb 2025 14:50:46 +0100 Subject: Extend git-environment test to verify "extra inherit env" ... from the local file. --- test/end-to-end/just-mr/git-env.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'test') 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}" < 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 -- cgit v1.2.3