From owner-svn-src-projects@freebsd.org Thu Feb 8 20:25:53 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 AD3EDF019AB for ; Thu, 8 Feb 2018 20:25:53 +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 5EE5A7B961; Thu, 8 Feb 2018 20:25:53 +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 59C0B1AEF5; Thu, 8 Feb 2018 20:25:53 +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 w18KPrdg034848; Thu, 8 Feb 2018 20:25:53 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18KPrxn034846; Thu, 8 Feb 2018 20:25:53 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802082025.w18KPrxn034846@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 20:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r329028 - projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd X-SVN-Commit-Revision: 329028 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 20:25:53 -0000 Author: asomers Date: Thu Feb 8 20:25:52 2018 New Revision: 329028 URL: https://svnweb.freebsd.org/changeset/base/329028 Log: WIP removing SAS phy control from the ZFS test suite Convert zfsd_replace_001_pos to use libgnop tests/sys/cddl/zfs/tests/zfsd/zfsd_replace_001_pos.ksh tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh * Simulate disk failures with gnop, not SAS phy control * Fix the log_assert message * Reduce the disk count to 3 * Reduce the runtime by removing excessive I/O Sponsored by: Spectra Logic Corp Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_replace_001_pos.ksh projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_replace_001_pos.ksh ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_replace_001_pos.ksh Thu Feb 8 20:24:54 2018 (r329027) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_replace_001_pos.ksh Thu Feb 8 20:25:52 2018 (r329028) @@ -35,48 +35,42 @@ . $STF_SUITE/tests/hotspare/hotspare.kshlib . $STF_SUITE/tests/zfsd/zfsd.kshlib . $STF_SUITE/include/libtest.kshlib -. $STF_SUITE/include/libsas.kshlib +. $STF_SUITE/include/libgnop.kshlib -verify_runnable "global" +log_assert "ZFSD will automatically replace a SAS disk that dissapears and reappears in the same location, with the same devname" -log_assert "Failing a disk from a SAS expander is recognized by ZFS" - -log_onexit autoreplace_cleanup ensure_zfsd_running -child_pids="" +set_disks -set -A TMPDISKS $DISKS -typeset REMOVAL_DISK=${TMPDISKS[0]} -REMOVAL_DISK=${REMOVAL_DISK##*/} +typeset REMOVAL_DISK=$DISK0 +typeset REMOVAL_NOP=${DISK0}.nop +typeset OTHER_DISKS="${DISK1} ${DISK2}" +typeset ALLDISKS="${DISK0} ${DISK1} ${DISK2}" +typeset ALLNOPS=${ALLDISKS//~(E)([[:space:]]+|$)/.nop\1} +log_must create_gnops $ALLDISKS for type in "raidz" "mirror"; do # Create a pool on the supplied disks - create_pool $TESTPOOL $type $DISKS + create_pool $TESTPOOL $type $ALLNOPS log_must $ZFS create $TESTPOOL/$TESTFS log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS - # Find the first disk, get the expander and phy - log_note "Looking for expander and phy information for $REMOVAL_DISK" - find_verify_sas_disk $REMOVAL_DISK + # Disable the first disk. + log_must destroy_gnop $REMOVAL_DISK - log_note "Disabling \"$REMOVAL_DISK\" on expander $EXPANDER phy $PHY" - # Disable the first disk. We have to do this first, because if - # there is I/O active to the - disable_sas_disk $EXPANDER $PHY - # Write out data to make sure we can do I/O after the disk failure - log_must $DD if=/dev/zero of=$TESTDIR/$TESTFILE bs=1m count=512 + log_must $DD if=/dev/zero of=$TESTDIR/$TESTFILE bs=1m count=1 + log_must $FSYNC $TESTDIR/$TESTFILE # Check to make sure ZFS sees the disk as removed - wait_for_pool_removal 20 + wait_for_pool_dev_state_change 20 $REMOVAL_NOP REMOVED - # Re-enable the disk, we don't want to leave it turned off - log_note "Re-enabling phy $PHY on expander $EXPANDER" - enable_sas_disk $EXPANDER $PHY + # Re-enable the disk + log_must create_gnop $REMOVAL_DISK # Disk should auto-join the zpool & be resilvered. - wait_for_pool_dev_state_change 20 $REMOVAL_DISK ONLINE + wait_for_pool_dev_state_change 20 $REMOVAL_NOP ONLINE wait_until_resilvered $ZPOOL status $TESTPOOL Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh Thu Feb 8 20:24:54 2018 (r329027) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh Thu Feb 8 20:25:52 2018 (r329028) @@ -449,7 +449,7 @@ zfsd_replace_001_pos_body() . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg - verify_disk_count "$DISKS" 2 + verify_disk_count "$DISKS" 3 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_replace_001_pos.ksh if [[ $? != 0 ]]; then