]>
git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_003_pos.ksh
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 2007 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
29 # Copyright (c) 2013 by Delphix. All rights reserved.
32 .
$STF_SUITE/include
/libtest.shlib
36 # Verify 'zfs list -r' could recursively display any children
40 # 1. Prepare a set of datasets by hierarchy.
41 # 2. Execute 'zfs list -r' at the top of these datasets.
42 # 3. Verify all child datasets are all be shown.
47 if [[ -f $tmpfile ]]; then
52 verify_runnable
"both"
55 log_assert
"Verify 'zfs list -r' could display any children recursively."
57 tmpfile
=/var
/tmp
/zfslist.out.$$
58 children
="$TESTPOOL/$TESTFS"
60 for fs
in $DATASETS ; do
61 children
="$children $TESTPOOL/$TESTFS/$fs"
66 for path
in $TESTPOOL/$TESTFS $TESTDIR .
/..
/$TESTDIR ; do
67 $ZFS list
-rH -o name
$path > $tmpfile
68 for fs
in $children ; do
69 $GREP "^${fs}$" $tmpfile > /dev
/null
2>&1
70 if (( $?
!= 0 )); then
71 log_fail
"$fs not shown in the output list."
76 log_pass
"'zfs list -r' could display any children recursively."