xref: /freebsd/tools/regression/zfs/zpool/add/option-n.t (revision b1f9167f94059fd55c630891d359bcff987bd7eb)
1#!/bin/sh
2# $FreeBSD$
3
4dir=`dirname $0`
5. ${dir}/../../misc.sh
6
7echo "1..5"
8
9disks_create 2
10names_create 1
11
12expect_ok ${ZPOOL} create ${name0} ${disk0}
13exp=`(
14  echo "would update '${name0}' to the following configuration:"
15  echo "	${name0}"
16  echo "	  ${disk0}"
17  echo "	  ${disk1}"
18)`
19expect "${exp}" ${ZPOOL} add -n ${name0} ${disk1}
20exp=`(
21  echo "  pool: ${name0}"
22  echo " state: ONLINE"
23  echo " scrub: none requested"
24  echo "config:"
25  echo "	NAME        STATE   READ WRITE CKSUM"
26  echo "	${name0}    ONLINE     0     0     0"
27  echo "	  ${disk0}  ONLINE     0     0     0"
28  echo "errors: No known data errors"
29)`
30expect "${exp}" ${ZPOOL} status ${name0}
31expect_ok ${ZPOOL} destroy ${name0}
32expect_fl ${ZPOOL} status -x ${name0}
33
34disks_destroy
35