summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2025-02-11 14:50:46 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-02-11 16:32:15 +0100
commitbbbd5ef5e87b8ecf721d7f0388f95d6724277c95 (patch)
tree90ba798bbe2198357a68a1c334846cd984562cdb
parent11279f7e7a808d5440ebfeaa734b892d202094e0 (diff)
downloadjustbuild-bbbd5ef5e87b8ecf721d7f0388f95d6724277c95.tar.gz
Extend git-environment test to verify "extra inherit env"
... from the local file.
-rwxr-xr-xtest/end-to-end/just-mr/git-env.sh15
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