diff options
Diffstat (limited to 'tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_mountpoint.ksh')
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_mountpoint.ksh | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_mountpoint.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_mountpoint.ksh new file mode 100755 index 000000000000..9c1251533c1e --- /dev/null +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_mountpoint.ksh @@ -0,0 +1,62 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy is of the CDDL is also available via the Internet +# at http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2018 Datto Inc. +# + +. $STF_SUITE/include/libtest.shlib + +# +# DESCRIPTION: +# zfs inherit should inherit mountpoint on mountpoint=none children +# +# STRATEGY: +# 1. Create a set of nested datasets with mountpoint=none +# 2. Verify datasets aren't mounted +# 3. Inherit mountpoint and verify all datasets are now mounted +# + +verify_runnable "both" + +function inherit_cleanup +{ + log_must zfs destroy -fR $TESTPOOL/inherit_test +} + +log_onexit inherit_cleanup + + +log_must zfs create -o mountpoint=none $TESTPOOL/inherit_test +log_must zfs create $TESTPOOL/inherit_test/child + +if ismounted $TESTPOOL/inherit_test; then + log_fail "$TESTPOOL/inherit_test is mounted" +fi +if ismounted $TESTPOOL/inherit_test/child; then + log_fail "$TESTPOOL/inherit_test/child is mounted" +fi + +log_must zfs inherit mountpoint $TESTPOOL/inherit_test + +if ! ismounted $TESTPOOL/inherit_test; then + log_fail "$TESTPOOL/inherit_test is not mounted" +fi +if ! ismounted $TESTPOOL/inherit_test/child; then + log_fail "$TESTPOOL/inherit_test/child is not mounted" +fi + +log_pass "Verified mountpoint for mountpoint=none children inherited." |