]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tests/zfs-tests/tests/functional/rsend/send-c_mixed_compression.ksh
Vendor import of openzfs master @ 184df27eef0abdc7ab2105b21257f753834b936b
[FreeBSD/FreeBSD.git] / tests / zfs-tests / tests / functional / rsend / send-c_mixed_compression.ksh
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 . $STF_SUITE/include/properties.shlib
20
21 #
22 # Description:
23 # Verify datasets using mixed compression algorithms can be received.
24 #
25 # Strategy:
26 # 1. Write data with each of the available compression algorithms
27 # 2. Receive a full compressed send, and verify the data and compression ratios
28 #
29
30 verify_runnable "both"
31
32 log_assert "Verify datasets using mixed compression algorithms can be received."
33 log_onexit cleanup_pool $POOL2
34
35 send_ds=$POOL2/sendfs
36 recv_ds=$POOL2/recvfs
37
38 log_must zfs create $send_ds
39
40 for prop in "${compress_prop_vals[@]}"; do
41         log_must zfs set compress=$prop $send_ds
42         write_compressible $(get_prop mountpoint $send_ds) 16m
43 done
44
45 log_must zfs set compress=off $send_ds
46 log_must zfs snapshot $send_ds@full
47 log_must eval "zfs send -c $send_ds@full >$BACKDIR/full"
48 log_must eval "zfs recv $recv_ds <$BACKDIR/full"
49
50 verify_stream_size $BACKDIR/full $send_ds
51 verify_stream_size $BACKDIR/full $recv_ds
52 log_must cmp_ds_cont $send_ds $recv_ds
53
54 log_pass "Datasets using mixed compression algorithms can be received."