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_005_pos.ksh
          +++ new/usr/src/test/zfs-tests/tests/functional/xattr/xattr_005_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  # read/write/create/delete xattr on a clone filesystem
  36   36  #
  37   37  #
  38   38  # STRATEGY:
  39   39  #       1. Create an xattr on a filesystem
  40   40  #       2. Snapshot the filesystem and clone it
  41   41  #       3. Verify the xattr can still be read, written, deleted
  42   42  #       4. Verify we can create new xattrs on new files created on the clone
  43   43  #
  44   44  
  45   45  function cleanup {
  46   46  
  47      -        log_must $ZFS destroy $TESTPOOL/$TESTFS/clone
  48      -        log_must $ZFS destroy $TESTPOOL/$TESTFS@snapshot1
  49      -        log_must $RM $TESTDIR/myfile.$$
       47 +        log_must zfs destroy $TESTPOOL/$TESTFS/clone
       48 +        log_must zfs destroy $TESTPOOL/$TESTFS@snapshot1
       49 +        log_must rm $TESTDIR/myfile.$$
  50   50  }
  51   51  
  52   52  log_assert "read/write/create/delete xattr on a clone filesystem"
  53   53  log_onexit cleanup
  54   54  
  55   55  # create a file, and an xattr on it
  56      -log_must $TOUCH $TESTDIR/myfile.$$
       56 +log_must touch $TESTDIR/myfile.$$
  57   57  create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
  58   58  
  59   59  # snapshot & clone the filesystem
  60      -log_must $ZFS snapshot $TESTPOOL/$TESTFS@snapshot1
  61      -log_must $ZFS clone $TESTPOOL/$TESTFS@snapshot1 $TESTPOOL/$TESTFS/clone
  62      -log_must $ZFS set mountpoint=$TESTDIR/clone $TESTPOOL/$TESTFS/clone
       60 +log_must zfs snapshot $TESTPOOL/$TESTFS@snapshot1
       61 +log_must zfs clone $TESTPOOL/$TESTFS@snapshot1 $TESTPOOL/$TESTFS/clone
       62 +log_must zfs set mountpoint=$TESTDIR/clone $TESTPOOL/$TESTFS/clone
  63   63  
  64   64  # check for the xattrs on the clone
  65   65  verify_xattr $TESTDIR/clone/myfile.$$ passwd /etc/passwd
  66   66  
  67   67  # check we can create xattrs on the clone
  68   68  create_xattr $TESTDIR/clone/myfile.$$ foo /etc/passwd
  69   69  delete_xattr $TESTDIR/clone/myfile.$$ foo
  70   70  
  71   71  # delete the original dataset xattr
  72   72  delete_xattr $TESTDIR/myfile.$$ passwd
  73   73  
  74   74  # verify it's still there on the clone
  75   75  verify_xattr $TESTDIR/clone/myfile.$$ passwd /etc/passwd
  76   76  delete_xattr $TESTDIR/clone/myfile.$$ passwd
  77   77  
  78   78  log_pass "read/write/create/delete xattr on a clone filesystem"
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX