forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add -u option to 'zfs create' that prevents file system from being automatically mounted. This is similar to the 'zfs receive -u'. Authored by: pjd <[email protected]> FreeBSD-commit: freebsd/freebsd-src@35c5823 Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Allan Jude <[email protected]> Ported-by: Ryan Moeller <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11254
- Loading branch information
Ryan Moeller
authored
Dec 4, 2020
1 parent
8f158ae
commit 4b6e2a5
Showing
5 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_nomount.ksh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/ksh -p | ||
# | ||
# 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 of the CDDL is also available via the Internet at | ||
# http://www.illumos.org/license/CDDL. | ||
# | ||
|
||
# | ||
# Copyright 2020 iXsystems, Inc. | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
|
||
# | ||
# DESCRIPTION: | ||
# zfs create -u should leave the new file system unmounted. | ||
# It should not work for a volume. | ||
# | ||
# STRATEGY: | ||
# 1. Create a file system using -u and make sure the file system is not mounted. | ||
# 3. Do it for a volume to verify it fails. | ||
# | ||
|
||
verify_runnable "both" | ||
|
||
function cleanup | ||
{ | ||
local ds | ||
|
||
for ds in "$fs" "$vol"; do | ||
datasetexists "$ds" && destroy_dataset "$ds" | ||
done | ||
} | ||
log_onexit cleanup | ||
|
||
log_assert "zfs create -u leaves the new file system unmounted" | ||
|
||
typeset fs="$TESTPOOL/$TESTFS1" | ||
typeset vol="$TESTPOOL/$TESTVOL1" | ||
|
||
log_must create_dataset "$fs" "-u" | ||
log_mustnot ismounted "$fs" | ||
|
||
log_mustnot zfs create -V $VOLSIZE -u "$vol" | ||
|
||
log_pass "zfs create -u leaves the new file system unmounted" |