Skip to content

tests: Add directory iteration tests for virtio-fs#699

Open
mtjhrc wants to merge 3 commits into
containers:mainfrom
mtjhrc:dir-iter-test
Open

tests: Add directory iteration tests for virtio-fs#699
mtjhrc wants to merge 3 commits into
containers:mainfrom
mtjhrc:dir-iter-test

Conversation

@mtjhrc
Copy link
Copy Markdown
Collaborator

@mtjhrc mtjhrc commented May 29, 2026

This checks for behavior fixed in #693

This has worked before #693 on Linux, notable difference is on macOS hosts.

mtjhrc added 3 commits May 29, 2026 15:05
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>
@mtjhrc mtjhrc marked this pull request as ready for review May 29, 2026 13:23
@mtjhrc
Copy link
Copy Markdown
Collaborator Author

mtjhrc commented May 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 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.

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.

1 participant