nuttx-apps/testing/fs/xipfs
Marco Casaroli 3a03552c6a testing/fs/xipfs: Add a test suite for the xipfs file system.
Twelve sections, selected by name on the command line because the power loss
sweeps run for minutes while everything else runs in seconds.

The routine part covers the VFS paths, the write-once rules (reopen for
write, append, seek during write, truncate of a written file are all refused)
and both mmap variants: that a plain mapping lands inside the media window
with no heap growth, that MAP_XIP_STRICT fails with ENXIO rather than
copying, and that N mappings of one file produce N pins on one extent.

The rest is aimed at the two properties that are easy to get wrong and quiet
when they are:

Pin release.  A pin taken by one task and a task that dies with a mapping
still live both have to end with the extent movable again -- the second
without the task ever calling munmap, since a module that faults never will.
Both are checked by asking the defragmenter to move the extent afterwards.

Power-loss atomicity.  With CONFIG_FS_XIPFS_FAULT_INJECT the suite fails the
Nth flash operation, remounts, and checks the volume is consistent and every
file that had been committed is byte-for-byte intact.  It sweeps N across
create, unlink and defragmentation, and repeats the sweep with the failing
write torn -- a partial program rather than a clean refusal -- which is what
a real power loss mid-program leaves behind.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-07-28 16:47:49 +08:00
..
CMakeLists.txt testing/fs/xipfs: Add a test suite for the xipfs file system. 2026-07-28 16:47:49 +08:00
Kconfig testing/fs/xipfs: Add a test suite for the xipfs file system. 2026-07-28 16:47:49 +08:00
Make.defs testing/fs/xipfs: Add a test suite for the xipfs file system. 2026-07-28 16:47:49 +08:00
Makefile testing/fs/xipfs: Add a test suite for the xipfs file system. 2026-07-28 16:47:49 +08:00
xipfs_main.c testing/fs/xipfs: Add a test suite for the xipfs file system. 2026-07-28 16:47:49 +08:00