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,22 +23,22 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# 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
+ log_must zpool destroy -f $TESTPOOL
fi
if datasetexists $TESTPOOL2 ; then
- log_must $ZPOOL destroy -f $TESTPOOL2
+ log_must zpool destroy -f $TESTPOOL2
fi
}
#
# Try zpool status/iostat for given pool
@@ -48,21 +48,21 @@
function display_status
{
typeset pool=$1
typeset -i ret=0
- $ZPOOL status -xv $pool > /dev/null 2>&1
+ zpool status -xv $pool > /dev/null 2>&1
ret=$?
- $ZPOOL iostat > /dev/null 2>&1
+ zpool iostat > /dev/null 2>&1
((ret |= $?))
typeset mntpnt=$(get_prop mountpoint $pool)
- $DD if=/dev/random of=$mntpnt/testfile.$$ &
+ dd if=/dev/random of=$mntpnt/testfile.$$ &
typeset pid=$!
- $ZPOOL iostat -v 1 3 > /dev/null
+ zpool iostat -v 1 3 > /dev/null
((ret |= $?))
kill -9 $pid
return $ret
@@ -91,11 +91,11 @@
#
# 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} \
+ 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,8 +146,8 @@
return 1
}
function verify_cache_support
{
- $ZPOOL upgrade -v | $GREP "Cache devices" > /dev/null 2>&1
+ zpool upgrade -v | grep "Cache devices" > /dev/null 2>&1
return $?
}