From 92555e23b208515c2c31c94014f57affcf93f8e4 Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Thu, 8 Feb 2024 14:03:41 -0800 Subject: [PATCH] testsuite: add valgrind suppressions Problem: valgrind test is an expected failure which means we won't know when new memory leaks appear. Add a suppression for the liblsd/list pool that always leaks, and turn the test into an expected pass. Fixes #122 --- t/etc/valgrind.supp | 8 ++++++++ t/t0033-valgrind.t | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 t/etc/valgrind.supp diff --git a/t/etc/valgrind.supp b/t/etc/valgrind.supp new file mode 100644 index 00000000..c5211f21 --- /dev/null +++ b/t/etc/valgrind.supp @@ -0,0 +1,8 @@ +{ + + Memcheck:Leak + match-leak-kinds: possible + fun:malloc + fun:list_alloc_aux + ... +} diff --git a/t/t0033-valgrind.t b/t/t0033-valgrind.t index 509d8493..be397a94 100755 --- a/t/t0033-valgrind.t +++ b/t/t0033-valgrind.t @@ -8,6 +8,7 @@ powermand=$SHARNESS_BUILD_DIRECTORY/src/powerman/powermand powerman=$SHARNESS_BUILD_DIRECTORY/src/powerman/powerman vpcd=$SHARNESS_BUILD_DIRECTORY/t/simulators/vpcd vpcdev=$SHARNESS_TEST_SRCDIR/etc/vpc.dev +suppressions=$SHARNESS_TEST_SRCDIR/etc/valgrind.supp # Use port = 11000 + test number # That way there won't be port conflicts with make -j @@ -27,8 +28,9 @@ test_expect_success 'create test powerman.conf' ' alias "a0" "t0" EOT ' -test_expect_failure 'run powermand --stdio under valgrind' ' +test_expect_success 'run powermand --stdio under valgrind' ' valgrind --tool=memcheck --leak-check=full --error-exitcode=1 \ + --gen-suppressions=all --suppressions=$suppressions \ $powermand --stdio -c powerman.conf 2>valgrind.err <<-EOT help EOT