Skip to content

Commit

Permalink
Add raidz_test to the ZFS Test Suite
Browse files Browse the repository at this point in the history
raidz sweep test is running for 300s
Each configuration runs in a separate thread (one running thread per CPU core)
  • Loading branch information
ironMann committed Apr 26, 2016
1 parent e14c4fa commit d57f5a0
Show file tree
Hide file tree
Showing 10 changed files with 172 additions and 2 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ AC_CONFIG_FILES([
tests/zfs-tests/tests/functional/poolversion/Makefile
tests/zfs-tests/tests/functional/privilege/Makefile
tests/zfs-tests/tests/functional/quota/Makefile
tests/zfs-tests/tests/functional/raidz/Makefile
tests/zfs-tests/tests/functional/redundancy/Makefile
tests/zfs-tests/tests/functional/refquota/Makefile
tests/zfs-tests/tests/functional/refreserv/Makefile
Expand Down
7 changes: 5 additions & 2 deletions tests/runfiles/linux.run
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ tests = ['zpool_clear_001_pos', 'zpool_clear_002_neg', 'zpool_clear_003_neg']
# zpool_create_020_pos - needs investigation
[tests/functional/cli_root/zpool_create]
tests = [
'zpool_create_003_pos', 'zpool_create_005_pos', 'zpool_create_007_neg',
'zpool_create_003_pos', 'zpool_create_005_pos', 'zpool_create_007_neg',
'zpool_create_009_neg', 'zpool_create_010_neg', 'zpool_create_017_neg',
'zpool_create_018_pos', 'zpool_create_019_pos',
'zpool_create_021_pos', 'zpool_create_022_pos', 'zpool_create_023_neg',
Expand Down Expand Up @@ -507,12 +507,15 @@ tests = ['poolversion_001_pos', 'poolversion_002_pos']
#tests = ['privilege_001_pos', 'privilege_002_pos']

# DISABLED:
# quota_002_pos - size is less than current used or reserved space
# quota_002_pos - size is less than current used or reserved space
# quota_004_pos - size is less than current used or reserved space
# quota_005_pos - size is less than current used or reserved space
[tests/functional/quota]
tests = ['quota_001_pos', 'quota_003_pos', 'quota_006_neg']

[tests/functional/raidz]
tests = ['raidz_001_neg', 'raidz_002_pos']

[tests/functional/redundancy]
tests = ['redundancy_001_pos', 'redundancy_002_pos', 'redundancy_003_pos']

Expand Down
1 change: 1 addition & 0 deletions tests/zfs-tests/include/default.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export ZINJECT=${ZINJECT:-${sbindir}/zinject}
export ZPOOL=${ZPOOL:-${sbindir}/zpool}
export ZTEST=${ZTEST:-${sbindir}/ztest}
export ZPIOS=${ZPIOS:-${sbindir}/zpios}
export RAIDZ_TEST=${RAIDZ_TEST:-${bindir}/raidz_test}

. $STF_SUITE/include/libtest.shlib

Expand Down
1 change: 1 addition & 0 deletions tests/zfs-tests/tests/functional/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ SUBDIRS = \
poolversion \
privilege \
quota \
raidz \
redundancy \
refquota \
refreserv \
Expand Down
6 changes: 6 additions & 0 deletions tests/zfs-tests/tests/functional/raidz/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/raidz
dist_pkgdata_SCRIPTS = \
setup.ksh \
cleanup.ksh \
raidz_001_neg.ksh \
raidz_002_pos.ksh
34 changes: 34 additions & 0 deletions tests/zfs-tests/tests/functional/raidz/cleanup.ksh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/ksh -p
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#

#
# Copyright (c) 2016 by Gvozden Neskovic. All rights reserved.
#

. $STF_SUITE/include/libtest.shlib

default_cleanup
42 changes: 42 additions & 0 deletions tests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/ksh -p
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#

#
# Copyright (c) 2016 by Gvozden Neskovic. All rights reserved.
#

. $STF_SUITE/include/libtest.shlib

#
# DESCRIPTION:
# Call the raidz_test tool with -T options to test the infrastructure.
# This option should make raidz_test to return non 0.
#

log_mustnot $RAIDZ_TEST -T

log_pass "raidz_test detects errors as espected."
45 changes: 45 additions & 0 deletions tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/ksh -p
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#

#
# Copyright (c) 2016 by Gvozden Neskovic. All rights reserved.
#

. $STF_SUITE/include/libtest.shlib

#
# DESCRIPTION:
# Call the raidz_test tool with -S to test all supported raidz
# implementations. This options will test several raidz block geometries
# and several zio parameters that affect raidz block layout. Data
# reconstruction performs all combinations of failed disks. Wall time
# is set to 5min, but actual runtime might be longer.
#

log_must $RAIDZ_TEST -S -t 300

log_pass "raidz_test parameter sweep test succeeded."
36 changes: 36 additions & 0 deletions tests/zfs-tests/tests/functional/raidz/setup.ksh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/ksh -p
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#

#
# Copyright (c) 2016 by Gvozden Neskovic. All rights reserved.
#

. $STF_SUITE/include/libtest.shlib

verify_runnable "global"

log_pass
1 change: 1 addition & 0 deletions zfs-script-config.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export ZINJECT=${CMDDIR}/zinject/zinject
export ZPOOL=${CMDDIR}/zpool/zpool
export ZTEST=${CMDDIR}/ztest/ztest
export ZPIOS=${CMDDIR}/zpios/zpios
export RAIDZ_TEST=${CMDDIR}/raidz_test/raidz_test}

export COMMON_SH=${SCRIPTDIR}/common.sh
export ZFS_SH=${SCRIPTDIR}/zfs.sh
Expand Down

0 comments on commit d57f5a0

Please sign in to comment.