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,10 +23,14 @@
 #
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/truncate/truncate.cfg
 . $STF_SUITE/include/libtest.shlib
 
 #
 # DESCRIPTION:

@@ -40,24 +44,24 @@
 
 verify_runnable "both"
 
 function cleanup
 {
-        [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
-        [[ -f $srcfile ]] && $RM -f $srcfile
+        [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
+        [[ -f $srcfile ]] && rm -f $srcfile
 }
 
 log_assert "Ensure zeroed file gets written correctly during a sync operation"
 
 srcfile="/tmp/cosmo.$$"
-log_must $DD if=/dev/urandom of=$srcfile bs=1024k count=1
+log_must dd if=/dev/urandom of=$srcfile bs=1024k count=1
 
 log_onexit cleanup
-log_must $CP $srcfile $TESTDIR/$TESTFILE
-log_must $CP /dev/null $TESTDIR/$TESTFILE
-log_must $SYNC
+log_must cp $srcfile $TESTDIR/$TESTFILE
+log_must cp /dev/null $TESTDIR/$TESTFILE
+log_must sync
 if [[ -s $TESTDIR/$TESTFILE ]]; then
-        log_note "$($LS -l $TESTDIR/$TESTFILE)"
+        log_note "$(ls -l $TESTDIR/$TESTFILE)"
         log_fail "testfile not truncated"
 fi
 
 log_pass "Successful truncation while a sync operation is in progress."