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