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/rootpool/rootpool_007_neg.ksh
          +++ new/usr/src/test/zfs-tests/tests/functional/rootpool/rootpool_007_neg.ksh
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19  #
  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      -# 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  
  34   34  #
  35   35  # DESCRIPTION:
  36   36  #
  37   37  # the zfs rootfilesystem's compression property can not set to gzip[1-9]
  38   38  #
  39   39  # STRATEGY:
  40   40  # 1) check if the current system is installed as zfs root
  41   41  # 2) get the rootfs
  42   42  # 3) set the rootfs's compression to gzip 1-9 which should fail.
  43   43  #
  44   44  
  45   45  verify_runnable "global"
  46   46  
  47   47  function cleanup {
  48      -        log_must $ZFS set compression=$orig_compress $rootfs
       48 +        log_must zfs set compression=$orig_compress $rootfs
  49   49  }
  50   50  
  51   51  log_onexit cleanup
  52   52  log_assert $assert_msg
  53   53  
  54   54  typeset rootpool=$(get_rootpool)
  55   55  typeset rootfs=$(get_pool_prop bootfs $rootpool)
  56   56  typeset orig_compress=$(get_prop compression $rootfs)
  57   57  
  58   58  typeset assert_msg="the zfs rootfs's compression property can not set to \
  59   59                     gzip and gzip[1-9]"
  60   60  
  61   61  set -A gtype "gzip" "gzip-1" "gzip-2" "gzip-3" "gzip-4" "gzip-5" \
  62   62               "gzip-6" "gzip-7" "gzip-8" "gzip-9"
  63   63  
  64   64  typeset -i i=0
  65   65  while (( i < ${#gtype[@]} )); do
  66      -        log_mustnot $ZFS set compression=${gtype[i]} $rootfs
       66 +        log_mustnot zfs set compression=${gtype[i]} $rootfs
  67   67          (( i += 1 ))
  68   68  done
  69   69  
  70   70  log_pass $assert_msg
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX