]> git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_003_pos.ksh
Add missing copyright notice to large_dnode tests
[mirror_zfs.git] / tests / zfs-tests / tests / functional / features / large_dnode / large_dnode_003_pos.ksh
1 #!/bin/ksh -p
2 #
3 # CDDL HEADER START
4 #
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.
8 #
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.
13 #
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]
19 #
20 # CDDL HEADER END
21 #
22
23 #
24 # Copyright (c) 2016 by Lawrence Livermore National Security, LLC.
25 # Use is subject to license terms.
26 #
27
28 . $STF_SUITE/include/libtest.shlib
29
30 verify_runnable "both"
31
32 function cleanup
33 {
34 if datasetexists $LDNPOOL ; then
35 log_must zpool destroy -f $LDNPOOL
36 fi
37 }
38
39 log_onexit cleanup
40
41 log_assert "feature correctly switches between enabled and active"
42
43 LDNPOOL=ldnpool
44 LDNFS=$LDNPOOL/large_dnode
45 log_must mkfile 64M $TESTDIR/$LDNPOOL
46 log_must zpool create $LDNPOOL $TESTDIR/$LDNPOOL
47
48
49 state=$(zpool list -Ho feature@large_dnode $LDNPOOL)
50 if [[ "$state" != "enabled" ]]; then
51 log_fail "large_dnode has state $state (expected enabled)"
52 fi
53
54 log_must zfs create -o dnodesize=1k $LDNFS
55 log_must touch /$LDNFS/foo
56 log_must zfs unmount $LDNFS
57
58 state=$(zpool list -Ho feature@large_dnode $LDNPOOL)
59 if [[ "$state" != "active" ]]; then
60 log_fail "large_dnode has state $state (expected active)"
61 fi
62
63 log_must zfs destroy $LDNFS
64
65 state=$(zpool list -Ho feature@large_dnode $LDNPOOL)
66 if [[ "$state" != "enabled" ]]; then
67 log_fail "large_dnode has state $state (expected enabled)"
68 fi
69
70 log_pass