Add virtio-fs integration tests (pjdfstest suite, custom fallocate test)#639
Merged
slp merged 3 commits intocontainers:mainfrom May 5, 2026
Merged
Add virtio-fs integration tests (pjdfstest suite, custom fallocate test)#639slp merged 3 commits intocontainers:mainfrom
slp merged 3 commits intocontainers:mainfrom
Conversation
88d3ced to
fa57232
Compare
5656048 to
ae57b7f
Compare
Collaborator
|
/gemini review |
There was a problem hiding this comment.
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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note I decided NOT to run the pjdfstest suite on the CI:
aarch64runnre we have some problem with using podman (rootless namespaces are not setup? subuid mapping for the user is not setup? something like that)x86runner 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.