Home | History | Annotate | Download | only in slog
      1 #!/bin/ksh -p
      2 #
      3 # CDDL HEADER START
      4 #
      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.
      8 #
      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.
     13 #
     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]
     19 #
     20 # CDDL HEADER END
     21 #
     22 
     23 #
     24 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     25 # Use is subject to license terms.
     26 #
     27 # ident	"@(#)slog_013_pos.ksh	1.1	07/07/31 SMI"
     28 #
     29 
     30 . $STF_SUITE/tests/functional/slog/slog.kshlib
     31 
     32 #################################################################################
     33 #
     34 # __stc_assertion_start
     35 #
     36 # ID: slog_013_pos
     37 #
     38 # DESCRIPTION:
     39 #	Verify slog device can be disk, file, lofi device or any device that
     40 #	presents a block interface.
     41 #
     42 # STRATEGY:
     43 #	1. Create a pool
     44 #	2. Loop to add different object as slog
     45 #	3. Verify it passes
     46 #
     47 # TESTABILITY: explicit
     48 #
     49 # TEST_AUTOMATION_LEVEL: automated
     50 #
     51 # CODING_STATUS: COMPLETED (2007-06-20)
     52 #
     53 # __stc_assertion_end
     54 #
     55 ################################################################################
     56 
     57 verify_runnable "global"
     58 
     59 function cleanup_testenv
     60 {
     61 	cleanup
     62 	if datasetexists $TESTPOOL2 ; then
     63 		log_must $ZPOOL destroy -f $TESTPOOL2
     64 	fi
     65 	if [[ -n $lofidev ]]; then
     66 		$LOFIADM -d $lofidev
     67 	fi
     68 }
     69 
     70 log_assert "Verify slog device can be disk, file, lofi device or any device " \
     71 	"that presents a block interface."
     72 log_onexit cleanup_testenv
     73 
     74 dsk1=${DISKS%% *}
     75 log_must $ZPOOL create $TESTPOOL ${DISKS#$dsk1}
     76 
     77 # Add nomal disk
     78 log_must $ZPOOL add $TESTPOOL log $dsk1
     79 log_must verify_slog_device $TESTPOOL $dsk1 'ONLINE'
     80 # Add nomal file
     81 log_must $ZPOOL add $TESTPOOL log $LDEV
     82 ldev=$(random_get $LDEV)
     83 log_must verify_slog_device $TESTPOOL $ldev 'ONLINE'
     84 
     85 # Add lofi device
     86 lofidev=${LDEV2%% *}
     87 log_must $LOFIADM -a $lofidev
     88 lofidev=$($LOFIADM $lofidev)
     89 log_must $ZPOOL add $TESTPOOL log $lofidev
     90 log_must verify_slog_device $TESTPOOL $lofidev 'ONLINE'
     91 
     92 log_pass "Verify slog device can be disk, file, lofi device or any device " \
     93 	"that presents a block interface."
     94 
     95 # Temp disable fore bug 6569095
     96 # Add file which reside in the itself
     97 mntpnt=$(get_prop mountpoint $TESTPOOL)
     98 log_must $MKFILE 100M $mntpnt/vdev
     99 log_must $ZPOOL add $TESTPOOL $mntpnt/vdev
    100 
    101 # Temp disable fore bug 6569072
    102 # Add ZFS volume
    103 vol=$TESTPOOL/vol
    104 log_must $ZPOOL create -V 64M $vol
    105 log_must $ZPOOL add $TESTPOOL /dev/zvol/dsk/$vol
    106