Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs tests for mounting device files #32

Open
asomers opened this issue Jul 17, 2024 · 1 comment
Open

Needs tests for mounting device files #32

asomers opened this issue Jul 17, 2024 · 1 comment

Comments

@asomers
Copy link
Collaborator

asomers commented Jul 17, 2024

The current test suite only mounts image files. That's useful. But mounting a device file is slightly harder, because all device reads must be aligned to the device's sector size, and a multiple of that same sector size. An example of such a test is at https://github.com/KhaledEmaraDev/xfuse/blob/b6ad7fd32ad4443b5ab4ab684ae0c7639eb31be1/tests/integration.rs#L295 . That module contains three tests. Each mounts an md device backed by the test image:

  • Read all metadata
  • Read all data
  • Read all data with O_DIRECT

Those tests validate that the file server doesn't do any non-sector-size-aligned accesses. Additional test cases would be needed for journaling or soft updates.

@realchonk
Copy link
Owner

I have tested it, and it "just works" for me, but I agree a test is necessary.
It works, because I wrote BlockReader, which does it all for me.

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

No branches or pull requests

2 participants