From owner-svn-src-head@freebsd.org Tue May 16 18:42:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 731A9D70C16; Tue, 16 May 2017 18:42:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A2A014C0; Tue, 16 May 2017 18:42:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4GIgjxL071100; Tue, 16 May 2017 18:42:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GIgj6J071098; Tue, 16 May 2017 18:42:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201705161842.v4GIgj6J071098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 May 2017 18:42:45 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 May 2017 18:42:46 -0000 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 +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -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 __RCSID("$NetBSD: t_wait.c,v 1.8 2017/01/13 19:28:55 christos Exp $"); +#ifdef __FreeBSD__ +#include +#include +#endif #include #include @@ -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);