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
21 # Verify that zfs mount succeeds with a non-empty directory
26 # 1. Unmount the dataset
27 # 2. Create a new empty directory
28 # 3. Set the dataset's mountpoint
29 # 4. Attempt to mount the dataset
30 # 5. Verify the mount succeeds
31 # 6. Unmount the dataset
32 # 7. Create a file in the directory created in step 2
33 # 8. Attempt to mount the dataset
34 # 9. Verify the mount succeeds
37 verify_runnable "both"
39 log_assert "zfs mount succeeds with non-empty directory"
43 log_must zfs umount $fs
44 log_must mkdir -p $TESTDIR
45 log_must zfs set mountpoint=$TESTDIR $fs
46 log_must zfs mount $fs
47 log_must zfs umount $fs
48 log_must touch $TESTDIR/testfile.$$
49 log_must zfs mount $fs
50 log_must zfs umount $fs
51 log_must rm -rf $TESTDIR
53 log_pass "zfs mount succeeds with non-empty directory as expected."