Mercurial > illumos > illumos-gate
comparison usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib @ 13899:0bcf78798346
3311 Want a test framework for arbitrary OS unit tests
3312 Add a testrunner package for OS unit tests
3313 Add a testrunner package to convert ZFS tests from STF
Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com>
Reviewed by: Will Guyette <will.guyette@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Henrik Mattson <henrik.mattson@delphix.com>
Reviewed by: Sonu Pillai <sonu.pillai@delphix.com>
Reviewed by: Christopher Siden <chris.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Richard Lowe <richlowe@richlowe.net>
author | John Wren Kennedy <john.kennedy@delphix.com> |
---|---|
date | Wed, 05 Dec 2012 22:04:50 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
13898:7f822b09519b | 13899:0bcf78798346 |
---|---|
1 # | |
2 # CDDL HEADER START | |
3 # | |
4 # The contents of this file are subject to the terms of the | |
5 # Common Development and Distribution License (the "License"). | |
6 # You may not use this file except in compliance with the License. | |
7 # | |
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | |
9 # or http://www.opensolaris.org/os/licensing. | |
10 # See the License for the specific language governing permissions | |
11 # and limitations under the License. | |
12 # | |
13 # When distributing Covered Code, include this CDDL HEADER in each | |
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. | |
15 # If applicable, add the following below this CDDL HEADER, with the | |
16 # fields enclosed by brackets "[]" replaced with your own identifying | |
17 # information: Portions Copyright [yyyy] [name of copyright owner] | |
18 # | |
19 # CDDL HEADER END | |
20 # | |
21 | |
22 # | |
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved. | |
24 # Use is subject to license terms. | |
25 # | |
26 | |
27 . $STF_SUITE/include/libtest.shlib | |
28 | |
29 DEPTH_FS=$TESTPOOL/depth_fs | |
30 MAX_DEPTH=3 | |
31 DS_COUNT=3 | |
32 set -A depth_options "d 0" "d 1" "d 2" "d 4" "d 32" | |
33 set -A depth_array 0 1 2 4 32 | |
34 | |
35 # | |
36 # Setup multiple depths datasets, including fs, volume and snapshot. | |
37 # | |
38 function depth_fs_setup | |
39 { | |
40 typeset -i i j k | |
41 typeset fslist | |
42 | |
43 log_must $ZFS create $DEPTH_FS | |
44 | |
45 (( i=1 )) | |
46 while (( i<=MAX_DEPTH )); do | |
47 if (( i==1 )); then | |
48 fslist=$DEPTH_FS | |
49 else | |
50 (( k=i-1 )) | |
51 fslist=$($ZFS list -rH -t filesystem -o name $DEPTH_FS|$GREP depth"$k"$) | |
52 if (( $? != 0 )); then | |
53 log_fail "No depth$k filesystem" | |
54 fi | |
55 fi | |
56 for fs in $fslist; do | |
57 (( j=1 )) | |
58 while (( j<=DS_COUNT )); do | |
59 log_must $ZFS create $fs/fs_"$j"_depth"$i" | |
60 if is_global_zone ; then | |
61 log_must $ZFS create -V 8M $fs/vol_"$j"_depth"$i" | |
62 fi | |
63 log_must $ZFS snapshot $fs@snap_"$j"_depth"$i" | |
64 (( j=j+1 )) | |
65 done | |
66 done | |
67 (( i=i+1 )) | |
68 done | |
69 } | |
70 | |
71 # | |
72 # Cleanup multiple depths filesystem. | |
73 # | |
74 function depth_fs_cleanup | |
75 { | |
76 log_must $ZFS destroy -rR $DEPTH_FS | |
77 } | |
78 | |
79 |