From: Bob Ham Date: Thu, 10 Apr 2025 12:24:22 +0000 (+0000) Subject: test/ceph_assert.cc: Disable core files X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F62765%2Fhead;p=ceph.git test/ceph_assert.cc: Disable core files Without this, core files are produced which subsequently cause failures in other tests, specifically smoke.sh and safe-to-destroy.sh. Fixes: bfa83df6d33ee2238f1389ca4518592b5c4fb267 Signed-off-by: Bob Ham test/ceph_assert.cc: Update line numbers Signed-off-by: Bob Ham --- diff --git a/src/test/ceph_assert.cc b/src/test/ceph_assert.cc index 8caf2b88b69..ffda5012308 100644 --- a/src/test/ceph_assert.cc +++ b/src/test/ceph_assert.cc @@ -1,6 +1,8 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*- // vim: ts=8 sw=2 sts=2 expandtab +#include +#include #include #include "common/ceph_argparse.h" @@ -12,27 +14,30 @@ #include "gtest/gtest.h" -static void non_supressed_assert_line16() { - ceph_assert(42 == 41); // LINE16 +static void non_supressed_assert_line18() { + ceph_assert(42 == 41); // LINE18 } -static void supressed_assert_line19() { - ceph_assert(42 == 40); // LINE19 +static void supressed_assert_line21() { + ceph_assert(42 == 40); // LINE21 } -static void supressed_assertf_line22() { - ceph_assertf(42 == 39, "FAILED ceph_assertf"); // LINE22 +static void supressed_assertf_line24() { + ceph_assertf(42 == 39, "FAILED ceph_assertf"); // LINE24 } -static void non_supressed_assertf_line25() { - ceph_assertf(42 == 38, "FAILED ceph_assertf"); // LINE25 +static void non_supressed_assertf_line27() { + ceph_assertf(42 == 38, "FAILED ceph_assertf"); // LINE27 } TEST(CephAssertDeathTest, ceph_assert_supresssions) { - ASSERT_DEATH(non_supressed_assert_line16(), "FAILED ceph_assert"); - supressed_assert_line19(); - supressed_assertf_line22(); - ASSERT_DEATH(non_supressed_assertf_line25(), "FAILED ceph_assertf"); + ASSERT_DEATH(non_supressed_assert_line18(), "FAILED ceph_assert"); + supressed_assert_line21(); + supressed_assertf_line24(); + ASSERT_DEATH(non_supressed_assertf_line27(), "FAILED ceph_assertf"); } int main(int argc, char **argv) { + // Disable core files + const struct rlimit rlim = { 0, 0 }; + setrlimit(RLIMIT_CORE, &rlim); auto args = argv_to_vec(argc, argv); auto cct = global_init( @@ -44,7 +49,7 @@ int main(int argc, char **argv) { g_ceph_context->_conf.set_val( "ceph_assert_supresssions", fmt::format( - "{}:{}, {}:{}", __FILE__, /* LINE19 */19, __FILE__, /* LINE22 */22)); + "{}:{}, {}:{}", __FILE__, /* LINE21 */21, __FILE__, /* LINE24 */24)); common_init_finish(g_ceph_context); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS();