]> git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/scrub_mirror/default.cfg
ee05daec4ba9ff2f440445fae27152a0b77dd057
[mirror_zfs.git] / tests / zfs-tests / tests / functional / scrub_mirror / default.cfg
1 #
2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
7 #
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21
22 #
23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 #
26
27 #
28 # Copyright (c) 2013 by Delphix. All rights reserved.
29 #
30
31 export DISKSARRAY=$DISKS
32 export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
33
34 typeset -i NUMBER_OF_DISKS=0
35 for i in $DISKS; do
36 [[ -n $MIRROR_PRIMARY ]] && MIRROR_SECONDARY=$i
37 [[ -z $MIRROR_PRIMARY ]] && MIRROR_PRIMARY=$i
38 done
39
40 if [[ -z $MIRROR_SECONDARY ]]; then
41 # We need to repartition the single disk to two slices
42 SINGLE_DISK=$MIRROR_PRIMARY
43 MIRROR_SECONDARY=$MIRROR_PRIMARY
44 SIDE_PRIMARY_PART=0
45 SIDE_SECONDARY_PART=1
46 if is_linux; then
47 if is_mpath_device $MIRROR_PRIMARY; then
48 export DEV_DSKDIR=$DEV_MPATHDIR
49 else
50 export DEV_DSKDIR=$DEV_RDSKDIR
51 fi
52 if ( is_mpath_device $SINGLE_DISK ) && [[ -z $($ECHO $SINGLE_DISK | awk 'substr($1,18,1)\
53 ~ /^[[:digit:]]+$/') ]] || ( is_real_device $SINGLE_DISK ); then
54 SIDE_PRIMARY=${SINGLE_DISK}1
55 SIDE_SECONDARY=${SINGLE_DISK}2
56 elif ( is_mpath_device $SINGLE_DISK || is_loop_device $SINGLE_DISK ); then
57 SIDE_PRIMARY=${SINGLE_DISK}p1
58 SIDE_SECONDARY=${SINGLE_DISK}p2
59 else
60 log_fail "$SINGLE_DISK not supported for partitioning."
61 fi
62 else
63 export DEV_DSKDIR="/dev"
64 SIDE_PRIMARY=${SINGLE_DISK}s${SIDE_PRIMARY_PART}
65 SIDE_SECONDARY=${SINGLE_DISK}s${SIDE_SECONDARY_PART}
66 fi
67 else
68 SIDE_PRIMARY_PART=0
69 SIDE_SECONDARY_PART=0
70 if is_linux; then
71 if is_mpath_device $MIRROR_PRIMARY; then
72 export DEV_DSKDIR=$DEV_MPATHDIR
73 else
74 export DEV_DSKDIR=$DEV_RDSKDIR
75 fi
76 if ( is_mpath_device $MIRROR_PRIMARY ) && [[ -z $($ECHO $MIRROR_PRIMARY | awk 'substr($1,18,1)\
77 ~ /^[[:digit:]]+$/') ]] || ( is_real_device $MIRROR_PRIMARY ); then
78 SIDE_PRIMARY=${MIRROR_PRIMARY}1
79 elif ( is_mpath_device $MIRROR_PRIMARY || is_loop_device $MIRROR_PRIMARY ); then
80 SIDE_PRIMARY=${MIRROR_PRIMARY}p1
81 else
82 log_fail "$MIRROR_PRIMARY not supported for partitioning."
83 fi
84 if ( is_mpath_device $MIRROR_SECONDARY ) && [[ -z $($ECHO $MIRROR_SECONDARY | awk 'substr($1,18,1)\
85 ~ /^[[:digit:]]+$/') ]] || ( is_real_device $MIRROR_SECONDARY ); then
86 SIDE_SECONDARY=${MIRROR_SECONDARY}1
87 elif ( is_mpath_device $MIRROR_SECONDARY || is_loop_device $MIRROR_SECONDARY ); then
88 SIDE_SECONDARY=${MIRROR_SECONDARY}p1
89 else
90 log_fail "$MIRROR_SECONDARY not supported for partitioning."
91 fi
92 else
93 export DEV_DSKDIR="/dev"
94 SIDE_PRIMARY=${MIRROR_PRIMARY}s${SIDE_PRIMARY_PART}
95 SIDE_SECONDARY=${MIRROR_SECONDARY}s${SIDE_SECONDARY_PART}
96 fi
97 fi
98
99
100 export MIRROR_PRIMARY MIRROR_SECONDARY SINGLE_DISK SIDE_PRIMARY SIDE_SECONDARY
101
102 export FILE_COUNT=10
103 export FILE_SIZE=$(( 1024 * 1024 ))
104 export MIRROR_MEGS=100
105 export MIRROR_SIZE=${MIRROR_MEGS}m # default mirror size
106 export DD_BLOCK=$(( 64 * 1024 ))
107 export DD_COUNT=$(( MIRROR_MEGS * 1024 * 1024 / DD_BLOCK ))