xref: /freebsd/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_all.ksh (revision b1c1ee4429fcca8f69873a8be66184e68e1b19d7)
1#! /bin/ksh -p
2# SPDX-License-Identifier: CDDL-1.0
3#
4# CDDL HEADER START
5#
6# The contents of this file are subject to the terms of the
7# Common Development and Distribution License (the "License").
8# You may not use this file except in compliance with the License.
9#
10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11# or https://opensource.org/licenses/CDDL-1.0.
12# See the License for the specific language governing permissions
13# and limitations under the License.
14#
15# When distributing Covered Code, include this CDDL HEADER in each
16# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17# If applicable, add the following below this CDDL HEADER, with the
18# fields enclosed by brackets "[]" replaced with your own identifying
19# information: Portions Copyright [yyyy] [name of copyright owner]
20#
21# CDDL HEADER END
22#
23
24#
25# Copyright (c) 2023 by Pawel Jakub Dawidek
26#
27
28. $STF_SUITE/include/libtest.shlib
29. $STF_SUITE/include/math.shlib
30. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
31
32verify_runnable "both"
33
34verify_crossfs_block_cloning
35
36log_assert "Verify block cloning across datasets with different properties"
37
38log_must zfs set checksum=off $TESTSRCFS
39log_must zfs set compress=off $TESTSRCFS
40log_must zfs set copies=1 $TESTSRCFS
41log_must zfs set recordsize=131072 $TESTSRCFS
42log_must zfs set checksum=fletcher2 $TESTDSTFS
43log_must zfs set compress=lz4 $TESTDSTFS
44log_must zfs set copies=3 $TESTDSTFS
45log_must zfs set recordsize=8192 $TESTDSTFS
46
47FILESIZE=$(random_int_between 2 32767)
48FILESIZE=$((FILESIZE * 64))
49bclone_test text $FILESIZE false $TESTSRCDIR $TESTDSTDIR
50
51log_must zfs set checksum=sha256 $TESTSRCFS
52log_must zfs set compress=zstd $TESTSRCFS
53log_must zfs set copies=2 $TESTSRCFS
54log_must zfs set recordsize=262144 $TESTSRCFS
55log_must zfs set checksum=off $TESTDSTFS
56log_must zfs set compress=off $TESTDSTFS
57log_must zfs set copies=1 $TESTDSTFS
58log_must zfs set recordsize=131072 $TESTDSTFS
59
60FILESIZE=$(random_int_between 2 32767)
61FILESIZE=$((FILESIZE * 64))
62bclone_test text $FILESIZE false $TESTSRCDIR $TESTDSTDIR
63
64log_must zfs set checksum=sha512 $TESTSRCFS
65log_must zfs set compress=gzip $TESTSRCFS
66log_must zfs set copies=2 $TESTSRCFS
67log_must zfs set recordsize=512 $TESTSRCFS
68log_must zfs set checksum=fletcher4 $TESTDSTFS
69log_must zfs set compress=lzjb $TESTDSTFS
70log_must zfs set copies=3 $TESTDSTFS
71log_must zfs set recordsize=16384 $TESTDSTFS
72
73FILESIZE=$(random_int_between 2 32767)
74FILESIZE=$((FILESIZE * 64))
75bclone_test text $FILESIZE false $TESTSRCDIR $TESTDSTDIR
76
77log_must zfs inherit checksum $TESTSRCFS
78log_must zfs inherit compress $TESTSRCFS
79log_must zfs inherit copies $TESTSRCFS
80log_must zfs inherit recordsize $TESTSRCFS
81log_must zfs inherit checksum $TESTDSTFS
82log_must zfs inherit compress $TESTDSTFS
83log_must zfs inherit copies $TESTDSTFS
84log_must zfs inherit recordsize $TESTDSTFS
85
86log_pass
87