# Re: \[PATCH v2 10/58\] objtool: Keep failing test workdirs by default

- From: Song Liu \<song@kernel.org\>
- Date: 2026-09-14 18:25:23 
- List: live-patching
- Page: https://ratatoskr.run/live-patching/2026/09/17575105
- Thread: https://ratatoskr.run/sashiko-reviews/2026/09/17575105/t.md

```text
On Sun, Sep 13, 2026 at 11:37 PM [ref] wrote:
>
> 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 [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.
>
> > 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
> [ ... ]
> > @@ -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.

I think this is OK. We still print out "not ok" and "fail: <none zero>".

Thanks,
Song
```
