forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jason Lee <[email protected]>
- Loading branch information
1 parent
d9a8047
commit 9e6d6bd
Showing
10 changed files
with
404 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/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 https://opensource.org/licenses/CDDL-1.0. | ||
# 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 (c) 2022-2024 by Triad National Security, LCC | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
. $STF_SUITE/tests/functional/zia/zia.kshlib | ||
|
||
verify_runnable "global" | ||
|
||
lsmod | grep dpusm > /dev/null | ||
ret="$?" | ||
(( "${ret}" != "0" )) && log_unsupported "dpusm not loaded" | ||
|
||
log_must unload_provider | ||
default_cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/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 https://opensource.org/licenses/CDDL-1.0. | ||
# 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 (c) 2022-2024 by Triad National Security, LCC | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
. $STF_SUITE/tests/functional/zia/zia.kshlib | ||
verify_runnable "global" | ||
|
||
# dpusm needs to be loaded before ZFS | ||
lsmod | grep dpusm > /dev/null | ||
ret="$?" | ||
(( "${ret}" != "0" )) && log_unsupported "dpusm not loaded" | ||
|
||
# unload the software provider if the test starts with it loaded | ||
lsmod | grep "${PROVIDER_MODULE}" > /dev/null | ||
ret="$?" | ||
(( "${ret}" == "0" )) && log_must rmmod "${PROVIDER_MODULE}" | ||
|
||
log_must default_zpool | ||
log_must load_provider | ||
|
||
log_pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# | ||
# 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 https://opensource.org/licenses/CDDL-1.0. | ||
# 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 (c) 2022-2024 by Triad National Security, LCC | ||
# | ||
|
||
export PROVIDER_MODULE="zia_software_provider" | ||
export PROVIDER="zia-software-provider" | ||
export BLOCKSZ=8192 | ||
export NUM_WRITES=65536 | ||
export DATA="R" | ||
export FILENAME="${TESTDIR}/file" | ||
export RESILVER_REPLACEMENT="${TEST_BASE_DIR}/replacement" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#!/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 https://opensource.org/licenses/CDDL-1.0. | ||
# 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 (c) 2023, 2024 by Triad National Security, LCC | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
. $STF_SUITE/tests/functional/redundancy/redundancy.kshlib | ||
. $STF_SUITE/tests/functional/zia/zia.cfg | ||
|
||
function default_zpool | ||
{ | ||
default_raidz_setup_noexit "${DISKS}" | ||
log_must zfs set compression=on "${TESTPOOL}" | ||
log_must zfs set checksum=on "${TESTPOOL}" | ||
} | ||
|
||
# providers can be loaded at any time after the dpusm | ||
# | ||
# the software provider must be loaded after ZFS since | ||
# it uses ZFS symbols | ||
function load_provider | ||
{ | ||
log_must insmod "${SBIN_DIR}/module/${PROVIDER}.ko" | ||
log_must zpool set zia_provider="${PROVIDER}" "${TESTPOOL}" | ||
} | ||
|
||
function unload_provider | ||
{ | ||
log_must zpool set zia_provider="" "${TESTPOOL}" | ||
log_must rmmod "${PROVIDER_MODULE}" | ||
} | ||
|
||
function offload_all | ||
{ | ||
log_must zpool set zia_compress="on" "${TESTPOOL}" | ||
log_must zpool set zia_checksum="on" "${TESTPOOL}" | ||
log_must zpool set zia_raidz1_gen="on" "${TESTPOOL}" | ||
log_must zpool set zia_raidz2_gen="on" "${TESTPOOL}" | ||
log_must zpool set zia_raidz3_gen="on" "${TESTPOOL}" | ||
log_must zpool set zia_raidz1_rec="on" "${TESTPOOL}" | ||
log_must zpool set zia_raidz2_rec="on" "${TESTPOOL}" | ||
log_must zpool set zia_raidz3_rec="on" "${TESTPOOL}" | ||
log_must zpool set zia_disk_write="on" "${TESTPOOL}" | ||
log_must zpool set zia_file_write="on" "${TESTPOOL}" | ||
} | ||
|
||
# | ||
# loop through each combination of Z.I.A. offloads | ||
# and make sure writing works | ||
# | ||
function loop_offloads_and_write | ||
{ | ||
for comp in on off | ||
do | ||
log_must zpool set zia_compress="${comp}" "${TESTPOOL}" | ||
|
||
for cksum in on off | ||
do | ||
log_must zpool set zia_checksum="${cksum}" "${TESTPOOL}" | ||
|
||
for raidz in on off | ||
do | ||
log_must zpool set zia_raidz1_gen="${raidz}" "${TESTPOOL}" | ||
log_must zpool set zia_raidz2_gen="${raidz}" "${TESTPOOL}" | ||
log_must zpool set zia_raidz3_gen="${raidz}" "${TESTPOOL}" | ||
|
||
for diskfile in on off | ||
do | ||
log_must zpool set zia_disk_write="${diskfile}" "${TESTPOOL}" | ||
log_must zpool set zia_file_write="${diskfile}" "${TESTPOOL}" | ||
|
||
log_must file_write -o create -f "${FILENAME}" -b "${BLOCKSZ}" -c "${NUM_WRITES}" -d "${DATA}" | ||
log_must ls -l "${FILENAME}" | ||
log_must verify_pool "${TESTPOOL}" | ||
log_must check_pool_status "${TESTPOOL}" "errors" "No known data errors" | ||
log_must rm "${FILENAME}" | ||
done | ||
done | ||
done | ||
done | ||
} | ||
|
||
# copied from default_raidz_setup_noexit | ||
function random_disk | ||
{ | ||
typeset disklist="$*" | ||
disks=(${disklist[*]}) | ||
count="${#disks[*]}" | ||
idx="$(($(random 1 ${count}) - 1))" | ||
echo "${disks[${idx}]}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/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 https://opensource.org/licenses/CDDL-1.0. | ||
# 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 (c) 2023, 2024 by Triad National Security, LCC | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
. $STF_SUITE/tests/functional/zia/zia.kshlib | ||
|
||
# | ||
# DESCRIPTION: | ||
# Z.I.A. zpool settings work | ||
# | ||
# STRATEGY: | ||
# 1. Turn on all offloads | ||
# 2. Run zpool get on each property | ||
# | ||
|
||
log_must offload_all | ||
|
||
log_must zpool get zia_provider "${TESTPOOL}" | ||
log_must zpool get zia_compress "${TESTPOOL}" | ||
log_must zpool get zia_checksum "${TESTPOOL}" | ||
log_must zpool get zia_raidz1_gen "${TESTPOOL}" | ||
log_must zpool get zia_raidz2_gen "${TESTPOOL}" | ||
log_must zpool get zia_raidz3_gen "${TESTPOOL}" | ||
log_must zpool get zia_raidz1_rec "${TESTPOOL}" | ||
log_must zpool get zia_raidz2_rec "${TESTPOOL}" | ||
log_must zpool get zia_raidz3_rec "${TESTPOOL}" | ||
log_must zpool get zia_disk_write "${TESTPOOL}" | ||
log_must zpool get zia_file_write "${TESTPOOL}" | ||
|
||
log_pass |
65 changes: 65 additions & 0 deletions
65
tests/zfs-tests/tests/functional/zia/zia_raidz_resilver.ksh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/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 https://opensource.org/licenses/CDDL-1.0. | ||
# 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 (c) 2022-2024 by Triad National Security, LCC | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
. $STF_SUITE/tests/functional/zia/zia.kshlib | ||
|
||
# | ||
# DESCRIPTION: | ||
# Z.I.A. RAIDZ Resilver works | ||
# | ||
# STRATEGY: | ||
# 1. Turn on all offloads | ||
# 2. Write data to the zpool | ||
# 3. Replace a drive | ||
# 4. Resilver the zpool with Z.I.A. | ||
# 5. Check for errors | ||
# | ||
|
||
log_must truncate -s 4G "${RESILVER_REPLACEMENT}" | ||
|
||
function cleanup | ||
{ | ||
log_must rm "${RESILVER_REPLACEMENT}" | ||
} | ||
log_onexit cleanup | ||
|
||
log_must offload_all | ||
|
||
# write a file | ||
log_must file_write -o create -f "${FILENAME}" -b "${BLOCKSZ}" -c "${NUM_WRITES}" -d "${DATA}" | ||
log_must ls -l "${FILENAME}" | ||
|
||
# pick a random backing device to offline and replace it | ||
bad="$(random_disk ${DISKS})" | ||
log_must zpool offline "${TESTPOOL}" "${bad}" | ||
log_must zpool replace "${TESTPOOL}" "${bad}" "${RESILVER_REPLACEMENT}" | ||
log_must wait_replacing "${TESTPOOL}" | ||
|
||
log_must verify_pool "${TESTPOOL}" | ||
log_must check_pool_status "${TESTPOOL}" "errors" "No known data errors" | ||
|
||
log_pass |
Oops, something went wrong.