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/inheritance/inherit_001_pos.ksh
          +++ new/usr/src/test/zfs-tests/tests/functional/inheritance/inherit_001_pos.ksh
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18  # information: Portions Copyright [yyyy] [name of copyright owner]
  19   19  #
  20   20  # CDDL HEADER END
  21   21  #
  22   22  
  23   23  #
  24   24  # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  25   25  # Use is subject to license terms.
  26   26  
  27   27  #
  28      -# Copyright (c) 2013 by Delphix. All rights reserved.
       28 +# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
  29   29  #
  30   30  
  31   31  . $STF_SUITE/include/libtest.shlib
  32   32  . $STF_SUITE/tests/functional/inheritance/inherit.kshlib
  33   33  
  34   34  #
  35   35  # DESCRIPTION:
  36   36  # Test that properties are correctly inherited using 'zfs set',
  37   37  # 'zfs inherit' and 'zfs inherit -r'.
  38   38  #
↓ open down ↓ 12 lines elided ↑ open up ↑
  51   51  # Simple function to create specified datasets.
  52   52  #
  53   53  function create_dataset { #name type disks
  54   54          typeset dataset=$1
  55   55          typeset type=$2
  56   56          typeset disks=$3
  57   57  
  58   58          if [[ $type == "POOL" ]]; then
  59   59                  create_pool "$dataset" "$disks"
  60   60          elif [[ $type == "CTR" ]]; then
  61      -                log_must $ZFS create $dataset
  62      -                log_must $ZFS set canmount=off $dataset
       61 +                log_must zfs create $dataset
       62 +                log_must zfs set canmount=off $dataset
  63   63          elif [[ $type == "FS" ]]; then
  64      -                log_must $ZFS create $dataset
       64 +                log_must zfs create $dataset
  65   65          else
  66   66                  log_fail "Unrecognised type $type"
  67   67          fi
  68   68  
  69   69          list="$list $dataset"
  70   70  }
  71   71  
  72   72  #
  73   73  # Function to walk through all the properties in a
  74   74  # dataset, setting them to a 'local' value if required.
↓ open down ↓ 61 lines elided ↑ open up ↑
 136  136  
 137  137                  ((idx = idx + 2))
 138  138          done
 139  139  
 140  140          ((idx = idx / 2))
 141  141          record_val=`get_prop recordsize $dataset`
 142  142          if [[ $init_code == "-" || $init_code == "default" ]]; then
 143  143                  def_val[idx]=$record_val
 144  144                  def_recordsize=1
 145  145          elif [[ $init_code == "local" ]]; then
 146      -                log_must $ZFS set recordsize=$record_val $dataset
      146 +                log_must zfs set recordsize=$record_val $dataset
 147  147                  local_val[idx]=$record_val
 148  148          fi
 149  149  }
 150  150  
 151  151  #
 152  152  # The mountpoint property is slightly different from other properties and
 153  153  # so is handled here. For all other properties if they are set to a specific
 154  154  # value at a higher level in the data hierarchy (i.e. checksum=on) then that
 155  155  # value propogates down the hierarchy unchanged, with the source field being
 156  156  # set to 'inherited from <higher dataset>'.
↓ open down ↓ 168 lines elided ↑ open up ↑
 325  325                                  # that they propogate down to the lower levels.
 326  326                                  #
 327  327                                  # Note in a few places here, we use
 328  328                                  # check_failure, rather than log_must - this
 329  329                                  # substantially reduces journal output.
 330  330                                  #
 331  331                                  if [[ $op == "-" ]]; then
 332  332                                          log_note "No operation specified"
 333  333                                  else
 334  334                                          export __ZFS_POOL_RESTRICT="$TESTPOOL"
 335      -                                        log_must $ZFS unmount -a
      335 +                                        log_must zfs unmount -a
 336  336                                          unset __ZFS_POOL_RESTRICT
 337  337  
 338  338                                          for p in ${prop[i]} ${prop[((i+1))]}; do
 339      -                                                $ZFS $op $p $target
      339 +                                                zfs $op $p $target
 340  340                                                  ret=$?
 341      -                                                check_failure $ret "$ZFS $op $p \
      341 +                                                check_failure $ret "zfs $op $p \
 342  342                                                      $target"
 343  343                                          done
 344  344                                  fi
 345  345                                  for check_obj in $list; do
 346  346                                          read init_src final_src
 347  347  
 348  348                                          for p in ${prop[i]} ${prop[((i+1))]}; do
 349  349                                          # check_failure to keep journal small
 350  350                                                  verify_prop_src $check_obj $p \
 351  351                                                      $final_src
↓ open down ↓ 86 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX