anjiahao1 opened a new pull request, #4144:
URL: https://github.com/apache/nuttx-apps/pull/4144
## Summary
Add cmocka tests for the wzipfs streaming write-only VFS:
- test_file_target: mount an empty regular file, write a text entry, a
directory and a binary entry; after umount, verify the archive with
libarchive.
- test_pipe_target: stream entries through a FIFO to a reader thread
and verify the captured archive.
- test_fd_target: mount on an existing pipe descriptor and verify the
post-umount close ordering.
- test_method_mount_option: exercise the method=store|deflate mount
option when CONFIG_FS_ZIPFS_WRITE_DEFLATE is enabled.
The tests are opt-in via CONFIG_TESTING_WZIPFS and depend on
CONFIG_FS_ZIPFS_WRITE and CONFIG_TESTING_CMOCKA. The pipe and fd cases
skip themselves when the configuration has no FIFO/pipe support.
## Impact
* Is new feature added? NO - tests only.
* Impact on user: NO
* Impact on build: NO - an opt-in test application.
* Impact on hardware: NO
* Impact on documentation: NO
* Impact on security: NO
* Impact on compatibility: NO
## Testing
Build host: Linux x86_64, NuttX CI Docker image.
Configuration: sim:zipfs with
CONFIG_FS_ZIPFS_WRITE=y, CONFIG_TESTING_CMOCKA=y,
CONFIG_TESTING_WZIPFS=y and CONFIG_PIPES=y.
```
make -j10
```
Run on the sim:
```
nsh> cmocka_wzipfs
[==========] wzipfs: Running 3 test(s).
[ RUN ] test_file_target
[ OK ] test_file_target
[ RUN ] test_pipe_target
[ OK ] test_pipe_target
[ RUN ] test_fd_target
[ OK ] test_fd_target
[ PASSED ] 3 test(s).
```
The deflate variant is exercised when CONFIG_FS_ZIPFS_WRITE_DEFLATE is
enabled.
## PR verification
* [x] This PR introduces only one functional change.
* [x] I have updated all required description fields above.
* [x] My PR adheres to Contributing Guidelines and Documentation.
* [ ] My PR is still work in progress (not ready for review).
* [x] My PR is ready for review and can be safely merged into a codebase.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]