5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
28 .
$STF_SUITE/tests
/functional
/cli_root
/zfs_get
/zfs_get_common.kshlib
29 .
$STF_SUITE/tests
/functional
/cli_root
/zfs_get
/zfs_get_list_d.kshlib
33 # 'zfs get -d <n>' should get expected output.
36 # 1. Create a multiple depth filesystem.
37 # 2. 'zfs get -d <n>' to get the output.
38 # 3. 'zfs get -r|egrep' to get the expected output.
39 # 4. Compare the two outputs, they shoud be same.
42 verify_runnable
"both"
44 log_assert
"'zfs get -d <n>' should get expected output."
45 log_onexit depth_fs_cleanup
47 set -A all_props
type used available creation volsize referenced \
48 compressratio mounted origin recordsize quota reservation mountpoint \
49 sharenfs checksum compression atime devices
exec readonly setuid \
50 zoned snapdir acltype aclinherit canmount primarycache secondarycache \
51 usedbychildren usedbydataset usedbyrefreservation usedbysnapshots \
52 userquota@root groupquota@root userused@root groupused@root
54 $ZFS upgrade
-v > /dev
/null
2>&1
55 if [[ $?
-eq 0 ]]; then
56 set -A all_props
${all_props[*]} version
61 mntpnt
=$
(get_prop mountpoint
$DEPTH_FS)
62 DEPTH_OUTPUT
="$mntpnt/depth_output"
63 EXPECT_OUTPUT
="$mntpnt/expect_output"
64 typeset
-i prop_numb
=16
67 typeset eg_opt
="$DEPTH_FS"$
68 for dp
in ${depth_array[@]}; do
70 while (( j
<=dp
&& j
<=MAX_DEPTH
)); do
71 eg_opt
="$eg_opt""|depth""$j"$
74 for prop
in $
(gen_option_str
"${all_props[*]}" "" "," $prop_numb); do
75 log_must
eval "$ZFS get -H -d $dp -o name $prop $DEPTH_FS > $DEPTH_OUTPUT"
76 log_must
eval "$ZFS get -rH -o name $prop $DEPTH_FS | $EGREP -e '$eg_opt' > $EXPECT_OUTPUT"
77 log_must
$DIFF $DEPTH_OUTPUT $EXPECT_OUTPUT
82 log_pass
"'zfs get -d <n>' should get expected output."