]> git.proxmox.com Git - mirror_zfs.git/blame - 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
CommitLineData
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
30verify_runnable "both"
31
32function cleanup
33{
34 if datasetexists $LDNPOOL ; then
c1d9abf9 35 log_must zpool destroy -f $LDNPOOL
50c957f7
NB
36 fi
37}
38
39log_onexit cleanup
40
41log_assert "feature correctly switches between enabled and active"
42
43LDNPOOL=ldnpool
44LDNFS=$LDNPOOL/large_dnode
c1d9abf9
JWK
45log_must mkfile 64M $TESTDIR/$LDNPOOL
46log_must zpool create $LDNPOOL $TESTDIR/$LDNPOOL
50c957f7
NB
47
48
c1d9abf9 49state=$(zpool list -Ho feature@large_dnode $LDNPOOL)
50c957f7
NB
50if [[ "$state" != "enabled" ]]; then
51 log_fail "large_dnode has state $state (expected enabled)"
52fi
53
c1d9abf9 54log_must zfs create -o dnodesize=1k $LDNFS
50c957f7 55log_must touch /$LDNFS/foo
c1d9abf9 56log_must zfs unmount $LDNFS
50c957f7 57
c1d9abf9 58state=$(zpool list -Ho feature@large_dnode $LDNPOOL)
50c957f7
NB
59if [[ "$state" != "active" ]]; then
60 log_fail "large_dnode has state $state (expected active)"
61fi
62
c1d9abf9 63log_must zfs destroy $LDNFS
50c957f7 64
c1d9abf9 65state=$(zpool list -Ho feature@large_dnode $LDNPOOL)
50c957f7
NB
66if [[ "$state" != "enabled" ]]; then
67 log_fail "large_dnode has state $state (expected enabled)"
68fi
69
70log_pass