Files
erofs-freebsd-out-tree/tests/TC036-file-read-random.md
T
2026-08-18 09:20:44 +02:00

31 lines
990 B
Markdown

# Test Case: Random Regular-File Reads
**Test ID**: TC036-file-read-random
## Objective
Verify independent start, middle, and end `pread(2)` ranges from a deterministic
1 MiB regular file.
## Fixture
Use `images/flat.erofs`, `source/flat/random-test.bin`, and the three
`expected/random-*.bin` files. Evidence asserts layout 0 and exact size.
## Procedure
```sh
./read_probe pread "$mnt/random-test.bin" 0 10240 /tmp/tc036-start
./read_probe pread "$mnt/random-test.bin" 512000 10240 /tmp/tc036-mid
./read_probe pread "$mnt/random-test.bin" 1024000 24576 /tmp/tc036-end
cmp /tmp/repo22-g1/expected/random-start.bin /tmp/tc036-start
cmp /tmp/repo22-g1/expected/random-mid.bin /tmp/tc036-mid
cmp /tmp/repo22-g1/expected/random-end.bin /tmp/tc036-end
sha256 /tmp/tc036-start /tmp/tc036-mid /tmp/tc036-end
```
## Expected Results
- Every bounded `pread` reports its requested byte count and exact offset.
- All three ranges match independently generated source ranges; cleanup passes.