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>

Split Close
Expand all
Collapse all
          --- old/usr/src/test/zfs-tests/tests/functional/atime/atime_common.kshlib
          +++ new/usr/src/test/zfs-tests/tests/functional/atime/atime_common.kshlib
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17  # information: Portions Copyright [yyyy] [name of copyright owner]
  18   18  #
  19   19  # CDDL HEADER END
  20   20  #
  21   21  
  22   22  #
  23   23  # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24   24  # Use is subject to license terms.
  25   25  #
  26   26  
       27 +#
       28 +# Copyright (c) 2016 by Delphix. All rights reserved.
       29 +#
       30 +
  27   31  . $STF_SUITE/tests/functional/atime/atime.cfg
  28   32  . $STF_SUITE/include/libtest.shlib
  29   33  
  30   34  #
  31   35  # Check if the access time for specified file is updated.
  32   36  #
  33   37  # $1 Given an absolute path to a file name
  34   38  #
  35   39  # Return value:
  36   40  #       0 -> The access time is updated.
  37   41  #       1 -> The access time is not updated.
  38   42  #
  39   43  function check_atime_updated
  40   44  {
  41   45          typeset filename=$1
  42   46  
  43      -        typeset before=$($LS -Eu $filename | $AWK '{print $7}')
  44      -        log_must $CAT $filename
  45      -        typeset after=$($LS -Eu $filename | $AWK '{print $7}')
       47 +        typeset before=$(ls -Eu $filename | awk '{print $7}')
       48 +        log_must cat $filename
       49 +        typeset after=$(ls -Eu $filename | awk '{print $7}')
  46   50  
  47   51          if [[ $before != $after ]]; then
  48   52                  return 0
  49   53          else
  50   54                  return 1
  51   55          fi
  52   56  }
  53   57  
  54   58  function setup_snap_clone
  55   59  {
  56   60          # Create two file to verify snapshot.
  57      -        log_must $TOUCH $TESTDIR/$TESTFILE
       61 +        log_must touch $TESTDIR/$TESTFILE
  58   62  
  59   63          create_snapshot $TESTPOOL/$TESTFS $TESTSNAP
  60   64          create_clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE
  61   65  }
  62   66  
  63   67  function cleanup
  64   68  {
  65   69          destroy_clone $TESTPOOL/$TESTCLONE
  66   70          destroy_snapshot $TESTPOOL/$TESTFS@$TESTSNAP
  67   71  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX