Date: Tue, 16 May 2017 18:42:45 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318363 - in head/contrib: atf/atf-c/detail netbsd-tests/lib/libc/sys Message-ID: <201705161842.v4GIgj6J071098@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Tue May 16 18:42:44 2017 New Revision: 318363 URL: https://svnweb.freebsd.org/changeset/base/318363 Log: Skip tests depending on coredumps if coredumps are disabled via kern.coredump. The kern.coredump sysctl can be set to 0 to disable coredumps. Skip the 'status_coredump' and 'wait6_coredumped' tests if this sysctl is set to 0 rather than reporting a failure. Submitted by: brooks Reviewed by: ngie Obtained from: CheriBSD Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10665 Modified: head/contrib/atf/atf-c/detail/process_test.c head/contrib/netbsd-tests/lib/libc/sys/t_wait.c Modified: head/contrib/atf/atf-c/detail/process_test.c ============================================================================== --- head/contrib/atf/atf-c/detail/process_test.c Tue May 16 18:42:07 2017 (r318362) +++ head/contrib/atf/atf-c/detail/process_test.c Tue May 16 18:42:44 2017 (r318363) @@ -26,6 +26,9 @@ #include "atf-c/detail/process.h" #include <sys/types.h> +#ifdef __FreeBSD__ +#include <sys/sysctl.h> +#endif #include <sys/time.h> #include <sys/resource.h> #include <sys/wait.h> @@ -667,6 +670,14 @@ ATF_TC_BODY(status_coredump, tc) atf_tc_skip("Cannot unlimit the core file size; check limits " "manually"); +#ifdef __FreeBSD__ + int coredump_enabled; + size_t ce_len = sizeof(coredump_enabled); + if (sysctlbyname("kern.coredump", &coredump_enabled, &ce_len, NULL, + 0) == 0 && !coredump_enabled) + atf_tc_skip("Coredumps disabled"); +#endif + const int rawstatus = fork_and_wait_child(child_sigquit); atf_process_status_t s; RE(atf_process_status_init(&s, rawstatus)); Modified: head/contrib/netbsd-tests/lib/libc/sys/t_wait.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_wait.c Tue May 16 18:42:07 2017 (r318362) +++ head/contrib/netbsd-tests/lib/libc/sys/t_wait.c Tue May 16 18:42:44 2017 (r318363) @@ -31,6 +31,10 @@ #include <sys/cdefs.h> __RCSID("$NetBSD: t_wait.c,v 1.8 2017/01/13 19:28:55 christos Exp $"); +#ifdef __FreeBSD__ +#include <sys/types.h> +#include <sys/sysctl.h> +#endif #include <sys/wait.h> #include <sys/resource.h> @@ -147,6 +151,14 @@ ATF_TC_BODY(wait6_coredumped, tc) pid_t pid; static const struct rlimit rl = { RLIM_INFINITY, RLIM_INFINITY }; +#ifdef __FreeBSD__ + int coredump_enabled; + size_t ce_len = sizeof(coredump_enabled); + if (sysctlbyname("kern.coredump", &coredump_enabled, &ce_len, NULL, + 0) == 0 && !coredump_enabled) + atf_tc_skip("Coredumps disabled"); +#endif + switch (pid = fork()) { case 0: ATF_REQUIRE(setrlimit(RLIMIT_CORE, &rl) == 0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705161842.v4GIgj6J071098>