Print this page
NEX-3363 Test suites don't cleanup after themselves properly.
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
4206 history_003_pos relies on exact size of history log and entries
4207 history_008_pos depends on obsolete internal history log message
4208 Typo in zfs_main.c: "posxiuser"
4209 Populate zfstest with the remainder of the STF tests
Reviewed by: Sonu Pillai <sonu.pillai@delphix.com>
Reviewed by: Will Guyette <will.guyette@delphix.com>
Reviewed by: Eric Diven <eric.diven@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>


  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 2008 Sun Microsystems, Inc.  All rights reserved.
  25 # Use is subject to license terms.
  26 #
  27 
  28 #
  29 # Copyright (c) 2013, 2016 by Delphix. All rights reserved.

  30 #
  31 
  32 . $STF_SUITE/include/libtest.shlib
  33 . $STF_SUITE/tests/functional/replacement/replacement.cfg
  34 
  35 #
  36 # DESCRIPTION:
  37 #       Replacing disks during I/O should pass for supported pools.
  38 #
  39 # STRATEGY:
  40 #       1. Create multidisk pools (stripe/mirror/raidz) and
  41 #          start some random I/O
  42 #       2. Replace a disk in the pool with anbother disk.
  43 #       3. Verify the integrity of the file system and the resilvering.
  44 #
  45 
  46 verify_runnable "global"
  47 
  48 function cleanup
  49 {
  50         if [[ -n "$child_pids" ]]; then
  51                 for wait_pid in $child_pids
  52                 do
  53                         kill $wait_pid
  54                 done
  55         fi
  56 
  57         if poolexists $TESTPOOL1; then
  58                 destroy_pool $TESTPOOL1
  59         fi
  60 

  61         [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
  62 }
  63 
  64 log_assert "Replacing a disk during I/O completes."
  65 
  66 options=""
  67 options_display="default options"
  68 
  69 log_onexit cleanup
  70 
  71 [[ -n "$HOLES_FILESIZE" ]] && options=" $options -f $HOLES_FILESIZE "
  72 
  73 [[ -n "$HOLES_BLKSIZE" ]] && options="$options -b $HOLES_BLKSIZE "
  74 
  75 [[ -n "$HOLES_COUNT" ]] && options="$options -c $HOLES_COUNT "
  76 
  77 [[ -n "$HOLES_SEED" ]] && options="$options -s $HOLES_SEED "
  78 
  79 [[ -n "$HOLES_FILEOFFSET" ]] && options="$options -o $HOLES_FILEOFFSET "
  80 




  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 2008 Sun Microsystems, Inc.  All rights reserved.
  25 # Use is subject to license terms.
  26 #
  27 
  28 #
  29 # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
  30 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  31 #
  32 
  33 . $STF_SUITE/include/libtest.shlib
  34 . $STF_SUITE/tests/functional/replacement/replacement.cfg
  35 
  36 #
  37 # DESCRIPTION:
  38 #       Replacing disks during I/O should pass for supported pools.
  39 #
  40 # STRATEGY:
  41 #       1. Create multidisk pools (stripe/mirror/raidz) and
  42 #          start some random I/O
  43 #       2. Replace a disk in the pool with anbother disk.
  44 #       3. Verify the integrity of the file system and the resilvering.
  45 #
  46 
  47 verify_runnable "global"
  48 
  49 function cleanup
  50 {
  51         if [[ -n "$child_pids" ]]; then
  52                 for wait_pid in $child_pids
  53                 do
  54                         kill $wait_pid
  55                 done
  56         fi
  57 
  58         if poolexists $TESTPOOL1; then
  59                 destroy_pool $TESTPOOL1
  60         fi
  61 
  62         [[ -e $TESTDIR1 ]] && log_must rm -rf $TESTDIR1
  63         [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
  64 }
  65 
  66 log_assert "Replacing a disk during I/O completes."
  67 
  68 options=""
  69 options_display="default options"
  70 
  71 log_onexit cleanup
  72 
  73 [[ -n "$HOLES_FILESIZE" ]] && options=" $options -f $HOLES_FILESIZE "
  74 
  75 [[ -n "$HOLES_BLKSIZE" ]] && options="$options -b $HOLES_BLKSIZE "
  76 
  77 [[ -n "$HOLES_COUNT" ]] && options="$options -c $HOLES_COUNT "
  78 
  79 [[ -n "$HOLES_SEED" ]] && options="$options -s $HOLES_SEED "
  80 
  81 [[ -n "$HOLES_FILEOFFSET" ]] && options="$options -o $HOLES_FILEOFFSET "
  82