rsend_012_pos.ksh revision 1d32ba663e202c24a5a1f2e5aef83fffb447cb7f
#
# 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
# 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.
#
#
# DESCRIPTION:
# zfs send -R will backup all the filesystem properties correctly.
#
# STRATEGY:
# 1. Setting properties for all the filesystem and volumes randomly
# 2. Backup all the data from POOL by send -R
# 3. Restore all the data in POOL2
# 4. Verify all the perperties in two pools are same
#
verify_runnable "global"
function rand_set_prop
{
typeset dtst=$1
typeset prop=$2
shift 2
typeset value=$(random_get $@)
}
function edited_prop
{
typeset behaviour=$1
typeset ds=$2
typeset backfile=$TESTDIR/edited_prop_$ds
case $behaviour in
"get")
! is_te_enabled ; then
continue
fi
if (($? != 0)); then
fi
done
;;
"set")
if [[ ! -f $backfile ]] ; then
fi
if (($? != 0)); then
fi
done < $backfile
;;
*)
log_fail "Unrecognized behaviour: $behaviour"
esac
}
function cleanup
{
typeset prop
done
#if is_shared $POOL; then
# log_must zfs set sharenfs=off $POOL
#fi
if [[ -d $TESTDIR ]]; then
fi
}
log_assert "Verify zfs send -R will backup all the filesystem properties " \
"correctly."
"gzip-1" "gzip-2" "gzip-3" "gzip-4" "gzip-5" "gzip-6" \
"gzip-7" "gzip-8" "gzip-9"
done
"gzip-1" "gzip-2" "gzip-3" "gzip-4" "gzip-5" "gzip-6" \
"gzip-7" "gzip-8" "gzip-9"
done
# Verify inherited property can be received
#
# Duplicate POOL2 for testing
#
#
#
typeset -i i=0
while ((i < ${#pair[@]})); do
((i += 2))
done
if (( $? == 0 )) ; then
i=0
while ((i < ${#pair[@]})); do
((i += 2))
done
fi
"correctly."