Files
erofs-freebsd-out-tree/tests/TC093-chunk-single-device.md
T
2026-08-18 09:20:44 +02:00

1.7 KiB

Test Case: Indexed Chunk Data on the Primary Device

Test ID: TC093-chunk-single-device
Category: Chunk-Based
Priority: High

Objective

Verify 8-byte chunk indexes whose device ID is zero without a device table. This is not a 4-byte block-map substitute.

Fixture

Use single-indexed.erofs from the fresh G6 generator. It is derived from the mkfs blob baseline by asserting each original (high=0, device=1, pblk), folding the new blob bytes behind the metadata block, changing every index to device=0, adding one to each pblk, and removing the device-table feature. verify must report extra_devices=0 and entry_size=8.

Manual procedure

I=/root/repo22-g6/images
S=/root/repo22-g6/sources/chunk
mkdir -p /mnt/g6
kldload /root/repo22-g6/erofs.ko
mdconfig -a -t vnode -f "$I/single-indexed.erofs" -u 90
mount -t erofs -o ro /dev/md90 /mnt/g6
sha256 "$S/indexed.bin" /mnt/g6/indexed.bin
cmp "$S/indexed.bin" /mnt/g6/indexed.bin
dd if="$S/indexed.bin" of=/tmp/tc093.expected bs=1 skip=28672 count=8192 2>/dev/null
dd if=/mnt/g6/indexed.bin of=/tmp/tc093.actual bs=1 skip=28672 count=8192 2>/dev/null
cmp /tmp/tc093.expected /tmp/tc093.actual

Expected results

  • Mount succeeds without any device.N option.
  • Full-file and cross-32768-byte-chunk comparisons pass.
  • No external GEOM provider or device-table lookup is attempted.

Cleanup and zero-state check

umount /mnt/g6
mdconfig -d -u 90
kldunload erofs
rm -f /tmp/tc093.expected /tmp/tc093.actual
mount -p | awk '$3 == "erofs" { print }'
mdconfig -l
kldstat -n erofs 2>/dev/null || true
sysctl -n kern.geom.conftxt | grep -E 'md90|erofs' || true

All four final outputs must be empty.