Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Remove tests/kernel/t_ptrace* from the tree
details: https://anonhg.NetBSD.org/src/rev/8f7088bfe625
branches: trunk
changeset: 352476:8f7088bfe625
user: kamil <kamil%NetBSD.org@localhost>
date: Mon Apr 03 05:06:28 2017 +0000
description:
Remove tests/kernel/t_ptrace* from the tree
ptrace(2) tests have been moved to tests/lib/libc/sys
Sponsored by <The NetBSD Foundation>
diffstat:
distrib/sets/lists/debug/mi | 16 +-
distrib/sets/lists/tests/mi | 16 +-
tests/kernel/Makefile | 9 +-
tests/kernel/msg.h | 136 -
tests/kernel/t_ptrace.c | 208 -
tests/kernel/t_ptrace_amd64_wait.h | 114 -
tests/kernel/t_ptrace_i386_wait.h | 107 -
tests/kernel/t_ptrace_wait.c | 7590 ------------------------------------
tests/kernel/t_ptrace_wait.h | 431 --
tests/kernel/t_ptrace_wait3.c | 30 -
tests/kernel/t_ptrace_wait4.c | 30 -
tests/kernel/t_ptrace_wait6.c | 30 -
tests/kernel/t_ptrace_waitid.c | 30 -
tests/kernel/t_ptrace_waitpid.c | 30 -
tests/kernel/t_ptrace_x86_wait.h | 1983 ---------
15 files changed, 17 insertions(+), 10743 deletions(-)
diffs (truncated from 10850 to 300 lines):
diff -r 1a098b0ee654 -r 8f7088bfe625 distrib/sets/lists/debug/mi
--- a/distrib/sets/lists/debug/mi Mon Apr 03 04:33:32 2017 +0000
+++ b/distrib/sets/lists/debug/mi Mon Apr 03 05:06:28 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.203 2017/04/02 21:44:00 kamil Exp $
+# $NetBSD: mi,v 1.204 2017/04/03 05:06:28 kamil Exp $
./etc/mtree/set.debug comp-sys-root
./usr/lib comp-sys-usr compatdir
./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile
@@ -1716,13 +1716,13 @@
./usr/libdata/debug/usr/tests/kernel/t_poll3w.debug tests-obsolete obsolete,compattestfile
./usr/libdata/debug/usr/tests/kernel/t_pollts.debug tests-obsolete obsolete,compattestfile
./usr/libdata/debug/usr/tests/kernel/t_posix_fadvise.debug tests-obsolete obsolete,compattestfile
-./usr/libdata/debug/usr/tests/kernel/t_ptrace.debug tests-kernel-tests debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/kernel/t_ptrace_wait.debug tests-kernel-tests debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/kernel/t_ptrace_wait3.debug tests-kernel-tests debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/kernel/t_ptrace_wait4.debug tests-kernel-tests debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/kernel/t_ptrace_wait6.debug tests-kernel-tests debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/kernel/t_ptrace_waitid.debug tests-kernel-tests debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/kernel/t_ptrace_waitpid.debug tests-kernel-tests debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/kernel/t_ptrace.debug tests-obsolete obsolete,compattestfile
+./usr/libdata/debug/usr/tests/kernel/t_ptrace_wait.debug tests-obsolete obsolete,compattestfile
+./usr/libdata/debug/usr/tests/kernel/t_ptrace_wait3.debug tests-obsolete obsolete,compattestfile
+./usr/libdata/debug/usr/tests/kernel/t_ptrace_wait4.debug tests-obsolete obsolete,compattestfile
+./usr/libdata/debug/usr/tests/kernel/t_ptrace_wait6.debug tests-obsolete obsolete,compattestfile
+./usr/libdata/debug/usr/tests/kernel/t_ptrace_waitid.debug tests-obsolete obsolete,compattestfile
+./usr/libdata/debug/usr/tests/kernel/t_ptrace_waitpid.debug tests-obsolete obsolete,compattestfile
./usr/libdata/debug/usr/tests/kernel/t_pty.debug tests-kernel-tests debug,atf,compattestfile
./usr/libdata/debug/usr/tests/kernel/t_rnd.debug tests-kernel-tests debug,atf,rump
./usr/libdata/debug/usr/tests/kernel/t_sigaction.debug tests-obsolete obsolete,compattestfile
diff -r 1a098b0ee654 -r 8f7088bfe625 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Mon Apr 03 04:33:32 2017 +0000
+++ b/distrib/sets/lists/tests/mi Mon Apr 03 05:06:28 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.732 2017/04/02 21:44:00 kamil Exp $
+# $NetBSD: mi,v 1.733 2017/04/03 05:06:28 kamil Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -2160,13 +2160,13 @@
./usr/tests/kernel/t_posix_fadvise tests-obsolete obsolete
./usr/tests/kernel/t_posix_fallocate tests-obsolete obsolete
./usr/tests/kernel/t_ps_strings tests-kernel-tests compattestfile,atf
-./usr/tests/kernel/t_ptrace tests-kernel-tests compattestfile,atf
-./usr/tests/kernel/t_ptrace_wait tests-kernel-tests compattestfile,atf
-./usr/tests/kernel/t_ptrace_wait3 tests-kernel-tests compattestfile,atf
-./usr/tests/kernel/t_ptrace_wait4 tests-kernel-tests compattestfile,atf
-./usr/tests/kernel/t_ptrace_wait6 tests-kernel-tests compattestfile,atf
-./usr/tests/kernel/t_ptrace_waitid tests-kernel-tests compattestfile,atf
-./usr/tests/kernel/t_ptrace_waitpid tests-kernel-tests compattestfile,atf
+./usr/tests/kernel/t_ptrace tests-obsolete obsolete
+./usr/tests/kernel/t_ptrace_wait tests-obsolete obsolete
+./usr/tests/kernel/t_ptrace_wait3 tests-obsolete obsolete
+./usr/tests/kernel/t_ptrace_wait4 tests-obsolete obsolete
+./usr/tests/kernel/t_ptrace_wait6 tests-obsolete obsolete
+./usr/tests/kernel/t_ptrace_waitid tests-obsolete obsolete
+./usr/tests/kernel/t_ptrace_waitpid tests-obsolete obsolete
./usr/tests/kernel/t_pty tests-kernel-tests compattestfile,atf
./usr/tests/kernel/t_rnd tests-kernel-tests atf,rump
./usr/tests/kernel/t_sigaction tests-obsolete obsolete
diff -r 1a098b0ee654 -r 8f7088bfe625 tests/kernel/Makefile
--- a/tests/kernel/Makefile Mon Apr 03 04:33:32 2017 +0000
+++ b/tests/kernel/Makefile Mon Apr 03 05:06:28 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.45 2017/04/02 01:49:52 kamil Exp $
+# $NetBSD: Makefile,v 1.46 2017/04/03 05:06:28 kamil Exp $
NOMAN= # defined
@@ -9,13 +9,6 @@
TESTS_SUBDIRS+= kqueue
TESTS_C= t_lock
TESTS_C+= t_lockf
-TESTS_C+= t_ptrace
-TESTS_C+= t_ptrace_wait
-TESTS_C+= t_ptrace_wait3
-TESTS_C+= t_ptrace_wait4
-TESTS_C+= t_ptrace_wait6
-TESTS_C+= t_ptrace_waitid
-TESTS_C+= t_ptrace_waitpid
TESTS_C+= t_pty
TESTS_C+= t_mqueue
TESTS_C+= t_sysv
diff -r 1a098b0ee654 -r 8f7088bfe625 tests/kernel/msg.h
--- a/tests/kernel/msg.h Mon Apr 03 04:33:32 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/* $NetBSD: msg.h,v 1.1 2016/12/05 20:10:10 christos Exp $ */
-
-/*-
- * Copyright (c) 2016 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Christos Zoulas.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-struct msg_fds {
- int pfd[2];
- int cfd[2];
-};
-
-#define CLOSEFD(fd) do { \
- if (fd != -1) { \
- close(fd); \
- fd = -1; \
- } \
-} while (/*CONSTCOND*/ 0)
-
-static int
-msg_open(struct msg_fds *fds)
-{
- if (pipe(fds->pfd) == -1)
- return -1;
- if (pipe(fds->cfd) == -1) {
- close(fds->pfd[0]);
- close(fds->pfd[1]);
- return -1;
- }
- return 0;
-}
-
-static void
-msg_close(struct msg_fds *fds)
-{
- CLOSEFD(fds->pfd[0]);
- CLOSEFD(fds->pfd[1]);
- CLOSEFD(fds->cfd[0]);
- CLOSEFD(fds->cfd[1]);
-}
-
-static int
-msg_write_child(const char *info, struct msg_fds *fds, void *msg, size_t len)
-{
- ssize_t rv;
- CLOSEFD(fds->cfd[1]);
- CLOSEFD(fds->pfd[0]);
-
- printf("Send %s\n", info);
- rv = write(fds->pfd[1], msg, len);
- if (rv != (ssize_t)len)
- return 1;
-// printf("Wait %s\n", info);
- rv = read(fds->cfd[0], msg, len);
- if (rv != (ssize_t)len)
- return 1;
- return 0;
-}
-
-static int
-msg_write_parent(const char *info, struct msg_fds *fds, void *msg, size_t len)
-{
- ssize_t rv;
- CLOSEFD(fds->pfd[1]);
- CLOSEFD(fds->cfd[0]);
-
- printf("Send %s\n", info);
- rv = write(fds->cfd[1], msg, len);
- if (rv != (ssize_t)len)
- return 1;
-// printf("Wait %s\n", info);
- rv = read(fds->pfd[0], msg, len);
- if (rv != (ssize_t)len)
- return 1;
- return 0;
-}
-
-static int
-msg_read_parent(const char *info, struct msg_fds *fds, void *msg, size_t len)
-{
- ssize_t rv;
- CLOSEFD(fds->pfd[1]);
- CLOSEFD(fds->cfd[0]);
-
- printf("Wait %s\n", info);
- rv = read(fds->pfd[0], msg, len);
- if (rv != (ssize_t)len)
- return 1;
-// printf("Send %s\n", info);
- rv = write(fds->cfd[1], msg, len);
- if (rv != (ssize_t)len)
- return 1;
- return 0;
-}
-
-static int
-msg_read_child(const char *info, struct msg_fds *fds, void *msg, size_t len)
-{
- ssize_t rv;
- CLOSEFD(fds->cfd[1]);
- CLOSEFD(fds->pfd[0]);
-
- printf("Wait %s\n", info);
- rv = read(fds->cfd[0], msg, len);
- if (rv != (ssize_t)len)
- return 1;
-// printf("Send %s\n", info);
- rv = write(fds->pfd[1], msg, len);
- if (rv != (ssize_t)len)
- return 1;
- return 0;
-}
diff -r 1a098b0ee654 -r 8f7088bfe625 tests/kernel/t_ptrace.c
--- a/tests/kernel/t_ptrace.c Mon Apr 03 04:33:32 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,208 +0,0 @@
-/* $NetBSD: t_ptrace.c,v 1.20 2017/04/02 00:06:09 kamil Exp $ */
-
-/*-
- * Copyright (c) 2016 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace.c,v 1.20 2017/04/02 00:06:09 kamil Exp $");
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <sys/stat.h>
-#include <sys/sysctl.h>
-#include <err.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <atf-c.h>
-
-#include "h_macros.h"
-
-/*
- * A child process cannot call atf functions and expect them to magically
- * work like in the parent.
- * The printf(3) messaging from a child will not work out of the box as well
- * without estabilishing a communication protocol with its parent. To not
- * overcomplicate the tests - do not log from a child and use err(3)/errx(3)
- * wrapped with FORKEE_ASSERT()/FORKEE_ASSERTX() as that is guaranteed to work.
- */
-#define FORKEE_ASSERTX(x) \
-do { \
- int ret = (x); \
- if (!ret) \
- errx(EXIT_FAILURE, "%s:%d %s(): Assertion failed for: %s", \
- __FILE__, __LINE__, __func__, #x); \
-} while (0)
-
-#define FORKEE_ASSERT(x) \
-do { \
- int ret = (x); \
- if (!ret) \
- err(EXIT_FAILURE, "%s:%d %s(): Assertion failed for: %s", \
- __FILE__, __LINE__, __func__, #x); \
-} while (0)
-
-ATF_TC(attach_pid0);
-ATF_TC_HEAD(attach_pid0, tc)
-{
- atf_tc_set_md_var(tc, "descr",
- "Assert that a debugger cannot attach to PID 0");
Home |
Main Index |
Thread Index |
Old Index