Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run e2e test on tmpfs #22533

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:
DEBIAN_NAME: "debian-13"

# Image identifiers
IMAGE_SUFFIX: "c20240506t132946z-f40f39d13"
IMAGE_SUFFIX: "c20240513t140131z-f40f39d13"

# EC2 images
FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}"
Expand Down 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 Expand Up @@ -707,25 +705,7 @@ rootless_integration_test_task:
# Docs: ./contrib/cirrus/CIModes.md
only_if: *not_tag_branch_build_docs_machine
depends_on: *build
# FIXME: Fails on Debian rootless ref: #22625
# matrix: *platform_axis
# FIXME: Fails on Debian rootless ref: #22625
matrix: # The following is just like *platform_axis minus Debian
- env: *stdenvars
- env:
DISTRO_NV: ${PRIOR_FEDORA_NAME}
VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME}
CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN}
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}
VM_IMAGE_NAME: ${RAWHIDE_CACHE_IMAGE_NAME}
CTR_FQIN: ""
matrix: *platform_axis
gce_instance: *standardvm
timeout_in: 50m
env:
Expand Down
17 changes: 17 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,24 @@ 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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this check and message, it's helpful.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not worth a re-push, but: in case of failure, this will be very difficult to debug. A more helpful message might be something like

    die "The CI test TMPDIR ($TMPDIR) fs type is '$fstype'; it should be 'tmpfs' (PR #22533)"

fi

Luap99 marked this conversation as resolved.
Show resolved Hide resolved
showrun make ${localremote}${testsuite} PODMAN_SERVER_LOG=$PODMAN_SERVER_LOG \
|& logformatter

# FIXME: https://github.com/containers/podman/issues/22642
# Cannot delete this due cleanup errors, as the VM is basically
# done after this anyway let's not block on this for now.
# rm -rf $TMPDIR
# unset TMPDIR
}

_run_machine-linux() {
Expand Down
11 changes: 1 addition & 10 deletions test/e2e/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,7 @@ const (
)

var _ = SynchronizedBeforeSuite(func() []byte {
// One global scratch directory under which all test files will live.
// The usual case is that these tests are running in CI, on VMs
// with limited RAM, so we use /var/tmp.
baseTmpDir := "/var/tmp"
if os.Getenv("CI") == "" {
// Almost certainly a manual run, e.g., a developer with
// a hotrod workstation. Assume they know what they're doing.
baseTmpDir = ""
}
globalTmpDir, err := os.MkdirTemp(baseTmpDir, "podman-e2e-")
globalTmpDir, err := os.MkdirTemp("", "podman-e2e-")
Luap99 marked this conversation as resolved.
Show resolved Hide resolved
Expect(err).ToNot(HaveOccurred())

// make cache dir
Expand Down