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/include/properties.shlib
          +++ new/usr/src/test/zfs-tests/include/properties.shlib
↓ open down ↓ 2 lines elided ↑ open up ↑
   3    3  # Common Development and Distribution License ("CDDL"), version 1.0.
   4    4  # You may only use this file in accordance with the terms of version
   5    5  # 1.0 of the CDDL.
   6    6  #
   7    7  # A full copy of the text of the CDDL should have accompanied this
   8    8  # source.  A copy of the CDDL is also available via the Internet at
   9    9  # http://www.illumos.org/license/CDDL.
  10   10  #
  11   11  
  12   12  #
  13      -# Copyright (c) 2012 by Delphix. All rights reserved.
       13 +# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
  14   14  #
  15   15  
  16   16  typeset -a compress_props=('on' 'off' 'lzjb' 'gzip' 'gzip-1' 'gzip-2' 'gzip-3'
  17   17      'gzip-4' 'gzip-5' 'gzip-6' 'gzip-7' 'gzip-8' 'gzip-9' 'zle')
  18   18  
  19   19  typeset -a checksum_props=('on' 'off' 'fletcher2' 'fletcher4' 'sha256')
  20   20  
  21   21  #
  22   22  # Given the property array passed in, return 'num_props' elements to the
  23   23  # user, excluding any elements below 'start.' This allows us to exclude
↓ open down ↓ 5 lines elided ↑ open up ↑
  29   29          typeset prop_array=($(eval echo \${$1[@]}))
  30   30          typeset -i num_props=$2
  31   31          typeset -i start=$3
  32   32          typeset retstr=""
  33   33  
  34   34          [[ -z $prop_array || -z $num_props || -z $start ]] && \
  35   35              log_fail "get_rand_prop: bad arguments"
  36   36  
  37   37          typeset prop_max=$((${#prop_array[@]} - 1))
  38   38          typeset -i i
  39      -        for i in $($SHUF -i $start-$prop_max -n $num_props); do
       39 +        for i in $(shuf -i $start-$prop_max -n $num_props); do
  40   40                  retstr="${prop_array[$i]} $retstr"
  41   41          done
  42   42          echo $retstr
  43   43  }
  44   44  
  45   45  function get_rand_compress
  46   46  {
  47   47          get_rand_prop compress_props $1 2
  48   48  }
  49   49  
↓ open down ↓ 14 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX