1 #! /usr/bin/ksh -p
   2 #
   3 #
   4 # This file and its contents are supplied under the terms of the
   5 # Common Development and Distribution License ("CDDL"), version 1.0.
   6 # You may only use this file in accordance with the terms of version
   7 # 1.0 of the CDDL.
   8 #
   9 # A full copy of the text of the CDDL should have accompanied this
  10 # source.  A copy of the CDDL is also available via the Internet at
  11 # http://www.illumos.org/license/CDDL.
  12 #
  13 
  14 #
  15 # Copyright 2016 Nexenta Systems, Inc. All rights reserved.
  16 #
  17 
  18 . $STF_SUITE/tests/functional/wbc/wbc.cfg
  19 . $STF_SUITE/tests/functional/wbc/wbc.kshlib
  20 
  21 #
  22 # DESCRIPTION:
  23 #       Creating a pool with a special device succeeds
  24 #
  25 # STRATEGY:
  26 #       1. Create pool with separated special devices
  27 #       2. Display pool status
  28 #       3. Scrub pool and check status
  29 #       4. Destroy and loop to create pool with different configuration
  30 #
  31 
  32 verify_runnable "global"
  33 log_assert "Creating a pool with a special device succeeds."
  34 log_onexit cleanup
  35 for pool_type in "stripe" "mirror" "raidz" "raidz2" "raidz3" ; do
  36         for special_type in "stripe" "mirror" ; do
  37                 for wbc_mode in "none" "on" ; do
  38                         log_must create_pool_special $TESTPOOL $wbc_mode \
  39                             $pool_type $special_type
  40                         log_must display_status $TESTPOOL
  41                         log_must sync
  42                         log_must zpool scrub $TESTPOOL
  43                         while is_pool_scrubbing $TESTPOOL ; do
  44                                 sleep 1
  45                         done
  46                         log_must check_pool_errors $TESTPOOL
  47                         log_must destroy_pool $TESTPOOL
  48                 done
  49         done
  50 done
  51 log_pass "Creating a pool with a special device succeeds."