Skip to content

Commit

Permalink
CI tests: enforce TMPDIR on tmpfs
Browse files Browse the repository at this point in the history
First, setup a custom TMPDIR to ensure we have no special assumptions
about hard coded paths. Second, make sure it is actually on a tmpfs so
we can catch regressions in the VM setup immediately.

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed May 3, 2024
1 parent f7cb455 commit b5604a4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ build_task:
CI_DESIRED_RUNTIME: crun
CI_DESIRED_DATABASE: boltdb
CI_DESIRED_STORAGE: vfs
# Catch invalid "TMPDIR == /tmp" assumptions; PR #19281
TMPDIR: /var/tmp
- env:
<<: *stdenvars
DISTRO_NV: ${RAWHIDE_NAME}
Expand Down
14 changes: 14 additions & 0 deletions contrib/cirrus/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ exec_container() {
# shellcheck disable=SC2154
exec bin/podman run --rm --privileged --net=host --cgroupns=host \
-v `mktemp -d -p /var/tmp`:/var/tmp:Z \
--tmpfs /tmp:mode=1777 \
-v /dev/fuse:/dev/fuse \
-v "$GOPATH:$GOPATH:Z" \
--workdir "$GOSRC" \
Expand Down Expand Up @@ -407,8 +408,21 @@ dotest() {
die "Found fallback podman '$fallback_podman' in \$PATH; tests require none, as a guarantee that we're testing the right binary."
fi

# Catch invalid "TMPDIR == /tmp" assumptions; PR #19281
TMPDIR=$(mktemp --tmpdir -d CI_XXXX)
# tmp dir is commonly 1777 to allow all user to read/write
chmod 1777 $TMPDIR
export TMPDIR
fstype=$(findmnt -n -o FSTYPE --target $TMPDIR)
if [[ "$fstype" != "tmpfs" ]]; then
die "The CI test TMPDIR is not on a tmpfs mount, we need tmpfs to make the tests faster"
fi

showrun make ${localremote}${testsuite} PODMAN_SERVER_LOG=$PODMAN_SERVER_LOG \
|& logformatter

rm -rf $TMPDIR
unset TMPDIR
}

_run_machine-linux() {
Expand Down

0 comments on commit b5604a4

Please sign in to comment.