aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2021-03-01 18:51:02 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2021-03-01 19:56:05 +0000
commit1032131464f1196ad674b30c14a9e611789a1061 (patch)
treed8190b2afafe1241b1df3a4e694a6a7f6ca04b07
parent96a9e50e63bfcbca7309c012c2c7a477c8826824 (diff)
downloadsrc-1032131464f1196ad674b30c14a9e611789a1061.tar.gz
src-1032131464f1196ad674b30c14a9e611789a1061.zip
Remove atf_tc_skip calls from ptrace_test
I've run these tests many times in a loop on multiple architectures and it works reliably for me, maybe it's time to retire these skips? This also adds an additional waitpid to one of the tests to avoid a potential race condition (suggested by markj@). PR: 239397, 244056, 239425, 240510, 220841, 243605 Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D28888
-rw-r--r--tests/sys/kern/ptrace_test.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c
index a5655008eaa1..c6183ed573fd 100644
--- a/tests/sys/kern/ptrace_test.c
+++ b/tests/sys/kern/ptrace_test.c
@@ -237,9 +237,6 @@ ATF_TC_BODY(ptrace__parent_wait_after_attach, tc)
int cpipe[2], status;
char c;
- if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
- atf_tc_skip("https://bugs.freebsd.org/244055");
-
REQUIRE_EQ(pipe(cpipe), 0);
ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
@@ -287,9 +284,6 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc)
int cpipe[2], dpipe[2], status;
char c;
- if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
- atf_tc_skip("https://bugs.freebsd.org/239399");
-
REQUIRE_EQ(pipe(cpipe), 0);
ATF_REQUIRE((child = fork()) != -1);
@@ -493,9 +487,6 @@ ATF_TC_BODY(ptrace__parent_exits_before_child, tc)
int cpipe1[2], cpipe2[2], gcpipe[2], status;
pid_t child, gchild;
- if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
- atf_tc_skip("https://bugs.freebsd.org/244056");
-
REQUIRE_EQ(pipe(cpipe1), 0);
REQUIRE_EQ(pipe(cpipe2), 0);
REQUIRE_EQ(pipe(gcpipe), 0);
@@ -834,9 +825,6 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelated_debugger, tc)
pid_t children[2], fpid, wpid;
int cpipe[2], status;
- if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
- atf_tc_skip("https://bugs.freebsd.org/239397");
-
REQUIRE_EQ(pipe(cpipe), 0);
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
@@ -905,9 +893,6 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelated_debugger, tc)
pid_t children[2], fpid, wpid;
int cpipe[2], status;
- if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
- atf_tc_skip("https://bugs.freebsd.org/239292");
-
REQUIRE_EQ(pipe(cpipe), 0);
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
@@ -971,9 +956,6 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrelated_debugger, tc)
pid_t children[2], fpid, wpid;
int cpipe[2], status;
- if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
- atf_tc_skip("https://bugs.freebsd.org/239425");
-
REQUIRE_EQ(pipe(cpipe), 0);
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
@@ -1036,9 +1018,6 @@ ATF_TC_BODY(ptrace__getppid, tc)
int cpipe[2], dpipe[2], status;
char c;
- if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
- atf_tc_skip("https://bugs.freebsd.org/240510");
-
REQUIRE_EQ(pipe(cpipe), 0);
ATF_REQUIRE((child = fork()) != -1);
@@ -2123,9 +2102,6 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc)
struct ptrace_lwpinfo pl;
struct sched_param sched_param;
- if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
- atf_tc_skip("https://bugs.freebsd.org/220841");
-
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
trace_me();
@@ -4219,9 +4195,6 @@ ATF_TC_BODY(ptrace__procdesc_reparent_wait_child, tc)
pid_t traced, debuger, wpid;
int pd, status;
- if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
- atf_tc_skip("https://bugs.freebsd.org/243605");
-
traced = pdfork(&pd, 0);
ATF_REQUIRE(traced >= 0);
if (traced == 0) {
@@ -4230,6 +4203,8 @@ ATF_TC_BODY(ptrace__procdesc_reparent_wait_child, tc)
}
ATF_REQUIRE(pd >= 0);
+ /* Wait until the child process has stopped before fork()ing again. */
+ REQUIRE_EQ(traced, waitpid(traced, &status, WSTOPPED));
debuger = fork();
ATF_REQUIRE(debuger >= 0);
if (debuger == 0) {