zfs_send_007_pos.ksh revision 1d32ba663e202c24a5a1f2e5aef83fffb447cb7f
#
# CDDL HEADER START
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
#
# CDDL HEADER END
#
#
# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
#
#
# DESCRIPTION:
# Verify 'zfs send' drills holes appropriately when files are replaced
#
# STRATEGY:
# 1. Create dataset
# 2. Write block 0 in a bunch of files
# 3. Snapshot the dataset
# 4. Remove all the files and rewrite some files with just block 1
# 5. Snapshot the dataset
# 6. Send both snapshots and receive them locally
# 7. diff the received dataset and the old datasets.
# 8. Repeat steps 1-7 above with pool that never had hole birth enabled.
#
verify_runnable "both"
function cleanup
{
}
log_assert "Verify that 'zfs send' drills appropriate holes"
vdev=$(mktemp /var/tmp/file.XXXXXX)
test_pool ()
{
POOL=$1
while true; do
break
fi
done
log_must eval "zfs send $POOL/fs@a > $streamfile"
log_must eval "zfs send -i @a $POOL/fs@b > $streamfile"
}
log_pass "'zfs send' drills appropriate holes"