]>
Commit | Line | Data |
---|---|---|
50c957f7 NB |
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 | ||
75d6b7dd NB |
23 | # |
24 | # Copyright (c) 2016 by Lawrence Livermore National Security, LLC. | |
25 | # Use is subject to license terms. | |
26 | # | |
27 | ||
50c957f7 NB |
28 | . $STF_SUITE/include/libtest.shlib |
29 | ||
30 | verify_runnable "both" | |
31 | ||
32 | function cleanup | |
33 | { | |
34 | if datasetexists $LDNPOOL ; then | |
c1d9abf9 | 35 | log_must zpool destroy -f $LDNPOOL |
50c957f7 NB |
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 | |
c1d9abf9 JWK |
45 | log_must mkfile 64M $TESTDIR/$LDNPOOL |
46 | log_must zpool create $LDNPOOL $TESTDIR/$LDNPOOL | |
50c957f7 NB |
47 | |
48 | ||
c1d9abf9 | 49 | state=$(zpool list -Ho feature@large_dnode $LDNPOOL) |
50c957f7 NB |
50 | if [[ "$state" != "enabled" ]]; then |
51 | log_fail "large_dnode has state $state (expected enabled)" | |
52 | fi | |
53 | ||
c1d9abf9 | 54 | log_must zfs create -o dnodesize=1k $LDNFS |
50c957f7 | 55 | log_must touch /$LDNFS/foo |
c1d9abf9 | 56 | log_must zfs unmount $LDNFS |
50c957f7 | 57 | |
c1d9abf9 | 58 | state=$(zpool list -Ho feature@large_dnode $LDNPOOL) |
50c957f7 NB |
59 | if [[ "$state" != "active" ]]; then |
60 | log_fail "large_dnode has state $state (expected active)" | |
61 | fi | |
62 | ||
c1d9abf9 | 63 | log_must zfs destroy $LDNFS |
50c957f7 | 64 | |
c1d9abf9 | 65 | state=$(zpool list -Ho feature@large_dnode $LDNPOOL) |
50c957f7 NB |
66 | if [[ "$state" != "enabled" ]]; then |
67 | log_fail "large_dnode has state $state (expected enabled)" | |
68 | fi | |
69 | ||
70 | log_pass |