]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix the raise tests.
authorBryan Drewery <bdrewery@FreeBSD.org>
Fri, 15 Sep 2017 19:48:48 +0000 (19:48 +0000)
committerBryan Drewery <bdrewery@FreeBSD.org>
Fri, 15 Sep 2017 19:48:48 +0000 (19:48 +0000)
commitb3b6d7b40656aaa1fe859b0c97b9332c3b1f2ec7
treed39460029d4b0155234c0fba6c084f236593d22e
parent02c474b481af5efa9cc8104177669ebaec34e003
Fix the raise tests.

- The exit probe was not appropriately filtered to only the known pid so it
  was firing on any random process that would exit rather the only the one
  we cared about.
- The dtest script executes the tst.raise*.exe in the background from
  POSIX sh without jobs control.  POSIX mandates that SIGINT be set to
  SIG_IGN in this case.  The test executable never actually tested that
  SIGINT could be caught despite trying to block and delay the signal.
  So the SIGINT sent from raise() is never actually received since it
  is ignored.  This could be fixed by calling 'trap - INT' from dtest
  before running the executable but I've opted to just use SIGUSR1
  instead in these specific tests rather than adding more logic to
  test that SIGINT is not ignored at startup.

These 2 issues meant that the tests would randomly work but only if a process
coincidentally exited during the test.

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d