nuttx-apps/testing/fs
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
..
epoll include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
fatutf8 apps/testing:move epoll, fatutf8 ... folders to the new fs folder 2025-01-22 01:34:00 +08:00
fdsantest apps/testing:move epoll, fatutf8 ... folders to the new fs folder 2025-01-22 01:34:00 +08:00
fstest !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support 2026-05-11 17:38:32 +08:00
memfd testing/fs: add testcase to test the stability of memfd. 2026-01-22 19:53:39 +08:00
mtd_config_fs include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
nxffs include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
smart include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
smart_test apps: Fix additional open() arguments. 2026-05-22 13:39:04 +08:00
xipfs testing/fs/xipfs: Add a test suite for the xipfs file system. 2026-07-28 16:47:49 +08:00
.gitignore apps/testing:move epoll, fatutf8 ... folders to the new fs folder 2025-01-22 01:34:00 +08:00
CMakeLists.txt apps/testing:move epoll, fatutf8 ... folders to the new fs folder 2025-01-22 01:34:00 +08:00
Make.defs apps/testing:move epoll, fatutf8 ... folders to the new fs folder 2025-01-22 01:34:00 +08:00
Makefile apps/testing:move epoll, fatutf8 ... folders to the new fs folder 2025-01-22 01:34:00 +08:00