Page MenuHomeFreeBSD

system(3): Address test robustness issue
ClosedPublic

Authored by des on Sat, Mar 7, 6:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 24, 2:52 PM
Unknown Object (File)
Mon, Mar 23, 3:16 PM
Unknown Object (File)
Mon, Mar 23, 3:11 PM
Unknown Object (File)
Mon, Mar 23, 1:06 AM
Unknown Object (File)
Sun, Mar 22, 4:42 PM
Unknown Object (File)
Sun, Mar 22, 6:32 AM
Unknown Object (File)
Sun, Mar 22, 6:31 AM
Unknown Object (File)
Fri, Mar 20, 6:21 AM
Subscribers

Details

Summary

Don't assume that SIGINT and SIGQUIT are set to SIG_DFL at the start
of the test. Instead, retrieve their current dispositions and verify
that they are restored at the end of the test.

MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Sat, Mar 7, 6:17 PM
kevans added inline comments.
lib/libc/tests/stdlib/system_test.c
134

Two points:

1.) I think we want another set of tests, then, and be explicit about it: one that explicitly sets them to SIG_DFL and one that ignores them, so that we can be sure no matter the test runner's configuration that it's restoring rather than that the disposition upon return was accidentally right

2.) We should probably use sigaction() for recording existing disposition if we suspect atf might have setup a handler to avoid breaking it

Agreed out-of-band that it's fine to defer testing both behaviors for the time being

This revision is now accepted and ready to land.Mon, Mar 9, 8:36 PM
This revision now requires review to proceed.Mon, Mar 9, 8:37 PM
This revision was not accepted when it landed; it landed in state Needs Review.Mon, Mar 9, 8:41 PM
This revision was automatically updated to reflect the committed changes.