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 compressed send correctly handles volumes
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# 1. Write compressible data into a volume, take a snap
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# 2. Verify the compressed stream is the correct size, and has the correct data
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# 3. Repeat step 2 for an incremental compressed stream
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmellog_assert "Verify compressed send works with volumes"
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmellog_must eval "zfs send -c $vol@snap >$BACKDIR/full"
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmelmd5=$(dd if=$voldev2 bs=1024k count=$megs 2>/dev/null | md5sum | \
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel[[ $md5 = $md5_1 ]] || log_fail "md5 mismatch: $md5 != $md5_1"
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel# Repeat, for an incremental send
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmellog_must dd oseek=$megs if=$data2 of=$voldev bs=1024k
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmellog_must eval "zfs send -c -i snap $vol@snap2 >$BACKDIR/inc"
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmelverify_stream_size $BACKDIR/inc $vol2 90 $vol2@snap
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmelmd5=$(dd iseek=$megs if=$voldev2 bs=1024k count=$megs 2>/dev/null | md5sum | \
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel[[ $md5 = $md5_2 ]] || log_fail "md5 mismatch: $md5 != $md5_2"
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmellog_pass "Verify compressed send works with volumes"