Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support inheriting properties in channel programs
This adds support in channel programs to inherit properties analogous to `zfs inherit` by adding `zfs.sync.inherit` and `zfs.check.inherit` functions to the ZFS LUA API. Signed-off-by: Jason King <jason.king@joyent.com>
- Loading branch information
Jason King
committed
Dec 17, 2019
1 parent
54c8366
commit 439a110
Showing
7 changed files
with
163 additions
and
11 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
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
35 changes: 35 additions & 0 deletions
35
tests/zfs-tests/tests/functional/channel_program/synctask_core/tst.inherit.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,35 @@ | ||
#!/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 2019 Joyent, Inc. | ||
# | ||
|
||
. $STF_SUITE/tests/functional/channel_program/channel_common.kshlib | ||
|
||
verify_runnable "global" | ||
|
||
fs=$TESTPOOL/$TESTFS | ||
testprop="com.joyent:testprop" | ||
testval="testval" | ||
|
||
log_must zfs set $testprop=$testval $fs | ||
log_must_program_sync $TESTPOOL - $fs $testprop <<-EOF | ||
arg = ... | ||
fs = arg["argv"][1] | ||
prop = arg["argv"][2] | ||
err = zfs.sync.inherit(fs, prop) | ||
msg = "resetting " .. prop .. " on " .. fs .. " err=" .. err | ||
return msg | ||
EOF | ||
|
||
log_pass "Inherit/clear property with channel program works." |