tools/test/stress2/misc/all.debug.inc: skip undefined variables

On my ZFS based systems, no allocations occur with tags "newblk" or
"freework". This leads to errors executing the tests that check for
memory leaks. Skip the checks if the output of wmstat -m does not
contain lines corresponding to those allocations.

MFC after:	3 days
This commit is contained in:
Stefan Eßer
2026-06-11 13:15:12 +02:00
parent de639dcde2
commit 6e5b990c50
+4 -2
View File
@@ -49,13 +49,15 @@ post_debug() {
debug_statfs=$debug_new; }
debug_new=`vmstat -m | grep -w freework | awk '{print $2}'`
[ $((debug_new - debug_freework)) -gt 0 -a $debug_new -gt 100 ] &&
[ -n "$debug_new" ] &&
[ $((debug_new - debug_freework)) -gt 0 -a $debug_new -gt 100 ] &&
{ printf "stress2: freework leak: %d/%d.\r\n" \
$((debug_new - debug_freework)) $debug_new > $console
debug_freework=$debug_new; }
debug_new=`vmstat -m | grep -w newblk | awk '{print $2}'`
[ $((debug_new - debug_newblk)) -gt 0 -a $debug_new -gt 100 ] &&
[ -n "$debug_new" ] &&
[ $((debug_new - debug_newblk)) -gt 0 -a $debug_new -gt 100 ] &&
{ printf "stress2: newblk leak: %d/%d.\r\n" \
$((debug_new - debug_newblk)) $debug_new > $console
debug_newblk=$debug_new; }