From 1bc644cf2232d053a9b82ba6d9d427a5bcf320d9 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 19 Aug 2024 17:57:08 -0400 Subject: [PATCH] tests/bcachefs/fstests.ktest: check for leaks Signed-off-by: Kent Overstreet --- tests/fs/bcachefs/bcachefs-test-libs.sh | 5 +++++ tests/fs/bcachefs/fstests.ktest | 2 ++ 2 files changed, 7 insertions(+) diff --git a/tests/fs/bcachefs/bcachefs-test-libs.sh b/tests/fs/bcachefs/bcachefs-test-libs.sh index 25978d1..c4739e6 100644 --- a/tests/fs/bcachefs/bcachefs-test-libs.sh +++ b/tests/fs/bcachefs/bcachefs-test-libs.sh @@ -38,6 +38,11 @@ export BCACHEFS_KERNEL_ONLY=1 #Expensive: #require-kernel-config CLOSURE_DEBUG +check_bcachefs_leaks() +{ + ! grep -v "0 0" /proc/allocinfo|grep fs/bcachefs/ +} + expect_sysfs() { prefix=$1 diff --git a/tests/fs/bcachefs/fstests.ktest b/tests/fs/bcachefs/fstests.ktest index 74d6045..6a7baf1 100755 --- a/tests/fs/bcachefs/fstests.ktest +++ b/tests/fs/bcachefs/fstests.ktest @@ -22,6 +22,8 @@ run_test() run_fstests "$@" + check_bcachefs_leaks + check_counters ${ktest_scratch_dev[0]} check_counters ${ktest_scratch_dev[1]} }