Add a simple test for the newly introduced read-only virtiofs#638
Merged
slp merged 3 commits intocontainers:mainfrom Apr 21, 2026
Merged
Add a simple test for the newly introduced read-only virtiofs#638slp merged 3 commits intocontainers:mainfrom
slp merged 3 commits intocontainers:mainfrom
Conversation
d4a574c to
2cf3c8b
Compare
Guest code may use Linux-only libc calls that won't compile with other toolchains. Signed-off-by: Matej Hrica <mhrica@redhat.com>
Allow tests that need custom root configuration (e.g. read-only mounts via krun_add_virtiofs3) to reuse rootfs directory creation and guest-agent copying without being forced into krun_set_root + krun_start_enter. Signed-off-by: Matej Hrica <mhrica@redhat.com>
Collaborator
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new smoke test, virtiofs-root-ro, to verify that mutation operations fail on a read-only virtiofs root. It also refactors the test setup logic to allow manual root filesystem configuration and restricts unit tests to Linux environments. Feedback suggests replacing an unreachable!() macro with a successful return to handle normal VM shutdown and using the nix crate's safe wrappers for extended attribute operations to improve code safety.
Verify that krun_add_virtiofs3 with KRUN_FS_ROOT_TAG and read_only=true correctly exposes the root filesystem as read-only to the guest. Signed-off-by: Matej Hrica <mhrica@redhat.com>
Collaborator
|
LGTM, thanks! |
slp
approved these changes
Apr 21, 2026
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.
This PR adds a smoke test that asserts basic mutation operations fail on a read-only virtiofs root. Note, that this is not exhaustive and for a security sensitive test it would also be better to bypass the guest kernel and execute the virtiofs commands directly.