1eda14cbcSMatt Macy#
2eda14cbcSMatt Macy# CDDL HEADER START
3eda14cbcSMatt Macy#
4eda14cbcSMatt Macy# The contents of this file are subject to the terms of the
5eda14cbcSMatt Macy# Common Development and Distribution License (the "License").
6eda14cbcSMatt Macy# You may not use this file except in compliance with the License.
7eda14cbcSMatt Macy#
8eda14cbcSMatt Macy# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*271171e0SMartin Matuska# or https://opensource.org/licenses/CDDL-1.0.
10eda14cbcSMatt Macy# See the License for the specific language governing permissions
11eda14cbcSMatt Macy# and limitations under the License.
12eda14cbcSMatt Macy#
13eda14cbcSMatt Macy# When distributing Covered Code, include this CDDL HEADER in each
14eda14cbcSMatt Macy# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15eda14cbcSMatt Macy# If applicable, add the following below this CDDL HEADER, with the
16eda14cbcSMatt Macy# fields enclosed by brackets "[]" replaced with your own identifying
17eda14cbcSMatt Macy# information: Portions Copyright [yyyy] [name of copyright owner]
18eda14cbcSMatt Macy#
19eda14cbcSMatt Macy# CDDL HEADER END
20eda14cbcSMatt Macy#
21eda14cbcSMatt Macy
22eda14cbcSMatt Macy#
23eda14cbcSMatt Macy# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24eda14cbcSMatt Macy# Use is subject to license terms.
25eda14cbcSMatt Macy#
26eda14cbcSMatt Macy#
27eda14cbcSMatt Macy# For every configX.cfg file there must be a corresponding stateX.cfg
28eda14cbcSMatt Macy# file. The state file both drives the operations to be performed on the
29eda14cbcSMatt Macy# dataset hierarchy which has been specified by the corresponding
30eda14cbcSMatt Macy# configX.cfg file, and also specifies the expected state of the
31eda14cbcSMatt Macy# properties after the operation has been completed.
32eda14cbcSMatt Macy#
33eda14cbcSMatt Macy# The format of the file is:
34eda14cbcSMatt Macy#       <target dataset>:<command>
35eda14cbcSMatt Macy#       <property source before command>        <property src after command>
36eda14cbcSMatt Macy#       <property source before command>        <property src after command>
37eda14cbcSMatt Macy#       ....                                    ....
38eda14cbcSMatt Macy#       ....                                    ....
39eda14cbcSMatt Macy#
40eda14cbcSMatt Macy# <target dataset> - dataset upon which the <command> is to be executed. Can
41eda14cbcSMatt Macy#                    be any of the datasets specified in the corresponding
42eda14cbcSMatt Macy#                    configX.cfg file. If no command is to be executed
43eda14cbcSMatt Macy#                    then must be set to '-'
44eda14cbcSMatt Macy#
45eda14cbcSMatt Macy#
46eda14cbcSMatt Macy# <command>        - command to be executed upon the specified dataset.
47eda14cbcSMatt Macy#                    Currently the only supported commands are 'inherit'
48eda14cbcSMatt Macy#                    or 'inherit -r'. If no command is to be executed,
49eda14cbcSMatt Macy#                    then must be set to '-'.
50eda14cbcSMatt Macy#
51eda14cbcSMatt Macy# <property src before command>
52eda14cbcSMatt Macy#                  - the 'source' (as reported in 'zfs get') for the
53eda14cbcSMatt Macy#                    the properties before <command> is executed. This
54eda14cbcSMatt Macy#                    can be 'default', 'local' or the name of a dataset
55eda14cbcSMatt Macy#                    from which the property is inherited. (The code
56eda14cbcSMatt Macy#                    automatically adds in the 'inherited from..' part
57eda14cbcSMatt Macy#                    of the string when doing the check.
58eda14cbcSMatt Macy#
59eda14cbcSMatt Macy#                    This field is for informational purposes only, to
60eda14cbcSMatt Macy#                    aid the user in seeing how the changes trickle down
61eda14cbcSMatt Macy#                    the data hierarchy.
62eda14cbcSMatt Macy#
63eda14cbcSMatt Macy# <property src after command>
64eda14cbcSMatt Macy#                  - the expected value of the 'source' field after the
65eda14cbcSMatt Macy#                    <command> has been executed on the <target dataset>.
66eda14cbcSMatt Macy#                    As above can be 'default', 'local', or the dataset
67eda14cbcSMatt Macy#                    from which the property is inherited.
68eda14cbcSMatt Macy#
69eda14cbcSMatt Macy# Two important things to note:
70eda14cbcSMatt Macy# 1) there must be a <property src..> line corresponding to each dataset
71eda14cbcSMatt Macy#    line specified in the configX.cfg file.
72eda14cbcSMatt Macy#
73eda14cbcSMatt Macy#
74eda14cbcSMatt Macy# 2) There can be as many <command>/<property src> blocks as desired, but
75eda14cbcSMatt Macy#    there must be at least one, and the effect of each block is cumulative
76eda14cbcSMatt Macy#    (i.e. the properties are not reset back to their default values between
77eda14cbcSMatt Macy#    each block. If that is desired then each block must be placed in its
78eda14cbcSMatt Macy#    own state file with its own corresponding configX.cfg file).
79eda14cbcSMatt Macy#
80eda14cbcSMatt Macy#
81eda14cbcSMatt Macy# Below are two sample <command>/<property src> blocks.
82eda14cbcSMatt Macy#
83eda14cbcSMatt Macy# The first simply verifies that the properties on the top level dataset
84eda14cbcSMatt Macy# were set locally, and that the middle and bottom datasets properties
85eda14cbcSMatt Macy# were inherited from the top level pool (called TESTPOOL). Note the '-:-'
86eda14cbcSMatt Macy# which means that no command is to be executed, but simply that the
87eda14cbcSMatt Macy# properties settings are to be verified.
88eda14cbcSMatt Macy#
89eda14cbcSMatt Macy
90eda14cbcSMatt Macy#
91eda14cbcSMatt Macy# Copyright (c) 2013 by Delphix. All rights reserved.
92eda14cbcSMatt Macy#
93eda14cbcSMatt Macy
94eda14cbcSMatt Macy-:-
95eda14cbcSMatt Macy#
96eda14cbcSMatt Macylocal                           local
97eda14cbcSMatt MacyTESTPOOL                        TESTPOOL
98eda14cbcSMatt MacyTESTPOOL                        TESTPOOL
99eda14cbcSMatt Macy#
100eda14cbcSMatt Macy#
101eda14cbcSMatt Macy# The block below describes the expected state of the properties after
102eda14cbcSMatt Macy# an 'inherit -r' command has been run on the top level pool (called
103eda14cbcSMatt Macy# TESTPOOL).
104eda14cbcSMatt Macy#
105eda14cbcSMatt MacyTESTPOOL:inherit -r
106eda14cbcSMatt Macy#
107eda14cbcSMatt Macylocal				default
108eda14cbcSMatt MacyTESTPOOL			default
109eda14cbcSMatt MacyTESTPOOL			default
110