]>
git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_004_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 2009 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
29 # Copyright (c) 2012, 2015 by Delphix. All rights reserved.
30 # Copyright (c) 2017 Lawrence Livermore National Security, LLC.
33 .
$STF_SUITE/include
/libtest.shlib
34 .
$STF_SUITE/tests
/functional
/cli_root
/zpool_expand
/zpool_expand.cfg
38 # After vdev expansion, all 4 labels have the same set of uberblocks.
43 # 2) Create a pool backed by the files
44 # 3) Expand the files' size with truncate
45 # 4) Use zpool online -e to expand the vdevs
46 # 5) Check that for all the devices, all 4 labels have the same uberblocks
49 verify_runnable
"global"
53 poolexists
$TESTPOOL1 && destroy_pool
$TESTPOOL1
56 [ -e ${TEMPFILE}.
$i ] && log_must
rm ${TEMPFILE}.
$i
62 log_assert
"After vdev expansion, all 4 labels have the same set of uberblocks."
64 for type in " " mirror raidz raidz2
; do
66 log_must truncate
-s $org_size ${TEMPFILE}.
$i
69 log_must zpool create
$TESTPOOL1 $type $TEMPFILE.1 \
70 $TEMPFILE.2 $TEMPFILE.3
75 log_must truncate
-s $exp_size ${TEMPFILE}.
$i
79 log_must zpool online
-e $TESTPOOL1 ${TEMPFILE}.
$i
86 non_uniform
=$
(zdb
-lu ${TEMPFILE}.
$i | \
88 grep -c -v 'labels = 0 1 2 3')
90 log_note
"non-uniform label count: $non_uniform"
92 if [[ $non_uniform -ne 0 ]]; then
93 log_fail
"After vdev expansion, all labels contents are not identical"
97 log_must zpool destroy
$TESTPOOL1
100 log_pass
"After vdev expansion, all 4 labels have the same set of uberblocks."