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/reservation/reservation_007_pos.sh
          +++ new/usr/src/test/zfs-tests/tests/functional/reservation/reservation_007_pos.sh
↓ 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/reservation/reservation.shlib
  34   34  
  35   35  #
  36   36  # DESCRIPTION:
  37   37  #
  38   38  # Setting a reservation on dataset should have no effect on any other
  39   39  # dataset at the same level in the hierarchy beyond using up available
↓ open down ↓ 9 lines elided ↑ open up ↑
  49   49  #
  50   50  
  51   51  verify_runnable "both"
  52   52  
  53   53  log_assert "Verify reservations on data sets doesn't affect other data sets " \
  54   54      "at same level except for consuming space from common pool"
  55   55  
  56   56  function cleanup
  57   57  {
  58   58          datasetexists $TESTPOOL/$TESTFS2 && \
  59      -            log_must $ZFS destroy -f $TESTPOOL/$TESTFS2
       59 +            log_must zfs destroy -f $TESTPOOL/$TESTFS2
  60   60  
  61   61          datasetexists $TESTPOOL/$TESTFS1 && \
  62      -            log_must $ZFS destroy -f $TESTPOOL/$TESTFS1
       62 +            log_must zfs destroy -f $TESTPOOL/$TESTFS1
  63   63  }
  64   64  
  65   65  log_onexit cleanup
  66   66  
  67   67  space_avail=`get_prop available $TESTPOOL`
  68   68  space_used=`get_prop used $TESTPOOL`
  69   69  
  70   70  resv_size_set=`expr $space_avail / 3`
  71   71  
  72   72  #
↓ open down ↓ 4 lines elided ↑ open up ↑
  77   77  # Any special arguments for create are passed in via the args
  78   78  # paramater.
  79   79  #
  80   80  function create_resv_destroy { # args1 dataset1 args2 dataset2
  81   81  
  82   82          args1=$1
  83   83          dataset1=$2
  84   84          args2=$3
  85   85          dataset2=$4
  86   86  
  87      -        log_must $ZFS create $args1 $dataset1
       87 +        log_must zfs create $args1 $dataset1
  88   88  
  89      -        log_must $ZFS set reservation=$RESV_SIZE $dataset1
       89 +        log_must zfs set reservation=$RESV_SIZE $dataset1
  90   90  
  91   91          avail_aft_dset1=`get_prop available $TESTPOOL`
  92   92          used_aft_dset1=`get_prop used $TESTPOOL`
  93   93  
  94      -        log_must $ZFS create $args2 $dataset2
       94 +        log_must zfs create $args2 $dataset2
  95   95  
  96      -        log_must $ZFS set reservation=$RESV_SIZE $dataset2
       96 +        log_must zfs set reservation=$RESV_SIZE $dataset2
  97   97  
  98   98          #
  99   99          # After destroying the second dataset the space used and
 100  100          # available totals should revert back to the values they
 101  101          # had after creating the first dataset.
 102  102          #
 103      -        log_must $ZFS destroy -f $dataset2
      103 +        log_must zfs destroy -f $dataset2
 104  104  
 105  105          avail_dest_dset2=`get_prop available $TESTPOOL`
 106  106          used_dest_dset2=`get_prop used $TESTPOOL`
 107  107  
 108  108          log_must within_limits $avail_aft_dset1 $avail_dest_dset2 $RESV_TOLERANCE
 109  109          log_must within_limits $used_aft_dset1 $used_dest_dset2 $RESV_TOLERANCE
 110  110  
 111  111  
 112  112          # After destroying the first dataset the space used and
 113  113          # space available totals should revert back to the values
 114  114          # they had when the pool was first created.
 115      -        log_must $ZFS destroy -f $dataset1
      115 +        log_must zfs destroy -f $dataset1
 116  116  
 117  117          avail_dest_dset1=`get_prop available $TESTPOOL`
 118  118          used_dest_dset1=`get_prop used $TESTPOOL`
 119  119  
 120  120          log_must within_limits $avail_dest_dset1 $space_avail $RESV_TOLERANCE
 121  121          log_must within_limits $used_dest_dset1 $space_used $RESV_TOLERANCE
 122  122  }
 123  123  
 124  124  create_resv_destroy "" $TESTPOOL/$TESTFS1 ""  $TESTPOOL/$TESTFS2
 125  125  create_resv_destroy "" $TESTPOOL/$TESTFS2 "" $TESTPOOL/$TESTFS1
 126  126  
 127  127  log_pass "Verify reservations on data sets doesn't affect other data sets at" \
 128  128          " same level except for consuming space from common pool"
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX