Skip to content

Add virtio-fs integration tests (pjdfstest suite, custom fallocate test)#639

Merged
slp merged 3 commits intocontainers:mainfrom
mtjhrc:pjdfstest
May 5, 2026
Merged

Add virtio-fs integration tests (pjdfstest suite, custom fallocate test)#639
slp merged 3 commits intocontainers:mainfrom
mtjhrc:pjdfstest

Conversation

@mtjhrc
Copy link
Copy Markdown
Collaborator

@mtjhrc mtjhrc commented Apr 16, 2026

Note I decided NOT to run the pjdfstest suite on the CI:

  • in the aarch64 runnre we have some problem with using podman (rootless namespaces are not setup? subuid mapping for the user is not setup? something like that)
  • in the x86 runner it works, but it is too slow - it takes >30 minutes in the CI (I haven't tried to bump the timeout futher). This seems too long for nice development.

The upstream pjdfstest suite has failures on macOS host, so @slp has their fork for macOS here: https://github.com/slp/pjdfstest/tree/libkrun-macos

But there are also failures when running on Linux. Specifically it wants to try calls such as mknod which we don't work under podman (even vanilla podman without krun).
I have made my own fork here https://github.com/mtjhrc/pjdfstest/tree/libkrun which adapts which tests are skipped based on the host system which we are running the test on.
Also note on Linux it is best to run this under tmpfs (this is the default, assuming your /tmp is tmpfs). It should supposedly also work under ext4, but notably some tests fail on btrfs.

@mtjhrc mtjhrc force-pushed the pjdfstest branch 2 times, most recently from 88d3ced to fa57232 Compare April 22, 2026 09:14
@mtjhrc mtjhrc changed the title Add a filesystem test suite (pjdfstest) to the test runner Add virtio-fs integration tests (pjdfstest suite, custom fallocate test) Apr 28, 2026
@mtjhrc mtjhrc force-pushed the pjdfstest branch 7 times, most recently from 5656048 to ae57b7f Compare April 29, 2026 12:32
@mtjhrc mtjhrc marked this pull request as ready for review April 29, 2026 12:44
@slp
Copy link
Copy Markdown
Collaborator

slp commented Apr 29, 2026

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces new test cases for virtiofs and pjdfstest, along with infrastructure improvements like an env_or_default macro and environment variable support for guest VMs. Feedback highlights the need to replace a misleading unreachable!() with Ok(()) to prevent incorrect test panics, use String::from_utf8_lossy for safer output handling, and adopt nix::libc wrappers instead of raw syscalls for better maintainability.

Comment thread tests/test_cases/src/common.rs
Comment thread tests/test_cases/src/test_virtiofs_misc.rs
Comment thread tests/test_cases/src/test_virtiofs_misc.rs Outdated
mtjhrc added 3 commits May 4, 2026 17:30
Build a pjdfstest fork inside a Containerfile and run the full suite in
the guest via prove. The test is gated behind PJDFSTEST_REPO and
PJDFSTEST_COMMIT env vars at build time; when unset the test is skipped.

You can use my fork of pjdfstest which works on both Linux and macOS
(detects the host platform and skips tests that do not apply):

    PJDFSTEST_REPO=https://github.com/mtjhrc/pjdfstest.git \
    PJDFSTEST_COMMIT=libkrun \
    make test TEST=pjdfstest

Signed-off-by: Matej Hrica <mhrica@redhat.com>
Allow test implementations to access the test directory in their
check() method, enabling host-side file inspection after the VM
exits.

Signed-off-by: Matej Hrica <mhrica@redhat.com>
Tests basic allocate, allocate with KEEP_SIZE, punch hole,
and the error case of punch hole without KEEP_SIZE.
Verifies both guest-side and host-side.

Signed-off-by: Matej Hrica <mhrica@redhat.com>
Copy link
Copy Markdown
Collaborator

@slp slp left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@slp slp merged commit 391409d into containers:main May 5, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants