zfs_receive_010_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 (c) 2015, 2016 by Delphix. All rights reserved.
#
#
# DESCRIPTION:
# Test that receiving a full send as a clone works correctly.
#
# STRATEGY:
# 1. Create pool and filesystems.
# 2. Send filesystem, receive as clone of itself.
# 3. Verify that nop-write saves space.
# 4. Send filesystem, receive as clone of other filesystem.
# 5. Verify that contents are correct.
# 6. Repeat steps 4 and 5 with filesystems swapped.
#
verify_runnable "both"
function make_object
{
local objnum=$1
local mntpnt=$2
local type=$3
fi
}
function create_pair
{
local objnum=$1
local mntpnt1=$2
local mntpnt2=$3
local type1=$4
local type2=$5
}
function cleanup
{
}
log_assert "zfs receive of full send as clone should work"
#
# Now, we create the two filesystems. By creating objects with
# different types and the same object number in each filesystem, we
# create a situation where, when you receive the full send of each as
# a clone of the other, we will test to ensure that the code correctly
# handles receiving all object types onto all other object types.
#
# Receive a file onto a file (and vice versa).
# Receive a file onto a file with holes (and vice versa).
# Receive a file onto a directory (and vice versa).
# Receive a file onto a missing object (and vice versa).
# Receive a file with holes onto a file with holes (and vice versa).
# Receive a file with holes onto a directory (and vice versa).
# Receive a file with holes onto a missing object (and vice versa).
# Receive a directory onto a directory (and vice versa).
# Receive a directory onto a missing object (and vice versa).
# Receive a missing object onto a missing object (and vice versa).
# Receive a file with a different record size onto a file (and vice versa).
# Remove objects that are intended to be missing.
# Add empty objects to $fs to exercise dmu_traverse code
done
#
# Test that, when we receive a full send as a clone of itself,
# nop-write saves us all the space used by data blocks.
#
log_fail "nop-write failure; expected usage less than "\
fi
# Correctness testing: receive each full send as a clone of the other fiesystem.
log_pass "zfs receive of full send as clone works"