Skip to content

Commit

Permalink
testsuite: add valgrind suppressions
Browse files Browse the repository at this point in the history
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 chaos#122
  • Loading branch information
garlick committed Feb 8, 2024
1 parent c772f5f commit 92555e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions t/etc/valgrind.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
<liblsd_list_pool>
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
fun:list_alloc_aux
...
}
4 changes: 3 additions & 1 deletion t/t0033-valgrind.t
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 92555e2

Please sign in to comment.