test code v1
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# Test Case: Superblock Parsing
|
||||
|
||||
**Test ID**: TC014-superblock-parse
|
||||
|
||||
## Objective
|
||||
|
||||
Verify mandatory superblock fields at their real on-disk offsets and compare
|
||||
the mounted values exposed by FreeBSD.
|
||||
|
||||
## Fixture
|
||||
|
||||
Use `images/compact.erofs`, its image hash, `fixture-evidence.txt`, and
|
||||
`tests/statfs_probe.c`.
|
||||
|
||||
## Procedure
|
||||
|
||||
Host inspection:
|
||||
|
||||
```sh
|
||||
od -An -tx4 -j 1024 -N 4 /work/build/repo22-g1/images/compact.erofs
|
||||
od -An -tu1 -j 1036 -N 1 /work/build/repo22-g1/images/compact.erofs
|
||||
od -An -tu2 -j 1038 -N 2 /work/build/repo22-g1/images/compact.erofs
|
||||
od -An -tu8 -j 1040 -N 8 /work/build/repo22-g1/images/compact.erofs
|
||||
od -An -tu4 -j 1060 -N 8 /work/build/repo22-g1/images/compact.erofs
|
||||
dump.erofs -s /work/build/repo22-g1/images/compact.erofs
|
||||
python3 tests/erofs_fixture.py inspect /work/build/repo22-g1/images/compact.erofs
|
||||
```
|
||||
|
||||
Mount the same hashed image in FreeBSD, then run:
|
||||
|
||||
```sh
|
||||
./statfs_probe "$mnt"
|
||||
stat -f 'root_ino=%i type=%HT' "$mnt"
|
||||
mount -p | awk -v p="$mnt" '$2 == p'
|
||||
```
|
||||
|
||||
## Expected Results
|
||||
|
||||
- Magic is `0xe0f5e1e2`, `blkszbits=12`, and checksum validation is true.
|
||||
- Root NID, block count, and inode count agree with root `stat` and
|
||||
`statfs_probe`; filesystem type is `erofs` and read-only.
|
||||
- No parser error appears in the dmesg delta; cleanup succeeds.
|
||||
Reference in New Issue
Block a user