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/acl/cifs/cifs.kshlib
          +++ new/usr/src/test/zfs-tests/tests/functional/acl/cifs/cifs.kshlib
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17  # information: Portions Copyright [yyyy] [name of copyright owner]
  18   18  #
  19   19  # CDDL HEADER END
  20   20  #
  21   21  
  22   22  #
  23   23  # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24  # Use is subject to license terms.
  25   25  #
  26   26  
       27 +#
       28 +# Copyright (c) 2016 by Delphix. All rights reserved.
       29 +#
       30 +
  27   31  . $STF_SUITE/include/libtest.shlib
  28   32  
  29   33  #
  30   34  # Create a file or direcotry
  31   35  #
  32   36  # $1: The type specified, "file" or "dir"
  33   37  # $2: The given node name
  34   38  # $3: Owner of the node
  35   39  #
  36   40  function create_object
  37   41  {
  38   42          typeset type=$1
  39   43          typeset object=$2
  40   44          typeset owner=$3
  41   45  
  42   46          destroy_object $object
  43   47  
  44   48          case $type in
  45   49          dir)
  46      -                $MKDIR -p $object
       50 +                mkdir -p $object
  47   51                  ;;
  48   52          file)
  49      -                $ECHO "ZFS test suites" > $object
       53 +                echo "ZFS test suites" > $object
  50   54                  ;;
  51   55          esac
  52   56  
  53   57          if [[ -n $owner ]]; then
  54      -                $CHOWN $owner $object
       58 +                chown $owner $object
  55   59          fi
  56   60          return 0
  57   61  }
  58   62  
  59   63  #
  60   64  # Destroy the given node(s)
  61   65  #
  62   66  # $@: The node(s) need to be destroyed
  63   67  #
  64   68  function destroy_object
  65   69  {
  66   70          for object in $@ ; do
  67   71                  if [[ -e $object ]]; then
  68   72  
  69   73                          # clear_attribute is a common function name,
  70   74                          # but each case should have their own implement.
  71   75                          log_must clear_attribute $object
  72      -                        log_must $RM -rf $object
       76 +                        log_must rm -rf $object
  73   77                  fi
  74   78          done
  75   79          return 0
  76   80  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX