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 2009 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 . $STF_SUITE/include/libtest.shlib
  32 
  33 verify_disk_count "$DISKS" 2
  34 set -A disk_array $(find_disks $DISKS)
  35 case "${#disk_array[@]}" in
  36 2)
  37         FS_DISK0=${disk_array[0]}
  38         FS_DISK1=${disk_array[1]}
  39         FS_DISK2=${disk_array[0]}
  40         FS_DISK3=${disk_array[1]}
  41         FS_SIDE0=${FS_DISK0}s0
  42         FS_SIDE1=${FS_DISK0}s1
  43         FS_SIDE2=${FS_DISK1}s0
  44         FS_SIDE3=${FS_DISK1}s1
  45         disk0="/dev/dsk/$FS_SIDE0"
  46         disk1="/dev/dsk/$FS_SIDE1"
  47         disk2="/dev/dsk/$FS_SIDE2"
  48         disk3="/dev/dsk/$FS_SIDE3"
  49         disktargets="$disk0 $disk2"
  50         rawdisk0="/dev/rdsk/$FS_SIDE0"
  51         rawdisk1="/dev/rdsk/$FS_SIDE1"
  52         rawdisk2="/dev/rdsk/$FS_SIDE2"
  53         rawdisk3="/dev/rdsk/$FS_SIDE3"
  54         rawtargets="$rawdisk0 $rawdisk2"
  55         vdisks="$FS_DISK0"
  56         sdisks="$FS_DISK1"
  57         vslices="$FS_SIDE0 $FS_SIDE1 $FS_SIDE2"
  58         sslices="$FS_SIDE3"
  59         ;;
  60 3)
  61         FS_DISK0=${disk_array[0]}
  62         FS_DISK1=${disk_array[1]}
  63         FS_DISK2=${disk_array[2]}
  64         FS_DISK3=${disk_array[0]}
  65         FS_SIDE0=${FS_DISK0}s0
  66         FS_SIDE1=${FS_DISK0}s1
  67         FS_SIDE2=${FS_DISK1}s0
  68         FS_SIDE3=${FS_DISK2}s0
  69         disk0="/dev/dsk/$FS_SIDE0"
  70         disk1="/dev/dsk/$FS_SIDE1"
  71         disk2="/dev/dsk/$FS_SIDE2"
  72         disk3="/dev/dsk/$FS_SIDE3"
  73         disktargets="$disk0 $disk2 $disk3"
  74         rawdisk0="/dev/rdsk/$FS_SIDE0"
  75         rawdisk1="/dev/rdsk/$FS_SIDE1"
  76         rawdisk2="/dev/rdsk/$FS_SIDE2"
  77         rawdisk3="/dev/rdsk/$FS_SIDE3"
  78         rawtargets="$rawdisk0 $rawdisk2 $rawdisk3"
  79         vdisks="$FS_DISK0 $FS_DISK1"
  80         sdisks="$FS_DISK2"
  81         vslices="$FS_SIDE0 $FS_SIDE2 $FS_SIDE3"
  82         sslices="$FS_SIDE1"
  83         ;;
  84 *)
  85         FS_DISK0=${disk_array[0]}
  86         FS_DISK1=${disk_array[1]}
  87         FS_DISK2=${disk_array[2]}
  88         FS_DISK3=${disk_array[3]}
  89         FS_SIDE0=${FS_DISK0}s0
  90         FS_SIDE1=${FS_DISK1}s0
  91         FS_SIDE2=${FS_DISK2}s0
  92         FS_SIDE3=${FS_DISK3}s0
  93         disk0="/dev/dsk/$FS_SIDE0"
  94         disk1="/dev/dsk/$FS_SIDE1"
  95         disk2="/dev/dsk/$FS_SIDE2"
  96         disk3="/dev/dsk/$FS_SIDE3"
  97         disktargets="$disk0 $disk1 $disk2 $disk3"
  98         rawdisk0="/dev/rdsk/$FS_SIDE0"
  99         rawdisk1="/dev/rdsk/$FS_SIDE1"
 100         rawdisk2="/dev/rdsk/$FS_SIDE2"
 101         rawdisk3="/dev/rdsk/$FS_SIDE3"
 102         rawtargets="$rawdisk0 $rawdisk1 $rawdisk2 $rawdisk3"
 103         vdisks="$FS_DISK0 $FS_DISK1 $FS_DISK2"
 104         sdisks="$FS_DISK3"
 105         vslices="$FS_SIDE0 $FS_SIDE1 $FS_SIDE2"
 106         sslices="$FS_SIDE3"
 107         ;;
 108 esac
 109 
 110 export FS_DISK0 FS_DISK1 FS_DISK2 FS_DISK3 SINGLE_DISK
 111 export FS_SIDE0 FS_SIDE1 FS_SIDE2 FS_SIDE3
 112 export disk0 disk1 disk2 disk3 disktargets
 113 export rawdisk0 rawdisk1 rawdisk2 rawdisk3 rawtargets
 114 export vdisks sdisks vslices sslices
 115 
 116 export UFSMP=$TESTDIR/testinuseufsdump
 117 export FS_SIZE=1g
 118 export PREVDUMPDEV=""
 119 export PIDUFSDUMP=""
 120 export PIDUFSRESTORE=""
 121 # size of block to be written to test file - currently 1mb
 122 export BLOCK_SIZE=$(( 1024 * 1024 ))
 123 # number of blocks to write == size of file
 124 export BLOCK_COUNT=100
 125 export STF_TIMEOUT=1200                 # 20 minutes max.