Skip to content

Fail run_check and run_pipe on non-zero exit#28

Merged
jserv merged 1 commit into
sysprog21:mainfrom
Max042004:test-runner-rc-check
May 11, 2026
Merged

Fail run_check and run_pipe on non-zero exit#28
jserv merged 1 commit into
sysprog21:mainfrom
Max042004:test-runner-rc-check

Conversation

@Max042004
Copy link
Copy Markdown
Collaborator

@Max042004 Max042004 commented May 11, 2026

The shared test helpers captured the subprocess exit code into rc but never consulted it. A guest that printed the expected substring and then died on SIGBUS or SIGSEGV (rc 138 or 139) would still match the pattern via grep and report OK, hiding the crash.

Check rc first in both helpers: any non-zero exit is reported as FAIL with the exit code in the detail, before the pattern match runs. The remaining branches keep the original semantics for the clean-exit cases.

All current callers in test-busybox.sh and test-coreutils-smoke.sh expect rc 0 from the applet under test; non-zero-rc cases use the explicit run helper, which is unchanged.


Summary by cubic

Make run_check and run_pipe fail on any non-zero exit before pattern matching, so crashes don’t get reported as passing.

  • Bug Fixes
    • Check rc first; non-zero exits now report FAIL with rc and output excerpt.
    • Keep original behavior for clean exits; the explicit run helper is unchanged.

Written for commit aded850. Summary will update on new commits.

The shared test helpers captured the subprocess exit code into rc but
never consulted it. A guest that printed the expected substring and
then died on SIGBUS or SIGSEGV (rc 138 or 139) would still match the
pattern via grep and report OK, hiding the crash.

Check rc first in both helpers: any non-zero exit is reported as
FAIL with the exit code in the detail, before the pattern match
runs. The remaining branches keep the original semantics for the
clean-exit cases.

All current callers in test-busybox.sh and test-coreutils-smoke.sh
expect rc 0 from the applet under test; non-zero-rc cases use the
explicit run helper, which is unchanged.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@jserv jserv merged commit c7489db into sysprog21:main May 11, 2026
5 checks passed
@jserv
Copy link
Copy Markdown
Contributor

jserv commented May 11, 2026

Thank @Max042004 for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants