Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/kernel/arch/amd64 Stop using atf_utils_fork() in tests...
details: https://anonhg.NetBSD.org/src/rev/21d6bd881b2b
branches: trunk
changeset: 349341:21d6bd881b2b
user: kamil <kamil%NetBSD.org@localhost>
date: Wed Dec 07 22:24:44 2016 +0000
description:
Stop using atf_utils_fork() in tests/kernel/arch/amd64/t_ptrace_wait.c
Switch from:
child = atf_utils_fork();
to:
ATF_REQUIRE((child = fork()) != -1);
Prefer the latter as working as intended and not outputing to files with
danger to overwrite files' content after each fork in test-suite.
Discussed with Christos Zoulas.
Sponsored by <The NetBSD Foundation>
diffstat:
tests/kernel/arch/amd64/t_ptrace_wait.c | 38 ++++++++++++++++----------------
1 files changed, 19 insertions(+), 19 deletions(-)
diffs (171 lines):
diff -r ba3c8ff71d5e -r 21d6bd881b2b tests/kernel/arch/amd64/t_ptrace_wait.c
--- a/tests/kernel/arch/amd64/t_ptrace_wait.c Wed Dec 07 19:57:09 2016 +0000
+++ b/tests/kernel/arch/amd64/t_ptrace_wait.c Wed Dec 07 22:24:44 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ptrace_wait.c,v 1.4 2016/12/04 03:38:58 kamil Exp $ */
+/* $NetBSD: t_ptrace_wait.c,v 1.5 2016/12/07 22:24:44 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.4 2016/12/04 03:38:58 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.5 2016/12/07 22:24:44 kamil Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -105,7 +105,7 @@
size_t i;
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -173,7 +173,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -257,7 +257,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -341,7 +341,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -425,7 +425,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -510,7 +510,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -600,7 +600,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -690,7 +690,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -780,7 +780,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -870,7 +870,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -966,7 +966,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -1062,7 +1062,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -1158,7 +1158,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -1259,7 +1259,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -1370,7 +1370,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -1481,7 +1481,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
@@ -1592,7 +1592,7 @@
ATF_REQUIRE_EQ(__arraycount(r2.dbregs), len);
printf("Before forking process PID=%d\n", getpid());
- child = atf_utils_fork();
+ ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
Home |
Main Index |
Thread Index |
Old Index