f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# CDDL HEADER START
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# The contents of this file are subject to the terms of the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Common Development and Distribution License (the "License").
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# You may not use this file except in compliance with the License.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# or http://www.opensolaris.org/os/licensing.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# See the License for the specific language governing permissions
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# and limitations under the License.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# When distributing Covered Code, include this CDDL HEADER in each
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# If applicable, add the following below this CDDL HEADER, with the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# fields enclosed by brackets "[]" replaced with your own identifying
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# information: Portions Copyright [yyyy] [name of copyright owner]
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# CDDL HEADER END
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Use is subject to license terms.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# For every configX.cfg file there must be a corresponding stateX.cfg
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# file. The state file both drives the operations to be performed on the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# dataset hierarchy which has been specified by the corresponding
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# configX.cfg file, and also specifies the expected state of the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# properties after the operation has been completed.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# The format of the file is:
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# <target dataset>:<command>
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# <property source before command> <property src after command>
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# <property source before command> <property src after command>
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# .... ....
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# .... ....
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# <target dataset> - dataset upon which the <command> is to be executed. Can
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# be any of the datasets specified in the corresponding
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# configX.cfg file. If no command is to be executed
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# then must be set to '-'
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# <command> - command to be executed upon the specified dataset.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Currently the only supported commands are 'inherit'
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# or 'inherit -r'. If no command is to be executed,
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# then must be set to '-'.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# <property src before command>
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# - the 'source' (as reported in 'zfs get') for the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# the properties before <command> is executed. This
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# can be 'default', 'local' or the name of a dataset
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# from which the property is inherited. (The code
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# automatically adds in the 'inherited from..' part
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# of the string when doing the check.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# This field is for informational purposes only, to
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# aid the user in seeing how the changes trickle down
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# the data hierarchy.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# <property src after command>
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# - the expected value of the 'source' field after the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# <command> has been executed on the <target dataset>.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# As above can be 'default', 'local', or the dataset
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# from which the property is inherited.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Two important things to note:
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# 1) there must be a <property src..> line corresponding to each dataset
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# line specified in the configX.cfg file.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# 2) There can be as many <command>/<property src> blocks as desired, but
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# there must be at least one, and the effect of each block is cumulative
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# (i.e. the properties are not reset back to their default values between
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# each block. If that is desired then each block must be placed in its
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# own state file with its own corresponding configX.cfg file).
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Below are two sample <command>/<property src> blocks.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# The first simply verifies that the properties on the top level dataset
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# were set locally, and that the middle and bottom datasets properties
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# were inherited from the top level pool (called TESTPOOL). Note the '-:-'
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# which means that no command is to be executed, but simply that the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# properties settings are to be verified.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Copyright (c) 2013 by Delphix. All rights reserved.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy-:-
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedylocal local
f38cb554a534c6df738be3f4d23327e69888e634John Wren KennedyTESTPOOL TESTPOOL
f38cb554a534c6df738be3f4d23327e69888e634John Wren KennedyTESTPOOL TESTPOOL
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# The block below describes the expected state of the properties after
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# an 'inherit -r' command has been run on the top level pool (called
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# TESTPOOL).
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren KennedyTESTPOOL:inherit -r
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedylocal default
f38cb554a534c6df738be3f4d23327e69888e634John Wren KennedyTESTPOOL default
f38cb554a534c6df738be3f4d23327e69888e634John Wren KennedyTESTPOOL default