]> git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_006_pos.ksh
68fc5e304011a8cd539b2b3cb49153e4f2cc7cae
[mirror_zfs.git] / tests / zfs-tests / tests / functional / features / large_dnode / large_dnode_006_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 2007 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
26 #
27
28 #
29 # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
30 #
31
32 . $STF_SUITE/include/libtest.shlib
33
34 #
35 # DESCRIPTION:
36 # Run xattrtest on a dataset with large dnodes and xattr=sa
37 # to stress xattr usage of the extra bonus space and verify
38 # contents
39 #
40
41 TEST_FS=$TESTPOOL/large_dnode
42
43 verify_runnable "both"
44
45 function cleanup
46 {
47 datasetexists $TEST_FS && log_must zfs destroy $TEST_FS
48 }
49
50 log_onexit cleanup
51 log_assert "xattrtest runs cleanly on dataset with large dnodes"
52
53 log_must zfs create $TEST_FS
54
55 set -A xattr_sizes "512" "1536" "3584" "7680" "15872"
56 set -A prop_values "1k" "2k" "4k" "8k" "16k"
57
58 for ((i=0; i < ${#prop_values[*]}; i++)) ; do
59 prop_val=${prop_values[$i]}
60 dir=/$TEST_FS/$prop_val
61 xattr_size=${xattr_sizes[$i]}
62 log_must zfs set dnsize=$prop_val $TEST_FS
63 log_must mkdir $dir
64 log_must xattrtest -R -y -s $xattr_size -f 1024 -p $dir
65 done
66
67 log_pass