nightt5879 opened a new pull request, #3499:
URL: https://github.com/apache/nuttx-apps/pull/3499
## Summary
Fixes #3205.
This PR makes `sdstress` recover from temporary directories left behind by
an interrupted or failed previous run.
Commit structure:
- Commit 1 (`testing/sd_stress: Handle stale temporary directories`) is the
strict #3205 fix. It cleans stale `/sd/stress` and `/sd/moved` work directories
before starting a new test, but only removes files matching the app-generated
`tmpNNN` pattern. Unexpected entries make the cleanup fail instead of deleting
user data. It also fixes `create_dir()` / `remove_dir()` to use their `path`
argument.
- Commit 2 (`testing/sd_stress: Harden file creation cleanup`) is a
logically separable extension. It closes the temp file descriptor on
`create_files()` failures after `open()`, and releases the read buffer on the
path-length failure branch.
The second commit is logically separable and I am happy to drop it if
maintainers consider it out of scope for #3205.
Out of scope:
- This does not change BCM2711 SDIO / EMMC driver behavior.
- This does not address the separate `-b 1024` / SD/MMC timeout behavior
discussed in apache/nuttx#17245.
- This does not recursively delete arbitrary directory contents; cleanup is
limited to `sdstress`-generated `tmpNNN` files.
## Impact
Users no longer need to manually remove stale `sdstress` temporary
directories before running the test again after an interrupted or failed run.
- New feature: NO
- User adaptation required: NO
- Build process change: NO
- Hardware/architecture/board change: NO
- Documentation update required: NO
- Security impact: NO intended security impact
- Compatibility impact: NO intended compatibility impact
## Testing
Host:
- Windows with WSL Ubuntu 24.04
- CPU: x86_64
- Compiler: GCC 13.3.0
Checks:
- `git diff --check upstream/master..HEAD`: pass
- `checkpatch.sh -c -u -m -g HEAD~2..HEAD`: pass
- `sim:nsh` build with `CONFIG_ALLOW_BSD_COMPONENTS=y` and
`CONFIG_TESTING_SD_STRESS=y`: pass
- confirmed `Register: sdstress`
- confirmed `CC: sd_stress_main.c`
- result: `SIM elf with dynamic libs archive in nuttx.tgz`
Note: `.config` printed an expected override warning because the temporary
test build appended `CONFIG_ALLOW_BSD_COMPONENTS=y` /
`CONFIG_TESTING_SD_STRESS=y` after configuring `sim:nsh`.
--
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]