xref: /freebsd/sys/contrib/openzfs/tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh (revision 61145dc2b94f12f6a47344fb9aac702321880e43)
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) 2016 by Gvozden Neskovic. All rights reserved.
26# Use is subject to license terms.
27# Copyright (c) 2020 by vStack. All rights reserved.
28#
29
30. $STF_SUITE/include/libtest.shlib
31
32#
33# DESCRIPTION:
34#	Call the raidz_test tool with sweep to test all supported raidz
35#	implementations. This will test several raidz block geometries
36#	and several zio parameters that affect raidz block layout. Data
37#	reconstruction performs all combinations of failed disks. Wall
38#	time is set to 5 min, but actual runtime might be longer.
39#
40
41case $((RANDOM % 3)) in
42	0)
43		# Basic sweep test
44		log_must raidz_test -S -t 300
45		log_pass "raidz_test parameter sweep test succeeded."
46		;;
47	1)
48		# Using expanded raidz map to test all supported raidz
49		# implementations with expanded map and default reflow offset.
50		log_must raidz_test -S -e -t 300
51		log_pass "raidz_test sweep test with expanded map succeeded."
52		;;
53	2)
54		# Using expanded raidz map ('-e') to test all supported raidz
55		# implementations with expanded map and zero reflow offset.
56		log_must raidz_test -S -e -r 0 -t 300
57		log_pass "raidz_test sweep test with expanded map succeeded."
58		;;
59	*)
60		# avoid shellcheck SC2249
61		;;
62esac
63