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,23 +23,23 @@
 # Copyright 2008 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
 . $STF_SUITE/tests/functional/slog/slog.cfg
 
 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

@@ -49,21 +49,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

@@ -92,11 +92,11 @@
         #
         # 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} \
+        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])/ \