3 # This file and its contents are supplied under the terms of the
4 # Common Development and Distribution License ("CDDL"), version 1.0.
5 # You may only use this file in accordance with the terms of version
8 # A full copy of the text of the CDDL should have accompanied this
9 # source. A copy of the CDDL is also available via the Internet at
10 # http://www.illumos.org/license/CDDL.
14 # Copyright 2018, loli10K <ezomori.nozomu@gmail.com>. All rights reserved.
17 . $STF_SUITE/include/libtest.shlib
21 # 'zpool create -t <tempname>' can create a pool with the specified temporary
22 # name. The pool should be present in the namespace as <tempname> until exported
25 # 1. Create a pool with '-t' option
26 # 2. Verify the pool is created with the specified temporary name
29 verify_runnable "global"
35 for pool in $TESTPOOL $TEMPPOOL; do
36 poolexists $pool && destroy_pool $pool
40 log_assert "'zpool create -t <tempname>' can create a pool with the specified" \
44 TEMPPOOL="tempname.$$"
45 typeset poolprops=('comment=text' 'ashift=12' 'listsnapshots=on' 'autoexpand=on'
46 'autoreplace=on' 'delegation=off' 'failmode=continue')
47 typeset fsprops=('canmount=off' 'mountpoint=none' 'utf8only=on'
48 'casesensitivity=mixed' 'version=1' 'normalization=formKD')
50 for poolprop in "${poolprops[@]}"; do
51 for fsprop in "${fsprops[@]}"; do
52 # 1. Create a pool with '-t' option
53 log_must zpool create -t $TEMPPOOL -O $fsprop -o $poolprop \
55 # 2. Verify the pool is created with the specified temporary name
56 log_must poolexists $TEMPPOOL
57 log_mustnot poolexists $TESTPOOL
58 propname="$(awk -F= '{print $1}' <<< $fsprop)"
59 propval="$(awk -F= '{print $2}' <<< $fsprop)"
60 log_must test "$(get_prop $propname $TEMPPOOL)" == "$propval"
61 propname="$(awk -F= '{print $1}' <<< $poolprop)"
62 propval="$(awk -F= '{print $2}' <<< $poolprop)"
63 log_must test "$(get_pool_prop $propname $TEMPPOOL)" == "$propval"
65 destroy_pool $TEMPPOOL
69 log_pass "'zpool create -t <tempname>' successfully creates pools with" \