Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify ZED detects physically removed L2ARC device
This commit adds a new test case to the ZFS Test Suite to verify ZED can detect when a cache device is physically removed from a running system. Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Requires-builders: test
- Loading branch information
Showing
9 changed files
with
201 additions
and
17 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
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,16 @@ | ||
[DEFAULT] | ||
pre = setup | ||
quiet = False | ||
pre_user = root | ||
user = root | ||
timeout = 600 | ||
post_user = root | ||
post = cleanup | ||
outputdir = /var/tmp/test_results | ||
|
||
[tests/functional/fault] | ||
tests = ['auto_offline_001_pos', 'auto_offline_001_pos', 'auto_offline_001_pos', | ||
'auto_offline_001_pos', 'auto_offline_001_pos', 'auto_offline_001_pos', | ||
'auto_offline_001_pos', 'auto_offline_001_pos', 'auto_offline_001_pos'] | ||
tags = ['functional'] | ||
|
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
77 changes: 77 additions & 0 deletions
77
tests/zfs-tests/tests/functional/fault/auto_offline_001_pos.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,77 @@ | ||
#!/bin/ksh -p | ||
# | ||
# CDDL HEADER START | ||
# | ||
# This file and its contents are supplied under the terms of the | ||
# Common Development and Distribution License ("CDDL"), version 1.0. | ||
# You may only use this file in accordance with the terms of version | ||
# 1.0 of the CDDL. | ||
# | ||
# A full copy of the text of the CDDL should have accompanied this | ||
# source. A copy of the CDDL is also available via the Internet at | ||
# http://www.illumos.org/license/CDDL. | ||
# | ||
# CDDL HEADER END | ||
# | ||
|
||
# | ||
# Copyright (c) 2017 by Intel Corporation. All rights reserved. | ||
# Copyright 2018, loli10K <ezomori.nozomu@gmail.com>. All rights reserved. | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
. $STF_SUITE/tests/functional/fault/fault.cfg | ||
|
||
# | ||
# DESCRIPTION: | ||
# Testing Fault Management Agent ZED Logic - Physically removed L2ARC device | ||
# is offlined | ||
# | ||
# STRATEGY: | ||
# 1. Create a pool with a L2ARC device | ||
# 2. Simulate physical removal of L2ARC device | ||
# 3. Verify the device is offlined | ||
# | ||
verify_runnable "both" | ||
|
||
if is_linux; then | ||
load_scsi_debug $SDSIZE $SDHOSTS $SDTGTS $SDLUNS '512b' | ||
else | ||
log_unsupported "scsi debug module unsupported" | ||
fi | ||
|
||
function cleanup | ||
{ | ||
destroy_pool $TESTPOOL | ||
rm -f $FILE_DEVICE | ||
unload_scsi_debug | ||
} | ||
|
||
log_assert "ZED detects physically removed L2ARC device" | ||
|
||
log_onexit cleanup | ||
|
||
FILE_DEVICE="$TEST_BASE_DIR/file-vdev" | ||
L2ARC_DEVICE=$(get_debug_device) | ||
|
||
# 1. Create a pool with a L2ARC device | ||
truncate -s $SPA_MINDEVSIZE $FILE_DEVICE | ||
log_must zpool create $TESTPOOL $FILE_DEVICE cache $L2ARC_DEVICE | ||
|
||
# 2. Simulate physical removal of L2ARC device | ||
remove_disk $L2ARC_DEVICE | ||
|
||
# 3. Verify the device is offlined | ||
#log_must wait_vdev_state $TESTPOOL $L2ARC_DEVICE "OFFLINE" | ||
wait_vdev_state $TESTPOOL $L2ARC_DEVICE "OFFLINE" | ||
ret=$? | ||
if [[ $ret != 0 ]]; then | ||
zpool status | ||
zpool status -g | ||
zpool status -LP | ||
cat $ZED_LOG | ||
truncate -s 0 $ZED_LOG | ||
log_fail "" | ||
fi | ||
|
||
log_pass "ZED detects physically removed L2ARC device" |