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_017_pos.ksh
          +++ new/usr/src/test/zfs-tests/tests/functional/snapshot/snapshot_017_pos.ksh
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20  # CDDL HEADER END
  21   21  #
  22   22  
  23   23  #
  24   24  # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  25   25  # Use is subject to license terms.
  26   26  #
  27   27  
  28   28  
  29   29  #
  30      -# Copyright (c) 2013 by Delphix. All rights reserved.
       30 +# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
  31   31  #
  32   32  
  33   33  . $STF_SUITE/include/libtest.shlib
  34   34  . $STF_SUITE/tests/functional/snapshot/snapshot.cfg
  35   35  
  36   36  #
  37   37  # DESCRIPTION:
  38   38  #
  39   39  # Directory structure of snapshots reflects filesystem structure.
  40   40  #
↓ open down ↓ 9 lines elided ↑ open up ↑
  50   50  #    checking with both absolute and relative paths
  51   51  #
  52   52  
  53   53  verify_runnable "both"
  54   54  
  55   55  function cleanup
  56   56  {
  57   57          cd $SAVED_DIR
  58   58  
  59   59          if datasetexists $TESTPOOL/$TESTFS ; then
  60      -                log_must $ZFS destroy -Rf $TESTPOOL/$TESTFS
       60 +                log_must zfs destroy -Rf $TESTPOOL/$TESTFS
  61   61          fi
  62   62  
  63      -        log_must $ZFS create $TESTPOOL/$TESTFS
  64      -        log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
       63 +        log_must zfs create $TESTPOOL/$TESTFS
       64 +        log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
  65   65  }
  66   66  
  67   67  function verify_structure {
  68   68  
  69   69          # check absolute paths
  70   70          DIR=$PWD
  71   71          verify_file $DIR/file1
  72   72          verify_file $DIR/file2
  73   73          verify_file $DIR/dir1/file3
  74   74          verify_file $DIR/dir1/file4
↓ open down ↓ 63 lines elided ↑ open up ↑
 138  138  # Create a directory structure with the following files
 139  139  #
 140  140  # ./file1
 141  141  # ./file2
 142  142  # ./dir1/file3
 143  143  # ./dir1/file4
 144  144  # ./dir1/dir2/file5
 145  145  # ./dir1/dir2/file6
 146  146  
 147  147  cd $TESTDIR
 148      -$MKFILE 10m file1
 149      -$MKFILE 20m file2
 150      -$MKDIR dir1
      148 +mkfile 10m file1
      149 +mkfile 20m file2
      150 +mkdir dir1
 151  151  cd dir1
 152      -$MKFILE 10m file3
 153      -$MKFILE 20m file4
 154      -$MKDIR dir2
      152 +mkfile 10m file3
      153 +mkfile 20m file4
      154 +mkdir dir2
 155  155  cd dir2
 156      -$MKFILE 10m file5
 157      -$MKFILE 20m file6
      156 +mkfile 10m file5
      157 +mkfile 20m file6
 158  158  
 159  159  # Now walk the directory structure verifying it
 160  160  cd $TESTDIR
 161  161  verify_structure
 162  162  
 163  163  # Take snapshots
 164      -log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap_a
 165      -log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap_b
      164 +log_must zfs snapshot $TESTPOOL/$TESTFS@snap_a
      165 +log_must zfs snapshot $TESTPOOL/$TESTFS@snap_b
 166  166  
 167  167  # Change the filesystem structure by renaming files in the original structure
 168  168  # The snapshot file structure should not change
 169  169  cd $TESTDIR
 170      -log_must $MV file2 file99
      170 +log_must mv file2 file99
 171  171  cd dir1
 172      -log_must $MV file4 file99
      172 +log_must mv file4 file99
 173  173  cd dir2
 174      -log_must $MV file6 file99
      174 +log_must mv file6 file99
 175  175  
 176  176  # verify the top level snapshot directories
 177  177  verify_dir $TESTDIR/.zfs
 178  178  verify_dir $TESTDIR/.zfs/snapshot
 179  179  verify_dir $TESTDIR/.zfs/snapshot/snap_a
 180  180  verify_dir $TESTDIR/.zfs/snapshot/snap_b
 181  181  
 182  182  cd $TESTDIR/.zfs/snapshot/snap_a
 183  183  verify_structure
 184  184  
↓ open down ↓ 18 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX