Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZTS: Exit status 256+signum is actually baked in to ksh #10137

Merged
merged 1 commit into from
Mar 17, 2020

Conversation

ghost
Copy link

@ghost ghost commented Mar 16, 2020

Motivation and Context

While #10121 did fix the signal numbers for FreeBSD/Darwin, it
incorrectly changed the expected encoding of exit status for commands
that exited on a signal. The encoding 256+signum is a feature of the
shell. Only the signal numbers themselves are platform-dependent.

Description

Always use the encoding 256+signum when checking exit status for
signal exits.

How Has This Been Tested?

ZTS on FreeBSD

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes.
  • I have run the ZFS Test Suite with this change applied.
  • All commit messages are properly formatted and contain Signed-off-by.

While openzfs#10121 did fix the signal numbers for FreeBSD/Darwin, it
incorrectly changed the expected encoding of exit status for commands
that exited on a signal.  The encoding 256+signum is a feature of the
shell.  Only the signal numbers themselves are platform-dependent.

Always use the encoding 256+signum when checking exit status for
signal exits.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
@ghost ghost added Component: Test Suite Indicates an issue with the test framework or a test case Status: Code Review Needed Ready for review and testing labels Mar 16, 2020
@ghost ghost changed the title Exit status 256+signum is actually baked in to ksh ZTS: Exit status 256+signum is actually baked in to ksh Mar 16, 2020
@codecov-io
Copy link

codecov-io commented Mar 17, 2020

Codecov Report

Merging #10137 into master will decrease coverage by <1%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #10137    +/-   ##
========================================
- Coverage      79%      79%   -<1%     
========================================
  Files         385      385            
  Lines      122385   122385            
========================================
- Hits        97224    96764   -460     
- Misses      25161    25621   +460
Flag Coverage Δ
#kernel 80% <ø> (ø) ⬇️
#user 66% <ø> (-1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c94fb10...324bfc4. Read the comment docs.

@behlendorf behlendorf merged commit e0d3284 into openzfs:master Mar 17, 2020
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Mar 17, 2020
@ghost ghost deleted the zts-signal-status branch March 17, 2020 16:59
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
While openzfs#10121 did fix the signal numbers for FreeBSD/Darwin, it
incorrectly changed the expected encoding of exit status for commands
that exited on a signal.  The encoding 256+signum is a feature of the
shell.  Only the signal numbers themselves are platform-dependent.

Always use the encoding 256+signum when checking exit status for
signal exits.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#10137
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Test Suite Indicates an issue with the test framework or a test case Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants