realchonk / fuse-ufs

FUSE driver for FreeBSD's UFSv2
BSD 2-Clause "Simplified" License
7 stars 3 forks source link

Needs tests for mounting device files #32

Open asomers opened 3 months ago

asomers commented 3 months ago

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:

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 commented 3 months ago

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.