From owner-svn-src-projects@freebsd.org Thu Feb 8 21:06:31 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 975E8F048D8 for ; Thu, 8 Feb 2018 21:06:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49E0A7D99C; Thu, 8 Feb 2018 21:06:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44A8F1B5C7; Thu, 8 Feb 2018 21:06:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18L6Vj9057970; Thu, 8 Feb 2018 21:06:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18L6UG8057968; Thu, 8 Feb 2018 21:06:30 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802082106.w18L6UG8057968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 8 Feb 2018 21:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r329032 - in projects/zfsd/head/tests/sys/cddl/zfs: include tests/zfsd X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/zfsd/head/tests/sys/cddl/zfs: include tests/zfsd X-SVN-Commit-Revision: 329032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Feb 2018 21:06:31 -0000 Author: asomers Date: Thu Feb 8 21:06:30 2018 New Revision: 329032 URL: https://svnweb.freebsd.org/changeset/base/329032 Log: Finish removing SAS phy control from the ZFS test suite SAS phy control is only available on systems with SAS expanders, never available in a VM, and less reliable than simulating disk removal with gnop tests/sys/cddl/zfs/include/Makefile tests/sys/cddl/zfs/include/libsas.kshlib Delete libsas.kshlib tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib Delete some sas-related library functions Sponsored by: Spectra Logic Corp Deleted: projects/zfsd/head/tests/sys/cddl/zfs/include/libsas.kshlib Modified: projects/zfsd/head/tests/sys/cddl/zfs/include/Makefile projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib Modified: projects/zfsd/head/tests/sys/cddl/zfs/include/Makefile ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/include/Makefile Thu Feb 8 21:03:46 2018 (r329031) +++ projects/zfsd/head/tests/sys/cddl/zfs/include/Makefile Thu Feb 8 21:06:30 2018 (r329032) @@ -12,7 +12,6 @@ MAN= FILESDIR= ${TESTSBASE}/sys/cddl/zfs/include ${PACKAGE}FILES+= constants.cfg ${PACKAGE}FILES+= libremote.kshlib -${PACKAGE}FILES+= libsas.kshlib ${PACKAGE}FILES+= libgnop.kshlib ${PACKAGE}FILES+= logapi.kshlib ${PACKAGE}FILES+= libtest.kshlib Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib Thu Feb 8 21:03:46 2018 (r329031) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib Thu Feb 8 21:06:30 2018 (r329032) @@ -80,83 +80,3 @@ function corrupt_pool_vdev # errors (though it's usually faster). wait_for_pool_dev_state_change 60 $vdev DEGRADED } - -# -# do_autoreplace -# Common code that walks through an autoreplace scenario -# Does not verify the final behavior -# -# $1 spare disk name. Empty if no spare -# -function do_autoreplace -{ - typeset SPARE_DISK=$1 - - # Remove a vdev by disabling its SAS phy - find_verify_sas_disk $REMOVAL_DISK - log_note "Disabling \"$REMOVAL_DISK\" on expander $EXPANDER phy $PHY" - disable_sas_disk $EXPANDER $PHY $REMOVAL_DISK - - # Check to make sure ZFS sees the disk as removed - wait_for_pool_removal 30 - - if [ -n "$SPARE_DISK" ]; then - # Verify that the spare activates - for ((timeout=0; $timeout<10; timeout=$timeout+1)); do - check_state $TESTPOOL $SPARE_DISK "ONLINE" && break - $SLEEP 6 - done - zpool status $TESTPOOL - log_must check_state $TESTPOOL "$SPARE_DISK" "ONLINE" - - wait_until_resilvered - fi - - # Export the pool - # This is to prevent REMOVAL_DISK from being added to the pool when - # we reenable its phy - log_must $ZPOOL export $TESTPOOL - - # Reenable the missing dev's SAS phy - log_note "Reenabling phy on expander $EXPANDER phy $PHY" - enable_sas_disk $EXPANDER $PHY - - # Erase the missing dev's ZFS label - log_must $ZPOOL labelclear -f $( find_disks $FOUNDDISK ) - - # Disable the missing dev's SAS phy again - find_verify_sas_disk $FOUNDDISK - log_note "Disabling \"$FOUNDDISK\" on expander $EXPANDER phy $PHY" - disable_sas_disk $EXPANDER $PHY $FOUNDDISK - - # Import the pool - log_must $ZPOOL import $TESTPOOL - # Wait 5 seconds before enabling the phy so zfsd.log will be easier - # to interpret - $SLEEP 5 - - # Reenable the missing dev's SAS phy - log_note "Reenabling phy on expander $EXPANDER phy $PHY" - enable_sas_disk $EXPANDER $PHY -} - -function autoreplace_cleanup -{ - destroy_pool $TESTPOOL - - # See if the phy has been disabled, and try to re-enable it if possible. - if [ -n "$REMOVAL_DISK" -a -n "$EXPANDER" -a -n "$PHY" ]; then - log_note "Renabling ${EXPANDER}:${PHY} for disk ${REMOVAL_DISK}" - enable_sas_disk $EXPANDER $PHY - - # For debugging purposes, log the partial output of - # camcontrol to see if the disk actually came back. - out=$(camcontrol smpphylist ${EXPANDER} | ${GREP} "^ *${PHY}") - log_note "Expander has: ${out}" - fi - - [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/* - - partition_cleanup - restart_zfsd -}