Skip to content
Permalink
Browse files

Fix env variables for kmemleak testing.

  • Loading branch information...
PaulZ-98 committed Sep 26, 2019
1 parent c41322f commit 5ca64be5020b9a63ec411490bf4d52399932448c
@@ -28,3 +28,5 @@ export NISSTAFILE=$TEST_BASE_DIR/nis_state

export ZFS_USER=zxtr
export ZFS_GROUP=zfsgrp
export KMEMLEAK_FILE="/sys/kernel/debug/kmemleak"
export KMEMLEAK_LOG="/sys/kernel/debug/kmemleak.log"
@@ -137,12 +137,12 @@ function create_expected_output { # expected_output_file contents_of_the_outpu
}

function check_mem_leaks {
log_note "Checking for leaks"
if $(sudo -E test -e "$KMEMLEAK_FILE"); then
log_note "Checking for leaks $KMEMLEAK_FILE"
if $(test -e "$KMEMLEAK_FILE"); then
# Scan must be run twice to ensure all leaks are detected.
sudo -E sh -c "echo scan >$KMEMLEAK_FILE"
sudo -E sh -c "echo scan >$KMEMLEAK_FILE"
sudo -E cat $KMEMLEAK_FILE >$KMEMLEAK_LOG
sh -c "echo scan >$KMEMLEAK_FILE"
sh -c "echo scan >$KMEMLEAK_FILE"
cat $KMEMLEAK_FILE >$KMEMLEAK_LOG

if [ -s "$KMEMLEAK_LOG" ]; then
echo "Kmemleak detected see $KMEMLEAK_LOG"
@@ -74,5 +74,5 @@ log_must sync
log_must zfs rollback txg-number-pool/fs1@snap2

log_must stat /txg-number-pool/fs1

check_mem_leaks
log_pass "suspend/resume works with large generation number"

0 comments on commit 5ca64be

Please sign in to comment.
You can’t perform that action at this time.