]>
git.proxmox.com Git - mirror_zfs-debian.git/blob - tests/zfs-tests/tests/functional/no_space/enospc_003_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]
24 # Copyright 2017, loli10K. All rights reserved.
27 .
$STF_SUITE/include
/libtest.shlib
28 .
$STF_SUITE/tests
/functional
/no_space
/enospc.cfg
29 .
$STF_SUITE/tests
/functional
/cli_root
/zpool_create
/zpool_create.shlib
33 # ENOSPC is returned on pools with large physical block size and small
37 # 1. Create a pool with property ashift=13 (8K block size)
38 # 2. Set property recordsize=512 and copies=3 on the root dataset
39 # 3. Write a file until the file system is full
40 # 4. Verify the return code is ENOSPC
43 verify_runnable
"both"
47 log_must zpool destroy
$TESTPOOL1
53 log_assert
"ENOSPC is returned on pools with large physical block size"
55 disk
=$TEST_BASE_DIR/$FILEDISK0
56 # we need a device big enough to test this or failure will not trigger
58 log_must mkfile
$size $disk
60 log_must zpool create
$TESTPOOL1 -o ashift
=13 $disk
61 log_must zfs
set mountpoint
=$TESTDIR $TESTPOOL1
62 log_must zfs
set compression
=off
$TESTPOOL1
63 log_must zfs
set recordsize
=512 $TESTPOOL1
64 log_must zfs
set copies
=3 $TESTPOOL1
66 log_note
"Writing file: $TESTFILE0 until ENOSPC."
67 file_write
-o create
-f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \
68 -c $NUM_WRITES -d $DATA
71 (( $ret != $ENOSPC )) && \
72 log_fail
"$TESTFILE0 returned: $ret rather than ENOSPC."
74 log_pass
"ENOSPC returned as expected."