test: preserve root TMPDIR prefix

This commit is contained in:
User
2026-08-20 16:53:09 +02:00
parent a1771b6bb9
commit b0ead4be54
2 changed files with 23 additions and 7 deletions
@@ -134,6 +134,21 @@ sed '/^case "\$mode" in/,$d' "$root/scripts/verify-workspace-install-docs.sh" >"
# shellcheck source=/dev/null
source "$verifier_functions"
prefix_tmpdir="$(TMPDIR=/tmp bash -c 'source "$1"; printf "%s" "$tmp_prefix"' _ "$verifier_functions")"
prefix_root="$(TMPDIR=/ bash -c 'source "$1"; printf "%s" "$tmp_prefix"' _ "$verifier_functions")"
[[ "$prefix_tmpdir" == "/tmp/" ]] || {
echo "normalized /tmp prefix must be slash-terminated: $prefix_tmpdir" >&2
exit 1
}
[[ "$prefix_root" == "/" ]] || {
echo "normalized root prefix must remain /: $prefix_root" >&2
exit 1
}
[[ "${prefix_root}thoth-probe.XXXXXX" == "/thoth-probe.XXXXXX" ]] || {
echo "root prefix concatenation produced an invalid path" >&2
exit 1
}
PYTHONDONTWRITEBYTECODE=1 python3 "$root/scripts/test_workspace_descriptor_doc_contract.py"
project_topology_fixture="$negative_root/project-topology-contradiction.md"