Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libc/sys Drop signal5 test-case from ATF t_ptrace_...
details: https://anonhg.NetBSD.org/src/rev/f5fc01662408
branches: trunk
changeset: 449136:f5fc01662408
user: kamil <kamil%NetBSD.org@localhost>
date: Sat Feb 23 20:52:42 2019 +0000
description:
Drop signal5 test-case from ATF t_ptrace_wait*
This test is now duplicated with traceme_signalmasked_exec.
diffstat:
tests/lib/libc/sys/t_ptrace_wait.c | 84 +-------------------------------------
1 files changed, 2 insertions(+), 82 deletions(-)
diffs (112 lines):
diff -r e47d05cac263 -r f5fc01662408 tests/lib/libc/sys/t_ptrace_wait.c
--- a/tests/lib/libc/sys/t_ptrace_wait.c Sat Feb 23 20:46:27 2019 +0000
+++ b/tests/lib/libc/sys/t_ptrace_wait.c Sat Feb 23 20:52:42 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ptrace_wait.c,v 1.97 2019/02/23 20:46:27 kamil Exp $ */
+/* $NetBSD: t_ptrace_wait.c,v 1.98 2019/02/23 20:52:42 kamil Exp $ */
/*-
* Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.97 2019/02/23 20:46:27 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.98 2019/02/23 20:52:42 kamil Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -5026,85 +5026,6 @@
/// ----------------------------------------------------------------------------
-ATF_TC(signal5);
-ATF_TC_HEAD(signal5, tc)
-{
- atf_tc_set_md_var(tc, "descr",
- "Verify that masking SIGTRAP in tracee does not stop tracer from "
- "catching exec() breakpoint");
-}
-
-ATF_TC_BODY(signal5, tc)
-{
- const int sigval = SIGSTOP;
- const int sigmasked = SIGTRAP;
- pid_t child, wpid;
-#if defined(TWAIT_HAVE_STATUS)
- int status;
-#endif
- struct ptrace_siginfo info;
- sigset_t intmask;
-
- memset(&info, 0, sizeof(info));
-
- DPRINTF("Before forking process PID=%d\n", getpid());
- SYSCALL_REQUIRE((child = fork()) != -1);
- if (child == 0) {
- DPRINTF("Before calling PT_TRACE_ME from child %d\n", getpid());
- FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
-
- sigemptyset(&intmask);
- sigaddset(&intmask, sigmasked);
- sigprocmask(SIG_BLOCK, &intmask, NULL);
-
- DPRINTF("Before raising %s from child\n", strsignal(sigval));
- FORKEE_ASSERT(raise(sigval) == 0);
-
- DPRINTF("Before calling execve(2) from child\n");
- execlp("/bin/echo", "/bin/echo", NULL);
-
- /* NOTREACHED */
- FORKEE_ASSERTX(0 && "Not reached");
- }
- DPRINTF("Parent process PID=%d, child's PID=%d\n", getpid(), child);
-
- DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
- TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
-
- validate_status_stopped(status, sigval);
-
- DPRINTF("Before resuming the child process where it left off and "
- "without signal to be sent\n");
- SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
-
- DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
- TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
-
- validate_status_stopped(status, sigmasked);
-
- DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
- SYSCALL_REQUIRE(
- ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
-
- DPRINTF("Signal traced to lwpid=%d\n", info.psi_lwpid);
- DPRINTF("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
- info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
- info.psi_siginfo.si_errno);
-
- ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, sigmasked);
- ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_EXEC);
-
- DPRINTF("Before resuming the child process where it left off and "
- "without signal to be sent\n");
- SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
-
- DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
- TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
-
- DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
- TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
-}
-
#if defined(TWAIT_HAVE_PID)
ATF_TC(signal6);
ATF_TC_HEAD(signal6, tc)
@@ -6518,7 +6439,6 @@
ATF_TP_ADD_TC(tp, signal_mask_unrelated);
- ATF_TP_ADD_TC(tp, signal5);
ATF_TP_ADD_TC_HAVE_PID(tp, signal6);
ATF_TP_ADD_TC_HAVE_PID(tp, signal7);
ATF_TP_ADD_TC(tp, signal8);
Home |
Main Index |
Thread Index |
Old Index