From 3c5fff3a372dbc8257c9a1597d1dd781153f2912 Mon Sep 17 00:00:00 2001 From: aien-spark Date: Wed, 4 Nov 2026 19:45:36 -0600 Subject: [PATCH] tests: make gate34-writer KAT commit ids hermetic (#93) mkrepo built its fixture commits under the caller's GIT_AUTHOR_*/GIT_COMMITTER_* environment and global git config. Those change the commit ids, which feed the PASS body, so the known-value digest check failed on hosts with such env. Pin identity, dates and signing, and ignore global/system config. Fixes #93 Signed-off-by: aien-spark --- tests/test_forge_gates_receipt.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_forge_gates_receipt.sh b/tests/test_forge_gates_receipt.sh index 20888db..a6856ff 100755 --- a/tests/test_forge_gates_receipt.sh +++ b/tests/test_forge_gates_receipt.sh @@ -45,9 +45,16 @@ FIX=$HERE/tests/fixtures/forge_gates_pass.log # digest of the PASS body built below (fixed repos, run id and time), made by # omega tools/json_canon.c --sha256 at omega 3875223 KAT_DIGEST=b1a2f42cb95ba7246c71addb3e87f98c94aad95ea61e0c2930462fabe5667573 +# mkrepo DIR CONTENT -- one-commit repo whose commit id is the same on every +# host. The commit id feeds the PASS body and so KAT_DIGEST: identity, dates +# and signing are fixed here, so the caller's GIT_AUTHOR_*/GIT_COMMITTER_* +# environment and global/system git config cannot change it (issue #93). mkrepo() { git init -q "$1" && echo "$2" > "$1/f" && git -C "$1" add f && - GIT_AUTHOR_DATE=2026-09-30T00:00:00Z GIT_COMMITTER_DATE=2026-09-30T00:00:00Z git -C "$1" -c user.name=T -c user.email=t@example.invalid commit -qm c && + GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1 GIT_CONFIG_COUNT=0 \ + GIT_AUTHOR_NAME=T GIT_AUTHOR_EMAIL=t@example.invalid GIT_AUTHOR_DATE=2026-09-30T00:00:00Z \ + GIT_COMMITTER_NAME=T GIT_COMMITTER_EMAIL=t@example.invalid GIT_COMMITTER_DATE=2026-09-30T00:00:00Z \ + git -C "$1" -c commit.gpgsign=false commit -qm c && git -C "$1" rev-parse HEAD } O=$TMP/omega; P=$TMP/physics