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/xattr/xattr_004_pos.ksh
          +++ new/usr/src/test/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17  # fields enclosed by brackets "[]" replaced with your own identifying
  18   18  # information: Portions Copyright [yyyy] [name of copyright owner]
  19   19  #
  20   20  # CDDL HEADER END
  21   21  #
  22   22  # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  23   23  # Use is subject to license terms.
  24   24  #
  25   25  
  26   26  #
  27      -# Copyright (c) 2013 by Delphix. All rights reserved.
       27 +# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
  28   28  #
  29   29  
  30   30  . $STF_SUITE/include/libtest.shlib
  31   31  . $STF_SUITE/tests/functional/xattr/xattr_common.kshlib
  32   32  
  33   33  #
  34   34  # DESCRIPTION:
  35   35  #
  36   36  # Creating files on ufs and tmpfs, and copying those files to ZFS with
  37   37  # appropriate cp flags, the xattrs will still be readable.
↓ open down ↓ 7 lines elided ↑ open up ↑
  45   45  
  46   46  # we need to be able to create zvols to hold our test
  47   47  # ufs filesystem.
  48   48  verify_runnable "global"
  49   49  
  50   50  # Make sure we clean up properly
  51   51  function cleanup {
  52   52  
  53   53          if [ $( ismounted /tmp/ufs.$$ ufs ) ]
  54   54          then
  55      -                log_must $UMOUNT /tmp/ufs.$$
  56      -                log_must $RM -rf /tmp/ufs.$$
       55 +                log_must umount /tmp/ufs.$$
       56 +                log_must rm -rf /tmp/ufs.$$
  57   57          fi
  58   58  }
  59   59  
  60   60  log_assert "Files from ufs,tmpfs with xattrs copied to zfs retain xattr info."
  61   61  log_onexit cleanup
  62   62  
  63   63  # Create a UFS file system that we can work in
  64      -log_must $ZFS create -V128m $TESTPOOL/$TESTFS/zvol
  65      -log_must eval "$ECHO y | $NEWFS /dev/zvol/dsk/$TESTPOOL/$TESTFS/zvol > /dev/null 2>&1"
       64 +log_must zfs create -V128m $TESTPOOL/$TESTFS/zvol
       65 +log_must eval "echo y | newfs /dev/zvol/dsk/$TESTPOOL/$TESTFS/zvol > /dev/null 2>&1"
  66   66  
  67      -log_must $MKDIR /tmp/ufs.$$
  68      -log_must $MOUNT /dev/zvol/dsk/$TESTPOOL/$TESTFS/zvol /tmp/ufs.$$
       67 +log_must mkdir /tmp/ufs.$$
       68 +log_must mount /dev/zvol/dsk/$TESTPOOL/$TESTFS/zvol /tmp/ufs.$$
  69   69  
  70   70  # Create files in ufs and tmpfs, and set some xattrs on them.
  71      -log_must $TOUCH /tmp/ufs.$$/ufs-file.$$
  72      -log_must $TOUCH /tmp/tmpfs-file.$$
       71 +log_must touch /tmp/ufs.$$/ufs-file.$$
       72 +log_must touch /tmp/tmpfs-file.$$
  73   73  
  74      -log_must $RUNAT /tmp/ufs.$$/ufs-file.$$ $CP /etc/passwd .
  75      -log_must $RUNAT /tmp/tmpfs-file.$$ $CP /etc/group .
       74 +log_must runat /tmp/ufs.$$/ufs-file.$$ cp /etc/passwd .
       75 +log_must runat /tmp/tmpfs-file.$$ cp /etc/group .
  76   76  
  77   77  # copy those files to ZFS
  78      -log_must $CP -@ /tmp/ufs.$$/ufs-file.$$ $TESTDIR
  79      -log_must $CP -@ /tmp/tmpfs-file.$$ $TESTDIR
       78 +log_must cp -@ /tmp/ufs.$$/ufs-file.$$ $TESTDIR
       79 +log_must cp -@ /tmp/tmpfs-file.$$ $TESTDIR
  80   80  
  81   81  # ensure the xattr information has been copied correctly
  82      -log_must $RUNAT $TESTDIR/ufs-file.$$ $DIFF passwd /etc/passwd
  83      -log_must $RUNAT $TESTDIR/tmpfs-file.$$ $DIFF group /etc/group
       82 +log_must runat $TESTDIR/ufs-file.$$ diff passwd /etc/passwd
       83 +log_must runat $TESTDIR/tmpfs-file.$$ diff group /etc/group
  84   84  
  85      -log_must $UMOUNT /tmp/ufs.$$
       85 +log_must umount /tmp/ufs.$$
  86   86  log_pass "Files from ufs,tmpfs with xattrs copied to zfs retain xattr info."
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX