Files
erofs-freebsd-out-tree/tests/G3-MANUAL-SETUP.md
T
2026-08-13 10:44:59 +02:00

2.4 KiB

G3 Manual Test Setup

This setup supports only TC041-TC066, TC141, TC148, TC149, TC152, and TC153. It prepares fixtures and native probes; it does not run tests or assign results.

Host Preparation

From the repo22 root, use an absent output directory:

git rev-parse HEAD
tests/prepare_g3_fixtures.sh /work/build/repo22-g3
(cd /work/build/repo22-g3/vfs && sha256sum -c IMAGE-SHA256SUMS)
(cd /work/build/repo22-g3/vfs/source &&
  sha256sum -c ../SOURCE-SHA256SUMS)
(cd /work/build/repo22-g3/metadata && sha256sum -c SHA256SUMS)
(cd /work/build/repo22-g3/final && sha256sum -c SHA256SUMS)

Record fixture-evidence.txt, all checksum manifests, the erofs-utils version, the exact source commit, and the KLD SHA256. Transfer the fixtures, sources, and only these native probes to the FreeBSD 15 guest:

readdir_probe.c g3_vfs_probe.c stat_special.c nfs_fh_tool.c
mmap_fault.c sparse_hole_probe.c

Guest Preparation

Build the KLD natively from an archive exported from the recorded commit. Build probes directly; no runner or result wrapper is permitted:

cc -O2 -Wall -Wextra -Werror -std=c17 readdir_probe.c -o readdir_probe
cc -O2 -Wall -Wextra -Werror -std=c17 g3_vfs_probe.c -o g3_vfs_probe
cc -O2 -Wall -Wextra -Werror -std=c17 stat_special.c -o stat_special
cc -O2 -Wall -Wextra -Werror -std=c17 nfs_fh_tool.c -o nfs_fh_tool
cc -O2 -Wall -Wextra -Werror -std=c17 mmap_fault.c -o mmap_fault
cc -O2 -Wall -Wextra -Werror -std=c17 sparse_hole_probe.c \
  -o sparse_hole_probe

Before the first test, require no EROFS mount, no md provider, and no stale EROFS KLD. Load only the exact KLD under test. For each test, attach a fresh dynamic vnode md, mount read-only, execute that numbered Markdown procedure, then unmount and detach before continuing.

The report records the literal command, exit status or syscall errno, relevant fixture/data/KLD hashes, dmesg delta, and cleanup state for every test.

Common Mount Pattern

mkdir -p /tmp/repo22-g3/mnt
unit=$(mdconfig -a -t vnode -f IMAGE)
mount -t erofs -o ro "/dev/$unit" /tmp/repo22-g3/mnt
# Execute exactly one numbered test.
umount /tmp/repo22-g3/mnt
mdconfig -d -u "$unit"

TC153 additionally creates and removes its documented multi-terabyte sparse provider. Final cleanup requires zero EROFS mounts, zero md providers, the test KLD unloaded, and all guest-generated sparse files removed.