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 #       Do not allow to add special to the old-version pools (<= 28)
  24 #
  25 # STRATEGY:
  26 #       1. Create pool with version 28 and try to add a special vdev to it
  27 #       2. Try to create pool with version 28 and special vdev
  28 #
  29 
  30 verify_runnable "global"
  31 log_assert "Special vdev cannot be added to the old-version pools"
  32 log_onexit cleanup
  33 
  34 for special_type in "stripe" "mirror" ; do
  35         log_must zpool create -f -o version=28 $TESTPOOL $HDD_DISKS
  36 
  37         if [[ $special_type == "stripe" ]] ; then
  38                 log_mustnot zpool add -f $TESTPOOL special $SSD_DISKS
  39         else
  40                 log_mustnot zpool add -f $TESTPOOL special $special_type \
  41                     $SSD_DISKS
  42         fi
  43 
  44         log_must display_status $TESTPOOL
  45         log_must sync
  46         log_must zpool scrub $TESTPOOL
  47         while is_pool_scrubbing $TESTPOOL ; do
  48                 sleep 1
  49         done
  50 
  51         log_must check_pool_errors $TESTPOOL
  52         log_must destroy_pool $TESTPOOL
  53 done
  54 
  55 for special_type in "stripe" "mirror" ; do
  56         if [[ $special_type == "stripe" ]] ; then
  57                 special_type=""
  58         fi
  59 
  60         log_mustnot zpool create -f -o version=28 $TESTPOOL $HDD_DISKS special \
  61             $special_type $SSD_DISKS
  62 done
  63 
  64 log_pass "Special vdev cannot be added to the old-version pools"