Fix tests
Some checks failed
CI / test (push) Successful in 50s
CI / test (almalinux, docker.io/library/almalinux:9, python3.11) (push) Failing after 2m36s
CI / test (debian, docker.io/library/debian:13, python3) (push) Failing after 3m2s
Lint / test (push) Successful in 1m15s

This commit is contained in:
Miguel Jacq 2026-06-30 11:11:38 +10:00
parent 737316d507
commit 4146aa997b
Signed by: mig5
GPG key ID: 03906B4110AAD3B8
4 changed files with 22 additions and 1 deletions

View file

@ -2,6 +2,11 @@
set -Eeuo pipefail
# These tests intentionally run as root and exercise Enroll's root-output
# safety checks. Keep test-created directories private even on Forgejo/Docker
# images that default to a permissive umask such as 0002.
umask 077
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TMP_PARENT="${TMPDIR:-/tmp}"
KEEP_WORKDIR=0
@ -9,6 +14,7 @@ if [[ -n "${ENROLL_TEST_WORKDIR:-}" ]]; then
WORK_DIR="${ENROLL_TEST_WORKDIR}"
KEEP_WORKDIR=1
mkdir -p "${WORK_DIR}"
chmod 700 "${WORK_DIR}" || true
else
WORK_DIR="$(mktemp -d "${TMP_PARENT%/}/enroll-tests.XXXXXX")"
fi