mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-21 18:26:47 +03:00
Added auto-replace FMA test for the ZFS Test Suite
Also included are updates to auto-online test Automated auto-replace test to go along with ZED FMA integration (PR 4673) auto-replace_001.pos works using a scsi_debug device (the only usable virtual device currently due to whole_disk var needing to be set) Functionality for automated FMA auto-replace test to work with scsi_debug devs: Some functionality/exceptions needed to be added for automation of auto-replace to work correctly. In the test an alias vdev_id rule is added for any scsi_debug device which sets the phys_path="scsidebug" after a udevadm trigger command. A symlink is created for the vdev_id.conf file (in /etc/zfs/ by default) to be used in-tree for the test suite (/var/tmp/zfs/vdev_id.conf). "./scripts/zfs-helpers.sh -i" needs to be run before fault tests in the ZTS (to use udev rules in-tree) Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Don Brady <don.brady@intel.com> Reviewed-by: David Quigley <david.quigley@intel.com> Signed-off-by: Sydney Vanda <sydney.m.vanda@intel.com> Closes #5944
This commit is contained in:
committed by
Brian Behlendorf
parent
6ba1ce9ee9
commit
7a4500a101
@@ -22,7 +22,7 @@
|
||||
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2016, Intel Corporation.
|
||||
* Copyright (c) 2016, 2017, Intel Corporation.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -89,6 +89,7 @@
|
||||
|
||||
#define DEV_BYID_PATH "/dev/disk/by-id/"
|
||||
#define DEV_BYPATH_PATH "/dev/disk/by-path/"
|
||||
#define DEV_BYVDEV_PATH "/dev/disk/by-vdev/"
|
||||
|
||||
typedef void (*zfs_process_func_t)(zpool_handle_t *, nvlist_t *, boolean_t);
|
||||
|
||||
@@ -190,6 +191,7 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
|
||||
char devpath[PATH_MAX];
|
||||
int ret;
|
||||
int is_dm = 0;
|
||||
int is_sd = 0;
|
||||
uint_t c;
|
||||
vdev_stat_t *vs;
|
||||
|
||||
@@ -258,6 +260,13 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* vdev_id alias rule for using scsi_debug devices (FMA automated
|
||||
* testing)
|
||||
*/
|
||||
if (strcmp("scsidebug", physpath) == 0)
|
||||
is_sd = 1;
|
||||
|
||||
/*
|
||||
* If the pool doesn't have the autoreplace property set, then use
|
||||
* vdev online to trigger a FMA fault by posting an ereport.
|
||||
@@ -272,10 +281,13 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
|
||||
}
|
||||
|
||||
/*
|
||||
* convert physical path into its current device node
|
||||
* Convert physical path into its current device node. Rawpath
|
||||
* needs to be /dev/disk/by-vdev for a scsi_debug device since
|
||||
* /dev/disk/by-path will not be present.
|
||||
*/
|
||||
(void) snprintf(rawpath, sizeof (rawpath), "%s%s", DEV_BYPATH_PATH,
|
||||
physpath);
|
||||
(void) snprintf(rawpath, sizeof (rawpath), "%s%s",
|
||||
is_sd ? DEV_BYVDEV_PATH : DEV_BYPATH_PATH, physpath);
|
||||
|
||||
if (realpath(rawpath, devpath) == NULL && !is_dm) {
|
||||
zed_log_msg(LOG_INFO, " realpath: %s failed (%s)",
|
||||
rawpath, strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user