12fae26bdSAlan Somers#
22fae26bdSAlan Somers# CDDL HEADER START
32fae26bdSAlan Somers#
42fae26bdSAlan Somers# The contents of this file are subject to the terms of the
52fae26bdSAlan Somers# Common Development and Distribution License (the "License").
62fae26bdSAlan Somers# You may not use this file except in compliance with the License.
72fae26bdSAlan Somers#
82fae26bdSAlan Somers# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
92fae26bdSAlan Somers# or http://www.opensolaris.org/os/licensing.
102fae26bdSAlan Somers# See the License for the specific language governing permissions
112fae26bdSAlan Somers# and limitations under the License.
122fae26bdSAlan Somers#
132fae26bdSAlan Somers# When distributing Covered Code, include this CDDL HEADER in each
142fae26bdSAlan Somers# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
152fae26bdSAlan Somers# If applicable, add the following below this CDDL HEADER, with the
162fae26bdSAlan Somers# fields enclosed by brackets "[]" replaced with your own identifying
172fae26bdSAlan Somers# information: Portions Copyright [yyyy] [name of copyright owner]
182fae26bdSAlan Somers#
192fae26bdSAlan Somers# CDDL HEADER END
202fae26bdSAlan Somers#
212fae26bdSAlan Somers
222fae26bdSAlan Somers#
232fae26bdSAlan Somers# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
242fae26bdSAlan Somers# Use is subject to license terms.
252fae26bdSAlan Somers# For every configX.cfg file there must be a corresponding stateX.cfg
262fae26bdSAlan Somers# file. The state file both drives the operations to be performed on the
272fae26bdSAlan Somers# dataset hierarchy which has been specified by the corresponding
282fae26bdSAlan Somers# configX.cfg file, and also specifies the expected state of the
292fae26bdSAlan Somers# properties after the operation has been completed.
302fae26bdSAlan Somers#
312fae26bdSAlan Somers# The format of the file is:
322fae26bdSAlan Somers#       <target dataset>:<command>
332fae26bdSAlan Somers#       <property source before command>        <property src after command>
342fae26bdSAlan Somers#       <property source before command>        <property src after command>
352fae26bdSAlan Somers#       ....                                    ....
362fae26bdSAlan Somers#       ....                                    ....
372fae26bdSAlan Somers#
382fae26bdSAlan Somers# <target dataset> - dataset upon which the <command> is to be executed. Can
392fae26bdSAlan Somers#                    be any of the datasets specified in the corresponding
402fae26bdSAlan Somers#                    configX.cfg file. If no command is to be executed
412fae26bdSAlan Somers#                    then must be set to '-'
422fae26bdSAlan Somers#
432fae26bdSAlan Somers#
442fae26bdSAlan Somers# <command>        - command to be executed upon the specified dataset.
452fae26bdSAlan Somers#                    Currently the only supported commands are 'inherit'
462fae26bdSAlan Somers#                    or 'inherit -r'. If no command is to be executed,
472fae26bdSAlan Somers#                    then must be set to '-'.
482fae26bdSAlan Somers#
492fae26bdSAlan Somers# <property src before command>
502fae26bdSAlan Somers#                  - the 'source' (as reported in 'zfs get') for the
512fae26bdSAlan Somers#                    the properties before <command> is executed. This
522fae26bdSAlan Somers#                    can be 'default', 'local' or the name of a dataset
532fae26bdSAlan Somers#                    from which the property is inherited. (The code
542fae26bdSAlan Somers#                    automatically adds in the 'inherited from..' part
552fae26bdSAlan Somers#                    of the string when doing the check.
562fae26bdSAlan Somers#
572fae26bdSAlan Somers#                    This field is for informational purposes only, to
582fae26bdSAlan Somers#                    aid the user in seeing how the changes trickle down
592fae26bdSAlan Somers#                    the data hierarchy.
602fae26bdSAlan Somers#
612fae26bdSAlan Somers# <property src after command>
622fae26bdSAlan Somers#                  - the expected value of the 'source' field after the
632fae26bdSAlan Somers#                    <command> has been executed on the <target dataset>.
642fae26bdSAlan Somers#                    As above can be 'default', 'local', or the dataset
652fae26bdSAlan Somers#                    from which the property is inherited.
662fae26bdSAlan Somers#
672fae26bdSAlan Somers# Two important things to note:
682fae26bdSAlan Somers# 1) there must be a <property src..> line corresponding to each dataset
692fae26bdSAlan Somers#    line specified in the configX.cfg file.
702fae26bdSAlan Somers#
712fae26bdSAlan Somers#
722fae26bdSAlan Somers# 2) There can be as many <command>/<property src> blocks as desired, but
732fae26bdSAlan Somers#    there must be at least one, and the effect of each block is cumulative
742fae26bdSAlan Somers#    (i.e. the properties are not reset back to their default values between
752fae26bdSAlan Somers#    each block. If that is desired then each block must be placed in its
762fae26bdSAlan Somers#    own state file with its own corresponding configX.cfg file).
772fae26bdSAlan Somers#
782fae26bdSAlan Somers#
792fae26bdSAlan Somers# Below are two sample <command>/<property src> blocks.
802fae26bdSAlan Somers#
812fae26bdSAlan Somers# The first simply verifies that the properties on the top level dataset
822fae26bdSAlan Somers# were set locally, and that the middle and bottom datasets properties
832fae26bdSAlan Somers# were inherited from the top level pool (called TESTPOOL). Note the '-:-'
842fae26bdSAlan Somers# which means that no command is to be executed, but simply that the
852fae26bdSAlan Somers# properties settings are to be verified.
862fae26bdSAlan Somers#
872fae26bdSAlan Somers-:-
882fae26bdSAlan Somers#
892fae26bdSAlan Somerslocal                           local
902fae26bdSAlan SomersTESTPOOL                        TESTPOOL
912fae26bdSAlan SomersTESTPOOL                        TESTPOOL
922fae26bdSAlan Somers#
932fae26bdSAlan Somers#
942fae26bdSAlan Somers# The block below describes the expected state of the properties after
952fae26bdSAlan Somers# an 'inherit -r' command has been run on the top level pool (called
962fae26bdSAlan Somers# TESTPOOL).
972fae26bdSAlan Somers#
982fae26bdSAlan SomersTESTPOOL:inherit -r
992fae26bdSAlan Somers#
1002fae26bdSAlan Somerslocal				default
1012fae26bdSAlan SomersTESTPOOL			default
1022fae26bdSAlan SomersTESTPOOL			default
103