1#!/bin/ksh -p 2 3# 4# This file and its contents are supplied under the terms of the 5# Common Development and Distribution License ("CDDL"), version 1.0. 6# You may only use this file in accordance with the terms of version 7# 1.0 of the CDDL. 8# 9# A full copy of the text of the CDDL should have accompanied this 10# source. A copy of the CDDL is also available via the Internet at 11# http://www.illumos.org/license/CDDL. 12# 13 14# 15# Copyright (c) 2015 by Delphix. All rights reserved. 16# 17 18. $STF_SUITE/tests/functional/rsend/rsend.kshlib 19 20# 21# Description: 22# Verify compressed send streams replicate data and datasets 23# 24# Strategy: 25# 1. Back up all the data from POOL/FS 26# 2. Verify all the datasets and data can be recovered in POOL2 27# 3. Back up all the data from root filesystem POOL2 28# 4. Verify all the data can be recovered, too 29# 30 31verify_runnable "both" 32 33log_assert "zfs send -c -R send replication stream up to the named snap." 34log_onexit cleanup_pool $POOL2 35 36# Verify the entire pool and descendants can be backed up and restored. 37log_must eval "zfs send -c -R $POOL@final > $BACKDIR/pool-final-R" 38log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final-R" 39 40dstds=$(get_dst_ds $POOL $POOL2) 41log_must cmp_ds_subs $POOL $dstds 42log_must cmp_ds_cont $POOL $dstds 43 44# Cleanup POOL2 45log_must cleanup_pool $POOL2 46 47# Verify all the filesystems and descendants can be backed up and restored. 48log_must eval "zfs send -c -R $POOL/$FS@final > $BACKDIR/fs-final-R" 49log_must eval "zfs receive -d $POOL2 < $BACKDIR/fs-final-R" 50 51dstds=$(get_dst_ds $POOL/$FS $POOL2) 52log_must cmp_ds_subs $POOL/$FS $dstds 53log_must cmp_ds_cont $POOL/$FS $dstds 54 55log_pass "zfs send -c -R send replication stream up to the named snap." 56