tests: Add directory iteration tests for virtio-fs#699
Open
mtjhrc wants to merge 3 commits into
Open
Conversation
Wrap each subtest in catch_unwind so that a failure in one subtest does not prevent the remaining subtests from running. The output now lists each subtest as PASS/FAIL individually. Assisted-by: OpenCode:claude-opus-4.6 Signed-off-by: Matej Hrica <mhrica@redhat.com>
Add 7 subtests that exercise readdir visibility after directory mutations on an already-open handle: create, unlink, mkdir/rmdir, symlink, link, rename (same-dir), and rename (cross-dir). Each test opens a directory, reads entries to populate the cache, mutates the directory, calls rewinddir, and asserts the mutation is visible. These reproduce the macOS virtiofs DirStream cache coherence bug fixed in PR containers#693. Assisted-by: OpenCode:claude-opus-4.6 Signed-off-by: Matej Hrica <mhrica@redhat.com>
Add a test that creates files while iterating a directory via readdir and asserts no duplicate entries are returned. The test inserts entries likely to shift iteration order, maximizing the chance of exposing duplicates. Assisted-by: OpenCode:claude-opus-4.6 Signed-off-by: Matej Hrica <mhrica@redhat.com>
Collaborator
Author
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive suite of tests to verify DirStream cache coherence for the macOS virtiofs passthrough. It adds a helper function run_subtests to execute and report on multiple subtests, and implements test cases covering directory stream behavior during creation, unlinking, directory creation/removal, symlinking, hard linking, renaming, and mid-iteration creation. I have no feedback to provide as there are no review comments.
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 checks for behavior fixed in #693
This has worked before #693 on Linux, notable difference is on macOS hosts.