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,11 +23,11 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/zvol/zvol.cfg
 

@@ -44,29 +44,29 @@
         typeset savedumpdev
         typeset -i output
 
         create_pool $TESTPOOL "$disk"
 
-        log_must $ZFS create -V $size $TESTPOOL/$TESTVOL
+        log_must zfs create -V $size $TESTPOOL/$TESTVOL
 }
 
 #
 # Destroy the default zvol which was setup using
 # default_zvol_setup().
 #
 function default_zvol_cleanup
 {
         if datasetexists $TESTPOOL/$TESTVOL ; then
-                log_must $ZFS destroy $TESTPOOL/$TESTVOL
+                log_must zfs destroy $TESTPOOL/$TESTVOL
         fi
 
         destroy_pool $TESTPOOL
 }
 
 function get_dumpdevice
 {
-        typeset ret=$($DUMPADM | $GREP "Dump device:" | $AWK '{print $3}')
+        typeset ret=$(dumpadm | grep "Dump device:" | awk '{print $3}')
         echo $ret
 }
 
 function set_dumpsize
 {

@@ -75,19 +75,19 @@
         if [[ -z $volume ]] ; then
                 log_note "No volume specified."
                 return 1
         fi
 
-        log_must $ZFS set volsize=64m $volume
+        log_must zfs set volsize=64m $volume
 
-        output=$($DUMPADM -d /dev/zvol/dsk/$volume 2>&1 | \
-                        $TAIL -1 | $AWK '{print $3}')
+        output=$(dumpadm -d /dev/zvol/dsk/$volume 2>&1 | \
+                        tail -1 | awk '{print $3}')
 
         if [[ -n $output ]]; then
                 (( output = output / 1024 / 1024 ))
                 (( output = output + output / 5 ))
-                log_must $ZFS set volsize=${output}m $volume
+                log_must zfs set volsize=${output}m $volume
         fi
         return 0
 }
 
 function safe_dumpadm

@@ -99,17 +99,17 @@
                 return 1
         fi
         if [[ $device == "/dev/zvol/dsk/"* ]] ; then
                 typeset volume=${device#/dev/zvol/dsk/}
                 set_dumpsize $volume
-                log_must $DUMPADM -d $device
+                log_must dumpadm -d $device
         else
-                log_must $SWAPADD
+                log_must swapadd
                 if ! is_swap_inuse $device ; then
-                        log_must $SWAP -a $device
+                        log_must swap -a $device
                 fi
-                log_must $DUMPADM -d swap
+                log_must dumpadm -d swap
         fi
 }
 
 function is_zvol_dumpified
 {

@@ -118,11 +118,11 @@
         if [[ -z $volume ]] ; then
                 log_note "No volume specified."
                 return 1
         fi
 
-        $ZDB -dddd $volume 2 | $GREP "dumpsize" > /dev/null 2>&1
+        zdb -dddd $volume 2 | grep "dumpsize" > /dev/null 2>&1
         return $?
 }
 
 function is_swap_inuse
 {

@@ -131,8 +131,8 @@
         if [[ -z $device ]] ; then
                 log_note "No device specified."
                 return 1
         fi
 
-        $SWAP -l | $GREP -w $device > /dev/null 2>&1
+        swap -l | grep -w $device > /dev/null 2>&1
         return $?
 }