xref: /illumos-gate/usr/src/test/zfs-tests/tests/functional/channel_program/synctask_core/tst.inherit.ksh (revision 915894ef19890baaed00080f85f6b69e225cda98)
1#!/bin/ksh -p
2#
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
6# 1.0 of the CDDL.
7#
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.
11#
12
13#
14# Copyright 2020 Joyent, Inc.
15#
16
17. $STF_SUITE/tests/functional/channel_program/channel_common.kshlib
18
19verify_runnable "global"
20
21fs=$TESTPOOL/$TESTFS
22testprop="com.joyent:testprop"
23testval="testval"
24
25log_must dataset_setprop $fs $testprop $testval
26log_must_program_sync $TESTPOOL - $fs $testprop <<-EOF
27	arg = ...
28	fs = arg["argv"][1]
29	prop = arg["argv"][2]
30	err = zfs.sync.inherit(fs, prop)
31	msg = "resetting " .. prop .. " on " .. fs .. " err=" .. err
32	return msg
33EOF
34
35
36prop=$(get_prop $testprop $fs)
37[[ "$prop" == "-" ]] || log_fail "Property still set after inheriting"
38
39log_pass "Inherit/clear property with channel program works."
40