cetrafs
How-to guideTask-oriented

Run the test suites

Run the loop-device suite, the crash rig, the soak and the release matrix, and the multi-node ctest suite on a real shared LUN.

Which suite tests what

CommandNeedsCovers
make check-fsckNothing (no module, no mount)Image-level fsck checks, with every check fed a real injected fault. Runs in seconds.
make checkroot, matching kernel headers, loop devicesThe full loop-backed integration suite: every feature end to end, plus simulated cross-node scenarios. Never touches a real device.
make check-one SUITE=kernel/<name>.shSame as checkOne suite, e.g. kernel/nslock.sh.
make check-slowSame, plus timeMulti-GiB sparse-file tests (default 10 GiB; override with CETRAFS_SPARSE_TEST_SIZE_MB).
make check-crashdm-log-writes, dm-flakeyThe crash-consistency rig: replays to every durability boundary, a power-loss sweep, and power cuts without a flush first.
make soak ROUNDS=NModule loadedMixed-workload soak with a full fsck after each round. Fails on any anomalous round and keeps the image. Default 20 rounds; a release soak is 200 or more.
make release-matrixAll of the aboveBuild, check, crash rig, sparse, fuzzers and soak, in sequence, each with its own log and a recorded summary. ARGS="-r 3" repeats it; -R resumes with the previously failed stages first.
make check-caw DEV=/dev/sdXA real CAW-capable device. Destroys its contents.The compare-and-write paths a loop device can’t reach.
ctest (multi-node)Two or more hosts sharing one formatted LUNReal cross-node behaviour. See below.
Loop devices can't prove everything

A loop device has no atomic COMPARE AND WRITE, and it serves “uncached” reads from the host’s page cache. So make check proves correctness on one node, but it can’t exercise real cross-node atomicity or measure performance. The multi-node suite and real hardware cover those.

The destructive suites (tests/device/, tests/crash/, ctest/) always take the device as an explicit argument. They never pick one by default.

The multi-node suite (ctest)

ctest drives several real hosts against one shared LUN. A “node” is a separate kernel with its own machine UUID, so it can’t be simulated with processes on one host.

Build it (it is a standalone Go program):

make ctest          # or: cd ctest && go build -o ctest .

The LUN must already be formatted with mkfs.cetra. On each host, start a worker. The worker owns the device and the mount point:

./ctest -mode=slave -addr=:9100 -device=/dev/sdX -mountpoint=/mnt/ctest

From any machine, run a scenario, or the full suite:

./ctest -mode=master -slaves=nodeA=10.0.0.1:9100,nodeB=10.0.0.2:9100 -scenario=full-suite

Scenarios include caw (the real primitive, asserted to have been contended), lock-race, replay-race, fence-reclaim, record-write-race, dirent-torn, extent-leaf-staleness, inode-reuse, pending-free and dir-storm. -repeat N turns any scenario into a soak and stops at the first failure.

The coordinator checks that every node runs the same cetrafs.ko build and refuses to run otherwise, and it unmounts every node when it exits.

Last updated