]>
git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_012_neg.ksh
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 (c) 2015 by Delphix. All rights reserved.
17 .
$STF_SUITE/include
/libtest.shlib
22 # Verify that zfs mount fails with a non-empty directory
24 # Verify that zfs mount succeeds with a non-empty directory
29 # 1. Unmount the dataset
30 # 2. Create a new empty directory
31 # 3. Set the dataset's mountpoint
32 # 4. Attempt to mount the dataset
33 # 5. Verify the mount succeeds
34 # 6. Unmount the dataset
35 # 7. Create a file in the directory created in step 2
36 # 8. Attempt to mount the dataset
37 # 9. Verify the mount fails
40 verify_runnable
"both"
48 log_assert
"zfs mount $behaves with non-empty directory"
52 log_must zfs umount
$fs
53 log_must mkdir
-p $TESTDIR
54 log_must zfs
set mountpoint
=$TESTDIR $fs
55 log_must zfs mount
$fs
56 log_must zfs umount
$fs
57 log_must
touch $TESTDIR/testfile.$$
59 log_mustnot zfs mount
$fs
61 log_must zfs mount
$fs
62 log_must zfs umount
$fs
64 log_must
rm -rf $TESTDIR
66 log_pass
"zfs mount $behaves with non-empty directory as expected."