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,44 ****
# Copyright 2009 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
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,44 ----
# Copyright 2009 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
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
*** 48,68 ****
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
--- 48,68 ----
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
*** 91,101 ****
#
# Get all the cache 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} \
/\tcache/ {start=1}
/\tmirror/ || /\tspares/ || /^$/ {start=0}
(start==1) && /\t (\/|[a-zA-Z])/ \
{print "stripe:" $1 " " $2}
(start==1) && /\t (\/|[a-zA-Z])/ \
--- 91,101 ----
#
# Get all the cache 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} \
/\tcache/ {start=1}
/\tmirror/ || /\tspares/ || /^$/ {start=0}
(start==1) && /\t (\/|[a-zA-Z])/ \
{print "stripe:" $1 " " $2}
(start==1) && /\t (\/|[a-zA-Z])/ \
*** 146,153 ****
return 1
}
function verify_cache_support
{
! $ZPOOL upgrade -v | $GREP "Cache devices" > /dev/null 2>&1
return $?
}
--- 146,153 ----
return 1
}
function verify_cache_support
{
! zpool upgrade -v | grep "Cache devices" > /dev/null 2>&1
return $?
}