diff options
author | ngie <ngie@FreeBSD.org> | 2017-08-19 01:49:09 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-08-19 01:49:09 +0000 |
commit | 5b00fda4a20a4162e3b48856b4ac6b409d6f0b54 (patch) | |
tree | 34276e1d63f82672c85a6590dbf34c5584103979 | |
parent | 71a9d246c9d123df2f8a0918a1e0326b20f78afe (diff) | |
download | FreeBSD-src-5b00fda4a20a4162e3b48856b4ac6b409d6f0b54.zip FreeBSD-src-5b00fda4a20a4162e3b48856b4ac6b409d6f0b54.tar.gz |
MFC r321959:
Annotate tests that require root privileges appropriately
This unbreaks running the tests with unprivileged users.
-rw-r--r-- | tests/sys/kern/ptrace_test.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index 06ca3a7..c875ad8 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -1867,7 +1867,12 @@ mask_usr1_thread(void *arg) * Verify that the SIGKILL from PT_KILL takes priority over other signals * and prevents spurious stops due to those other signals. */ -ATF_TC_WITHOUT_HEAD(ptrace__PT_KILL_competing_signal); +ATF_TC(ptrace__PT_KILL_competing_signal); +ATF_TC_HEAD(ptrace__PT_KILL_competing_signal, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__PT_KILL_competing_signal, tc) { pid_t fpid, wpid; @@ -1961,7 +1966,12 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_signal, tc) * Verify that the SIGKILL from PT_KILL takes priority over other stop events * and prevents spurious stops caused by those events. */ -ATF_TC_WITHOUT_HEAD(ptrace__PT_KILL_competing_stop); +ATF_TC(ptrace__PT_KILL_competing_stop); +ATF_TC_HEAD(ptrace__PT_KILL_competing_stop, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc) { pid_t fpid, wpid; @@ -2939,13 +2949,24 @@ terminate_with_pending_sigstop(bool sigstop_from_main_thread) * to the older thread (the second test). This behavior has changed in the * past, so make no assumption. */ -ATF_TC_WITHOUT_HEAD(ptrace__parent_terminate_with_pending_sigstop1); +ATF_TC(ptrace__parent_terminate_with_pending_sigstop1); +ATF_TC_HEAD(ptrace__parent_terminate_with_pending_sigstop1, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__parent_terminate_with_pending_sigstop1, tc) { terminate_with_pending_sigstop(true); } -ATF_TC_WITHOUT_HEAD(ptrace__parent_terminate_with_pending_sigstop2); + +ATF_TC(ptrace__parent_terminate_with_pending_sigstop2); +ATF_TC_HEAD(ptrace__parent_terminate_with_pending_sigstop2, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__parent_terminate_with_pending_sigstop2, tc) { |