CLI: Add virtiofs mapshared regression test - #41427
Merged
David Bennett (dkbennett) merged 5 commits intoAug 25, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new WSLC E2E regression test intended to validate MAP_SHARED mmap behavior on Windows-backed bind mounts inside containers (and to ensure the mount is backed by virtiofs).
Changes:
- Add a new
container runE2E test that mounts a host directory into/dataand runs a Python snippet that checks/datais avirtiofsmount. - Attempt an
mmap(..., MAP_SHARED, ...)on a file inside the bind mount and validate the command exits successfully.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Blue (OneBlue)
previously approved these changes
Aug 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp:1200
- This MAP_SHARED persistence check also uses Python
assert, which can be optimized away. Raising an explicit exception keeps the test effective regardless of optimization settings and produces a clearer failure mode.
with mmap.mmap(fd, 32 * 1024, flags=mmap.MAP_SHARED, prot=mmap.PROT_READ | mmap.PROT_WRITE) as mapping:
mapping[0:1] = b'W'
mapping.flush()
assert os.pread(fd, 1, 0) == b'W'
Blue (OneBlue)
previously approved these changes
Aug 25, 2026
| VERIFY_IS_TRUE(std::filesystem::exists(EnvTestFile1)); | ||
| VERIFY_ARE_EQUAL(32ull * 1024, std::filesystem::file_size(EnvTestFile1)); | ||
|
|
||
| std::ifstream mappedFile(EnvTestFile1, std::ios::binary); |
Collaborator
There was a problem hiding this comment.
nit: This could be simplified to: VERIFY_IS_TRUE(ReadFileContent(EnvTestFile1)[0], L'W');
Blue (OneBlue)
approved these changes
Aug 25, 2026
David Bennett (dkbennett)
enabled auto-merge (squash)
August 25, 2026 19:28
David Bennett (dkbennett)
deleted the
user/dkbennett/viriofs_map_shared_test
branch
August 25, 2026 20:57
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.
Summary
Add an E2E regression test for
MAP_SHAREDon Windows-backed WSLC bind mounts. This confirms behavior enabled by a virtiofs fix. This is a test-only PR that adds a single test.PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed