Re: [PATCH v2 10/58] objtool: Keep failing test workdirs by default
From: sashiko-bot@kernel.org
Date: 2026-09-14 06:37:35
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Incorrect shell logic nesting hides failure hints and masks leaked artifacts in KEEP=none mode -- commit 3f45b4f5eca60d068a16adeda22b98b456f84450 Author: Joe Lawrence [off-list ref] objtool: Keep failing test workdirs by default Change the default test behavior to save failing test working directories instead of deleting them. Add a KEEP Makefile variable to optionally retain all or none of these directories.
quoted hunk ↗ jump to hunk
diff --git a/tools/objtool/tests/run-tests.sh b/tools/objtool/tests/run-tests.sh index e6f1ac1b5d0da..81dd33f1819b5 100755 --- a/tools/objtool/tests/run-tests.sh +++ b/tools/objtool/tests/run-tests.sh
[ ... ]
quoted hunk ↗ jump to hunk
@@ -167,15 +182,44 @@ done
[ ... ]
+none) + if ! rmdir "$rundir"/*/ "$rundir" 2>/dev/null; then + if [ "$fail" != 0 ] || [ "$xpass" != 0 ]; then
[Severity: Medium] Does nesting the failure hint inside the ! rmdir check in the KEEP=none case block prevent the hint from being printed when tests successfully clean up? If rmdir succeeds, meaning tests cleaned up properly, this entire block is skipped. Also, if a test leaks files (causing rmdir to fail) and tests also fail, won't this logic print the hint but skip the leak warning due to the elif statement? This would effectively mask the leaked artifacts when tools/objtool/tests/run-tests.sh is run with KEEP=none.
+ echo "# keep=none: artifacts were removed" \ + "(re-run with KEEP=failed or KEEP=all)" + elif [ -d "$rundir" ]; then + echo "# $rundir was not empty; a test did not clean up after itself" + fi + fi + ;; +esac
-- Sashiko AI review · https://sashiko.dev/#/patchset/20260914062514.926997-1-song@kernel.org?part=10