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) 2012, 2016 by Delphix. All rights reserved. 29# 30 31. $STF_SUITE/include/libtest.shlib 32 33typeset -a disk_array=($(find_disks $DISKS)) 34case "${#disk_array[*]}" in 350) 36 # 37 # on stf_configure, disk_freelist returns empty. 38 # 39 DISK_COUNT=0 40 ;; 411) 42 # We need to repartition the single disk to two slices. 43 DISK_COUNT=1 44 ZFS_DISK1=${disk_array[0]} 45 ZFSSIDE_DISK1=${ZFS_DISK1}s0 46 ZFS_DISK2=${disk_array[0]} 47 ZFSSIDE_DISK2=${ZFS_DISK2}s1 48 ;; 49*) 50 # We need to repartition the single disk to two slices. 51 DISK_COUNT=2 52 ZFS_DISK1=${disk_array[0]} 53 ZFSSIDE_DISK1=${ZFS_DISK1}s0 54 ZFS_DISK2=${disk_array[1]} 55 ZFSSIDE_DISK2=${ZFS_DISK2}s0 56 ;; 57esac 58 59export DISK_COUNT ZFS_DISK1 ZFSSIDE_DISK1 ZFS_DISK2 ZFSSIDE_DISK2 60 61export FS_SIZE=2gb 62export FILE_SIZE=$MINVDEVSIZE 63export SLICE_SIZE="$((MINVDEVSIZE / (1024 * 1024)))m" 64export MAX_NUM=5 65export GROUP_NUM=3 66export DEVICE_DIR=/dev_import-test 67export BACKUP_DEVICE_DIR=$DEVICE_DIR/backup 68export DEVICE_FILE=disk 69export DEVICE_ARCHIVE=archive_import-test 70export MYTESTFILE=$STF_SUITE/include/libtest.shlib 71 72export CPATH=/var/tmp/cachefile.$$ 73export CPATHBKP=/var/tmp/cachefile.$$.bkp 74export CPATHBKP2=/var/tmp/cachefile.$$.bkp2 75export MD5FILE=/var/tmp/md5sums.$$ 76export MD5FILE2=/var/tmp/md5sums.$$.2 77 78typeset -i num=0 79while (( num < $GROUP_NUM )); do 80 DEVICE_FILES="$DEVICE_FILES ${DEVICE_DIR}/${DEVICE_FILE}$num" 81 (( num = num + 1 )) 82done 83export DEVICE_FILES 84 85export VDEV0=$DEVICE_DIR/${DEVICE_FILE}0 86export VDEV1=$DEVICE_DIR/${DEVICE_FILE}1 87export VDEV2=$DEVICE_DIR/${DEVICE_FILE}2 88export VDEV3=$DEVICE_DIR/${DEVICE_FILE}3 89export VDEV4=$DEVICE_DIR/${DEVICE_FILE}4 90 91export ALTER_ROOT=/alter_import-test 92