Print this page
7290 ZFS test suite needs to control what utilities it can run
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
*** 23,45 ****
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
! # Copyright (c) 2013 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/slog/slog.cfg
function cleanup
{
if datasetexists $TESTPOOL ; then
! log_must $ZPOOL destroy -f $TESTPOOL
fi
if datasetexists $TESTPOOL2 ; then
! log_must $ZPOOL destroy -f $TESTPOOL2
fi
}
#
# Try zpool status/iostat for given pool
--- 23,45 ----
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
! # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/slog/slog.cfg
function cleanup
{
if datasetexists $TESTPOOL ; then
! log_must zpool destroy -f $TESTPOOL
fi
if datasetexists $TESTPOOL2 ; then
! log_must zpool destroy -f $TESTPOOL2
fi
}
#
# Try zpool status/iostat for given pool
*** 49,69 ****
function display_status
{
typeset pool=$1
typeset -i ret=0
! $ZPOOL status -xv $pool > /dev/null 2>&1
ret=$?
! $ZPOOL iostat > /dev/null 2>&1
((ret |= $?))
typeset mntpnt=$(get_prop mountpoint $pool)
! $DD if=/dev/random of=$mntpnt/testfile.$$ &
typeset pid=$!
! $ZPOOL iostat -v 1 3 > /dev/null
((ret |= $?))
kill -9 $pid
return $ret
--- 49,69 ----
function display_status
{
typeset pool=$1
typeset -i ret=0
! zpool status -xv $pool > /dev/null 2>&1
ret=$?
! zpool iostat > /dev/null 2>&1
((ret |= $?))
typeset mntpnt=$(get_prop mountpoint $pool)
! dd if=/dev/random of=$mntpnt/testfile.$$ &
typeset pid=$!
! zpool iostat -v 1 3 > /dev/null
((ret |= $?))
kill -9 $pid
return $ret
*** 92,102 ****
#
# Get all the slog devices and status table like below
#
# mirror:/disks/d ONLINE mirror:/disks/e ONLINE stripe:/disks/f ONLINE
#
! set -A dev_stat_tab $($ZPOOL status -v $pool | $NAWK 'BEGIN {start=0} \
/\tlogs/ {start=1}
/\tmirror/ || /\tspares/ || /^$/ {start=0}
(start==1) && /\t (\/|[a-zA-Z])/ \
{print "stripe:" $1 " " $2}
(start==1) && /\t (\/|[a-zA-Z])/ \
--- 92,102 ----
#
# Get all the slog devices and status table like below
#
# mirror:/disks/d ONLINE mirror:/disks/e ONLINE stripe:/disks/f ONLINE
#
! set -A dev_stat_tab $(zpool status -v $pool | nawk 'BEGIN {start=0} \
/\tlogs/ {start=1}
/\tmirror/ || /\tspares/ || /^$/ {start=0}
(start==1) && /\t (\/|[a-zA-Z])/ \
{print "stripe:" $1 " " $2}
(start==1) && /\t (\/|[a-zA-Z])/ \