003 File Manager
Current Path:
/usr/src/sys/contrib/openzfs/tests/zfs-tests/tests/functional/inheritance
usr
/
src
/
sys
/
contrib
/
openzfs
/
tests
/
zfs-tests
/
tests
/
functional
/
inheritance
/
📁
..
📄
Makefile.am
(998 B)
📄
README.config
(2.13 KB)
📄
README.state
(4.27 KB)
📄
cleanup.ksh
(1.03 KB)
📄
config001.cfg
(1.07 KB)
📄
config002.cfg
(1.07 KB)
📄
config003.cfg
(1.08 KB)
📄
config004.cfg
(1.08 KB)
📄
config005.cfg
(1.07 KB)
📄
config006.cfg
(1.07 KB)
📄
config007.cfg
(1.07 KB)
📄
config008.cfg
(1.08 KB)
📄
config009.cfg
(1.08 KB)
📄
config010.cfg
(1.08 KB)
📄
config011.cfg
(1.08 KB)
📄
config012.cfg
(1.08 KB)
📄
config013.cfg
(1.08 KB)
📄
config014.cfg
(1.08 KB)
📄
config015.cfg
(1.07 KB)
📄
config016.cfg
(1.07 KB)
📄
config017.cfg
(1.07 KB)
📄
config018.cfg
(1.07 KB)
📄
config019.cfg
(1.07 KB)
📄
config020.cfg
(1.07 KB)
📄
config021.cfg
(1.07 KB)
📄
config022.cfg
(1.07 KB)
📄
config023.cfg
(1.07 KB)
📄
config024.cfg
(1.07 KB)
📄
inherit.kshlib
(3.08 KB)
📄
inherit_001_pos.ksh
(11.32 KB)
📄
state001.cfg
(1.37 KB)
📄
state002.cfg
(1.43 KB)
📄
state003.cfg
(1.29 KB)
📄
state004.cfg
(1.38 KB)
📄
state005.cfg
(1.41 KB)
📄
state006.cfg
(1.45 KB)
📄
state007.cfg
(1.34 KB)
📄
state008.cfg
(1.31 KB)
📄
state009.cfg
(1.43 KB)
📄
state010.cfg
(1.44 KB)
📄
state011.cfg
(1.5 KB)
📄
state012.cfg
(1.71 KB)
📄
state013.cfg
(1.45 KB)
📄
state014.cfg
(1.71 KB)
📄
state015.cfg
(1.96 KB)
📄
state016.cfg
(1.74 KB)
📄
state017.cfg
(2.04 KB)
📄
state018.cfg
(1.79 KB)
📄
state019.cfg
(1.7 KB)
📄
state020.cfg
(1.72 KB)
📄
state021.cfg
(1.68 KB)
📄
state022.cfg
(1.72 KB)
📄
state023.cfg
(1.66 KB)
📄
state024.cfg
(1.66 KB)
Editing: inherit.kshlib
# # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # # Copyright (c) 2013, 2016 by Delphix. All rights reserved. # # # Simple function to get the source of the specified property. # If unable to get the property then exits. # function get_prop_src # property dataset { typeset prop_val typeset prop=$1 typeset dataset=$2 prop_val=`zfs get -H -o source $prop $dataset` if [[ $? -ne 0 ]]; then log_fail "Unable to determine the source of $prop " \ "property for dataset $dataset" else echo $prop_val fi } # # Function to check the 'source' of a property. The source can # either be "default", "local", or "inherited from <parent dataset>". # # The 'expected src' argument must be either "default", "local", or # a dataset name. # # Returns 0 on success, 1 on failure. # function verify_prop_src # child_dataset property expected_src { typeset target=$1 typeset prop=$2 typeset expected=$3 prop_src=`get_prop_src $prop $target` # # Rather than just checking if $prop_src == $expected # we first determine what value $expected should have. # This allows us to catch the case where a property # has a source of "local" but we expected it to be # "default" # if [[ $expected == "default" ]]; then if [[ $prop_src != $expected ]]; then log_note "Property $prop of $target has source"\ " $prop_src rather than $expected" return 1 fi elif [[ $expected == "local" ]]; then if [[ $prop_src != $expected ]]; then log_note "Property $prop of $target has source"\ " $prop_src rather than $expected" return 1 fi elif [[ $prop_src != "inherited from $expected" ]]; then log_note "Property $prop of $expected has source $prop_src"\ " rather than 'inherited from $expected'" return 1 fi return 0 } # # Simple function to set a property to a # specified value and verify it has changed # correctly. # function set_n_verify_prop #property value dataset { typeset prop=$1 typeset prop_val=$2 typeset dataset=$3 zfs set $prop=$prop_val $dataset check_val=`get_prop $prop $dataset` if [[ $check_val != $prop_val ]]; then log_fail "Property $prop of $dataset has value $check_val"\ " rather than $prop_val" fi }
Upload File
Create Folder