Files
erofs-freebsd-out-tree/tests/TC025-nlink1-handling.md
T
2026-08-13 10:44:59 +02:00

36 lines
1.1 KiB
Markdown

# Test Case: Compact Inode Link-Count Rules
**Test ID**: TC025-nlink1-handling
## Objective
Compare explicit compact link counts, bit-4 single-link encoding, hard links,
and directory link counts without conflating directory dot omission.
## Fixture
Use `images/compact.erofs` and `images/compact-nlink1.erofs`. Evidence asserts
explicit `single.txt i_nb=1`, patched bit 4 plus `i_nb=0x1234`, identical
hard-link NID with `i_nb=2`, and explicit directory nlink.
## Procedure
Mount each image separately and record:
```sh
stat -f '%N ino=%i nlink=%l mode=%p' \
"$mnt/single.txt" "$mnt/hard-a.txt" "$mnt/hard-b.txt" "$mnt/dotdir"
cmp /tmp/repo22-g1/source/compact/single.txt "$mnt/single.txt"
cmp /tmp/repo22-g1/source/compact/hard-a.txt "$mnt/hard-a.txt"
cmp "$mnt/hard-a.txt" "$mnt/hard-b.txt"
```
Unmount and detach before attaching the second image.
## Expected Results
- Baseline and patched `single.txt` both report nlink 1 for different valid
encodings.
- `hard-a.txt` and `hard-b.txt` share one inode and report nlink 2.
- `dotdir` uses its explicit directory link count; all data compares pass.