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
1 1 #!/bin/ksh -p
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
|
↓ 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.
38 38 #
39 39 # STRATEGY:
40 40 # 1. Create files in ufs and tmpfs with xattrs
41 41 # 2. Copy those files to zfs
42 42 # 3. Ensure the xattrs can be read and written
43 43 # 4. Do the same in reverse.
44 44 #
|
↓ 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