From 99ea7fdb02aa859b32558cefb18b377008d90041 Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Wed, 28 Nov 2018 22:17:53 +0100 Subject: [PATCH] test: suppress core dumping in there tests as well On FreeBSD coredumps are enabled by default. And thus tests in teardown() in ceph-helpers.sh can fail because of unwaranted cores. Signed-off-by: Willem Jan Withagen --- src/test/common/test_lockdep.cc | 3 +++ src/test/common/test_mutex.cc | 1 + 2 files changed, 4 insertions(+) diff --git a/src/test/common/test_lockdep.cc b/src/test/common/test_lockdep.cc index cbbe081426a8..993fa4423c24 100644 --- a/src/test/common/test_lockdep.cc +++ b/src/test/common/test_lockdep.cc @@ -8,6 +8,7 @@ #include "global/global_context.h" #include "global/global_init.h" #include "common/lockdep.h" +#include "include/coredumpctl.h" TEST(lockdep, abba) { @@ -24,6 +25,7 @@ TEST(lockdep, abba) b.unlock(); b.lock(); + PrCtl unset_dumpable; EXPECT_DEATH(a.lock(), ""); b.unlock(); } @@ -34,6 +36,7 @@ TEST(lockdep, recursive) ceph::mutex a(ceph::make_mutex("a")); a.lock(); + PrCtl unset_dumpable; EXPECT_DEATH(a.lock(), ""); a.unlock(); diff --git a/src/test/common/test_mutex.cc b/src/test/common/test_mutex.cc index ed987e0d9ae0..95a9a6213028 100644 --- a/src/test/common/test_mutex.cc +++ b/src/test/common/test_mutex.cc @@ -32,6 +32,7 @@ TEST(Mutex, NormalAsserts) { Mutex* m = new Mutex("Normal",false); m->Lock(); testing::GTEST_FLAG(death_test_style) = "threadsafe"; + PrCtl unset_dumpable; EXPECT_DEATH(m->Lock(), ".*"); } -- 2.47.3