xref: /freebsd-src/sys/contrib/openzfs/tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh (revision e716630d4cf89e69ec3f675ebfceee09f1a85e05)
1#!/bin/ksh -p
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License (the "License").
7# You may not use this file except in compliance with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or https://opensource.org/licenses/CDDL-1.0.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22
23#
24# Copyright (c) 2016 by Gvozden Neskovic. All rights reserved.
25# Use is subject to license terms.
26# Copyright (c) 2020 by vStack. All rights reserved.
27#
28
29. $STF_SUITE/include/libtest.shlib
30
31#
32# DESCRIPTION:
33#	Call the raidz_test tool with sweep to test all supported raidz
34#	implementations. This will test several raidz block geometries
35#	and several zio parameters that affect raidz block layout. Data
36#	reconstruction performs all combinations of failed disks. Wall
37#	time is set to 5 min, but actual runtime might be longer.
38#
39
40case $((RANDOM % 3)) in
41	0)
42		# Basic sweep test
43		log_must raidz_test -S -t 300
44		log_pass "raidz_test parameter sweep test succeeded."
45		;;
46	1)
47		# Using expanded raidz map to test all supported raidz
48		# implementations with expanded map and default reflow offset.
49		log_must raidz_test -S -e -t 300
50		log_pass "raidz_test sweep test with expanded map succeeded."
51		;;
52	2)
53		# Using expanded raidz map ('-e') to test all supported raidz
54		# implementations with expanded map and zero reflow offset.
55		log_must raidz_test -S -e -r 0 -t 300
56		log_pass "raidz_test sweep test with expanded map succeeded."
57		;;
58	*)
59		# avoid shellcheck SC2249
60		;;
61esac
62