]>
git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_007_neg.ksh
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
29 # Copyright (c) 2016 by Delphix. All rights reserved.
32 .
$STF_SUITE/tests
/functional
/cli_root
/zfs_mount
/zfs_mount.kshlib
33 .
$STF_SUITE/tests
/functional
/cli_root
/zfs_unmount
/zfs_unmount.kshlib
37 # Try each 'zfs unmount' with inapplicable scenarios to make sure
38 # it returns an error. include:
39 # * Multiple filesystem|mountpoint specified
40 # * '-a', but also with a specific filesystem|mountpoint.
43 # 1. Create an array of parameters
44 # 2. For each parameter in the array, execute the sub-command
45 # 3. Verify an error is returned.
48 verify_runnable
"both"
50 multifs
="$TESTFS $TESTFS1"
53 for fs
in $multifs ; do
54 datasets
="$datasets $TESTPOOL/$fs"
57 set -A args
"$unmountall $TESTPOOL/$TESTFS" \
58 "$unmountcmd $datasets"
64 for fs
in $multifs ; do
65 setup_filesystem
"$DISKS" "$TESTPOOL" \
67 "${TEST_BASE_DIR%%/}/testroot$$/$TESTPOOL/$fs"
76 cleanup_filesystem
"$TESTPOOL" "$TESTFS1"
77 log_must zfs
set mountpoint
=$TESTDIR $TESTPOOL/$TESTFS
79 [[ -d ${TEST_BASE_DIR%%/}/testroot$$
]] && \
80 rm -rf ${TEST_BASE_DIR%%/}/testroot$$
89 for fs
in $multifs ; do
90 log_must mounted
$TESTPOOL/$fs
95 log_assert
"Badly-formed 'zfs $unmountcmd' with inapplicable scenarios " \
96 "should return an error."
97 log_onexit cleanup_all
102 while (( i
< ${#args[*]} )); do
103 log_mustnot zfs
${args[i]}
109 log_pass
"Badly formed 'zfs $unmountcmd' with inapplicable scenarios " \