xref: /freebsd/tools/regression/zfs/zpool/create/option-o.t (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1#!/bin/sh
2
3dir=`dirname $0`
4. ${dir}/../../misc.sh
5
6echo "1..44"
7
8disks_create 1
9names_create 2
10
11expect_fl ${ZPOOL} create -o size=96M ${name0} ${disk0}
12expect_fl ${ZPOOL} destroy ${name0}
13
14expect_fl ${ZPOOL} create -o used=0 ${name0} ${disk0}
15expect_fl ${ZPOOL} destroy ${name0}
16
17expect_fl ${ZPOOL} create -o available=96M ${name0} ${disk0}
18expect_fl ${ZPOOL} destroy ${name0}
19
20expect_fl ${ZPOOL} create -o capacity=0% ${name0} ${disk0}
21expect_fl ${ZPOOL} destroy ${name0}
22
23expect_fl is_mountpoint /${name0}
24expect_fl is_mountpoint /${name1}
25expect_ok ${ZPOOL} create -o altroot=/${name1} ${name0} ${disk0}
26exp=`(
27  echo "NAME      PROPERTY  VALUE      SOURCE"
28  echo "${name0}  altroot   /${name1}  local"
29)`
30expect "${exp}" ${ZPOOL} get altroot ${name0}
31expect_fl is_mountpoint /${name0}
32if [ -z "${no_mountpoint}" ]; then
33	expect_ok is_mountpoint /${name1}
34else
35	expect_fl is_mountpoint /${name1}
36fi
37expect_ok ${ZPOOL} destroy ${name0}
38expect_fl is_mountpoint /${name0}
39expect_fl is_mountpoint /${name1}
40
41expect_fl ${ZPOOL} create -o health=ONLINE ${name0} ${disk0}
42expect_fl ${ZPOOL} destroy ${name0}
43
44expect_fl ${ZPOOL} create -o guid=13949667482126165574 ${name0} ${disk0}
45expect_fl ${ZPOOL} destroy ${name0}
46
47expect_ok ${ZPOOL} create -o version=9 ${name0} ${disk0}
48exp=`(
49  echo "NAME      PROPERTY  VALUE  SOURCE"
50  echo "${name0}  version   9      local"
51)`
52expect "${exp}" ${ZPOOL} get version ${name0}
53expect_ok ${ZPOOL} destroy ${name0}
54
55expect_fl ${ZPOOL} create -o bootfs=${name0}/root ${name0} ${disk0}
56expect_fl ${ZPOOL} destroy ${name0}
57
58expect_ok ${ZPOOL} create -o delegation=off ${name0} ${disk0}
59exp=`(
60  echo "NAME      PROPERTY    VALUE  SOURCE"
61  echo "${name0}  delegation  off    local"
62)`
63expect "${exp}" ${ZPOOL} get delegation ${name0}
64expect_ok ${ZPOOL} destroy ${name0}
65
66expect_ok ${ZPOOL} create -o autoreplace=on ${name0} ${disk0}
67exp=`(
68  echo "NAME      PROPERTY     VALUE  SOURCE"
69  echo "${name0}  autoreplace  on     local"
70)`
71expect "${exp}" ${ZPOOL} get autoreplace ${name0}
72expect_ok ${ZPOOL} destroy ${name0}
73
74expect_ok ${ZPOOL} create -o cachefile=none ${name0} ${disk0}
75exp=`(
76  echo "NAME      PROPERTY   VALUE  SOURCE"
77  echo "${name0}  cachefile  none   local"
78)`
79expect "${exp}" ${ZPOOL} get cachefile ${name0}
80expect_ok ${ZPOOL} destroy ${name0}
81
82expect_ok ${ZPOOL} create -o cachefile=/tmp/${name1} ${name0} ${disk0}
83exp=`(
84  echo "NAME      PROPERTY   VALUE          SOURCE"
85  echo "${name0}  cachefile  /tmp/${name1}  local"
86)`
87expect "${exp}" ${ZPOOL} get cachefile ${name0}
88expect_ok ${ZPOOL} destroy ${name0}
89
90expect_ok ${ZPOOL} create -o failmode=continue ${name0} ${disk0}
91exp=`(
92  echo "NAME      PROPERTY  VALUE     SOURCE"
93  echo "${name0}  failmode  continue  local"
94)`
95expect "${exp}" ${ZPOOL} get failmode ${name0}
96expect_ok ${ZPOOL} destroy ${name0}
97
98expect_ok ${ZPOOL} create -o failmode=panic ${name0} ${disk0}
99exp=`(
100  echo "NAME      PROPERTY  VALUE  SOURCE"
101  echo "${name0}  failmode  panic  local"
102)`
103expect "${exp}" ${ZPOOL} get failmode ${name0}
104expect_ok ${ZPOOL} destroy ${name0}
105
106disks_destroy
107