]>
git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_001_pos.ksh
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.
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.
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]
23 .
$STF_SUITE/include
/libtest.shlib
27 # Verify that the dnode sizes of newly created files are consistent
28 # with the dnodesize dataset property.
31 # 1. Create a file system
32 # 2. Set dnodesize to a legal literal value
34 # 4. Repeat 2-3 for all legal literal values of dnodesize values
35 # 5. Unmount the file system
36 # 6. Use zdb to check expected dnode sizes
39 TEST_FS
=$TESTPOOL/large_dnode
41 verify_runnable
"both"
45 datasetexists
$TEST_FS && log_must
$ZFS destroy
$TEST_FS
49 log_assert
"dnode sizes are consistent with dnodesize dataset property"
51 log_must
$ZFS create
$TEST_FS
53 set -A dnsizes
"512" "1k" "2k" "4k" "8k" "16k"
56 for ((i
=0; i
< ${#dnsizes[*]}; i
++)) ; do
58 if [[ $size == "512" ]] ; then
61 file=/$TEST_FS/file.
$size
62 log_must
$ZFS set dnsize
=$size $TEST_FS
64 inodes
[$i]=$
(ls -li $file |
awk '{print $1}')
67 log_must
$ZFS umount
$TEST_FS
69 for ((i
=0; i
< ${#dnsizes[*]}; i
++)) ; do
70 dnsize
=$
($ZDB -dddd $TEST_FS ${inodes[$i]} |
71 awk '/ZFS plain file/ {print $6}' |
tr K k
)
72 if [[ "$dnsize" != "${dnsizes[$i]}" ]]; then
73 log_fail
"dnode size is $dnsize (expected ${dnsizes[$i]})"
77 log_pass
"dnode sizes are consistent with dnodesize dataset property"