summaryrefslogtreecommitdiff
path: root/contrib/atf
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2017-05-16 18:42:44 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2017-05-16 18:42:44 +0000
commit6dfb9460caf3466b23b2a24c7ac91ebbb0747226 (patch)
tree8341cbeb5b62a925fae016832d5d104fc88815b6 /contrib/atf
parent047e65ec2dfd35c9d9f3e8433de2eea7ae4790d8 (diff)
downloadsrc-test-6dfb9460caf3466b23b2a24c7ac91ebbb0747226.tar.gz
src-test-6dfb9460caf3466b23b2a24c7ac91ebbb0747226.zip
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
Notes
Notes: svn path=/head/; revision=318363
Diffstat (limited to 'contrib/atf')
-rw-r--r--contrib/atf/atf-c/detail/process_test.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/atf/atf-c/detail/process_test.c b/contrib/atf/atf-c/detail/process_test.c
index 5ae5565b6a2b7..82a911df68cda 100644
--- a/contrib/atf/atf-c/detail/process_test.c
+++ b/contrib/atf/atf-c/detail/process_test.c
@@ -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));