5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# This file and its contents are supplied under the terms of the
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# Common Development and Distribution License ("CDDL"), version 1.0.
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# You may only use this file in accordance with the terms of version
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# 1.0 of the CDDL.
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# A full copy of the text of the CDDL should have accompanied this
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# source. A copy of the CDDL is also available via the Internet at
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# Copyright (c) 2015 by Delphix. All rights reserved.
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# Description:
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# Verify that the -c and -D flags do not interfere with each other.
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# 1. Write unique data to a filesystem and create a compressed, deduplicated
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# full stream.
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# 2. Verify that the stream and send dataset show the same size
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# 3. Make several copies of the original data, and create both full and
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# incremental compressed, deduplicated send streams
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# 4. Verify the full stream is no bigger than the stream from step 1
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# 5. Verify the streams can be received correctly.
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmellog_assert "Verify that the -c and -D flags do not interfere with each other"
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# Don't use write_compressible: we want compressible but undedupable data here.
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmellog_must eval "zfs send -D -c $sendfs@snap0 >$stream0"
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# The stream size should match at this point because the data is all unique
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# The stream sizes should match, since the second stream contains no new blocks
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmellog_must eval "zfs send -D -c $sendfs@snap1 >$stream1"
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmelwithin_percent $size0 $size1 90 || log_fail "$size0 and $size1"
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# Finally, make sure the receive works correctly.
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmellog_must eval "zfs send -D -c -i snap0 $sendfs@snap1 >$inc"
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# The size of the incremental should be the same as the initial send.
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmelwithin_percent $size0 $size2 90 || log_fail "$size0 and $size1"
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmellog_pass "The -c and -D flags do not interfere with each other"