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/snapshot/snapshot_007_pos.ksh
          +++ new/usr/src/test/zfs-tests/tests/functional/snapshot/snapshot_007_pos.ksh
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19  #
  20   20  # CDDL HEADER END
  21   21  #
  22   22  
  23   23  #
  24   24  # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  25   25  # Use is subject to license terms.
  26   26  #
  27   27  
  28   28  #
  29      -# Copyright (c) 2013 by Delphix. All rights reserved.
       29 +# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
  30   30  #
  31   31  
  32   32  . $STF_SUITE/include/libtest.shlib
  33   33  . $STF_SUITE/tests/functional/snapshot/snapshot.cfg
  34   34  
  35   35  #
  36   36  # DESCRIPTION:
  37   37  # Verify that many snapshots can be made on a zfs dataset.
  38   38  #
  39   39  # STRATEGY:
↓ open down ↓ 4 lines elided ↑ open up ↑
  44   44  #
  45   45  
  46   46  verify_runnable "both"
  47   47  
  48   48  function cleanup
  49   49  {
  50   50          typeset -i i=1
  51   51          while [ $i -lt $COUNT ]; do
  52   52                  snapexists $SNAPCTR.$i
  53   53                  if [[ $? -eq 0 ]]; then
  54      -                        log_must $ZFS destroy $SNAPCTR.$i
       54 +                        log_must zfs destroy $SNAPCTR.$i
  55   55                  fi
  56   56  
  57   57                  if [[ -e $SNAPDIR.$i ]]; then
  58      -                        log_must $RM -rf $SNAPDIR1.$i > /dev/null 2>&1
       58 +                        log_must rm -rf $SNAPDIR1.$i > /dev/null 2>&1
  59   59                  fi
  60   60  
  61   61                  (( i = i + 1 ))
  62   62          done
  63   63  
  64   64          if [[ -e $SNAPDIR1 ]]; then
  65      -                log_must $RM -rf $SNAPDIR1 > /dev/null 2>&1
       65 +                log_must rm -rf $SNAPDIR1 > /dev/null 2>&1
  66   66          fi
  67   67  
  68   68          if [[ -e $TESTDIR ]]; then
  69      -                log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
       69 +                log_must rm -rf $TESTDIR/* > /dev/null 2>&1
  70   70          fi
  71   71  }
  72   72  
  73   73  log_assert "Verify that many snapshots can be made on a zfs dataset."
  74   74  
  75   75  log_onexit cleanup
  76   76  
  77   77  [[ -n $TESTDIR ]] && \
  78      -    log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
       78 +    log_must rm -rf $TESTDIR/* > /dev/null 2>&1
  79   79  
  80   80  typeset -i COUNT=10
  81   81  
  82   82  log_note "Create some files in the $TESTDIR directory..."
  83   83  typeset -i i=1
  84   84  while [[ $i -lt $COUNT ]]; do
  85      -        log_must $FILE_WRITE -o create -f $TESTDIR1/file$i \
       85 +        log_must file_write -o create -f $TESTDIR1/file$i \
  86   86             -b $BLOCKSZ -c $NUM_WRITES -d $i
  87      -        log_must $ZFS snapshot $SNAPCTR.$i
       87 +        log_must zfs snapshot $SNAPCTR.$i
  88   88  
  89   89          (( i = i + 1 ))
  90   90  done
  91   91  
  92   92  log_note "Remove all of the original files"
  93   93  [[ -n $TESTDIR ]] && \
  94      -    log_must $RM -rf $TESTDIR1/file* > /dev/null 2>&1
       94 +    log_must rm -rf $TESTDIR1/file* > /dev/null 2>&1
  95   95  
  96   96  i=1
  97   97  while [[ $i -lt $COUNT ]]; do
  98      -        FILECOUNT=`$LS $SNAPDIR1.$i/file* | wc -l`
       98 +        FILECOUNT=`ls $SNAPDIR1.$i/file* | wc -l`
  99   99          typeset j=1
 100  100          while [ $j -lt $FILECOUNT ]; do
 101      -                log_must $FILE_CHECK $SNAPDIR1.$i/file$j $j
      101 +                log_must file_check $SNAPDIR1.$i/file$j $j
 102  102                  (( j = j + 1 ))
 103  103          done
 104  104          (( i = i + 1 ))
 105  105  done
 106  106  
 107  107  log_pass "All files are consistent"
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX