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 2008 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
28 .
$STF_SUITE/include
/libtest.shlib
32 # Verify recursive snapshotting could not break ZFS.
35 # 1. Create deeply-nested filesystems until it is too long to create snap
36 # 2. Verify zfs snapshot -r pool@snap will not break ZFS
39 verify_runnable
"both"
43 if datasetexists
$initfs ; then
44 log_must
$ZFS destroy
-rf $initfs
48 log_assert
"Verify recursive snapshotting could not break ZFS."
51 initfs
=$TESTPOOL/$TESTFS/$TESTFS
53 typeset
-i ret
=0 len snaplen
54 while ((ret
== 0)); do
56 $ZFS snapshot
$basefs@snap1
60 len
=$
($ECHO $basefs|
$WC -c)
61 log_note
"The deeply-nested filesystem len: $len"
64 # Make sure there are at lease 2 characters left
65 # for snapshot name space, otherwise snapshot name
68 if ((len
>= 255)); then
69 if datasetexists
$basefs; then
70 log_must
$ZFS destroy
-r $basefs
73 len
=$
($ECHO $basefs|
$WC -c)
78 basefs
=$basefs/$TESTFS
81 # Make snapshot name is longer than the max length
82 ((snaplen
= 256 - len
+ 10))
83 snap
=$
(gen_dataset_name
$snaplen "s")
84 log_mustnot
$ZFS snapshot
-r $TESTPOOL@
$snap
86 log_must datasetnonexists
$TESTPOOL@
$snap
87 while [[ $basefs != $TESTPOOL ]]; do
88 log_must datasetnonexists
$basefs@
$snap
92 log_pass
"Verify recursive snapshotting could not break ZFS."