From owner-svn-src-projects@freebsd.org Mon Sep 11 15:33:42 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18FC3E122F4 for ; Mon, 11 Sep 2017 15:33:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id E911F65753; Mon, 11 Sep 2017 15:33:41 +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 v8BFXfGI097408; Mon, 11 Sep 2017 15:33:41 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8BFXf2p097406; Mon, 11 Sep 2017 15:33:41 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201709111533.v8BFXf2p097406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 11 Sep 2017 15:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r323441 - projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare X-SVN-Commit-Revision: 323441 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.23 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: Mon, 11 Sep 2017 15:33:42 -0000 Author: asomers Date: Mon Sep 11 15:33:40 2017 New Revision: 323441 URL: https://svnweb.freebsd.org/changeset/base/323441 Log: Fix hotspare_onoffline_003_neg from the ZFS test suite tests/sys/cddl/zfs/tests/hotspare/hotspare_onoffline_003_neg.ksh tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh Fix hotspare_onoffline_003_neg by simplifying it. It originally tested that "zpool (on|off)line" wouldn't work on spares, but failed because those commands _do_ work on active spares. AFAICT they always have on both Illumos and FreeBSD. The documentation isn't 100% clear, but the justification for preventing them from working on inactive spares seems to be that those devices don't have any I/O to stop. That justification doesn't make sense for active spares. So it's reasonable to allow active spares to be offlined or onlined. Sponsored by: Spectra Logic Corp Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_onoffline_003_neg.ksh projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_onoffline_003_neg.ksh ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_onoffline_003_neg.ksh Mon Sep 11 15:31:29 2017 (r323440) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_onoffline_003_neg.ksh Mon Sep 11 15:33:40 2017 (r323441) @@ -78,24 +78,9 @@ function verify_assertion # dev log_mustnot $ZPOOL online $TESTPOOL $dev log_must check_hotspare_state $TESTPOOL $dev "AVAIL" - - log_must $ZPOOL replace $TESTPOOL $odev $dev - while check_state "$TESTPOOL" "replacing" \ - "online" || \ - ! is_pool_resilvered $TESTPOOL ; do - $SLEEP 2 - done - - log_mustnot $ZPOOL offline $TESTPOOL $dev - log_must check_state $TESTPOOL $dev "online" - - log_mustnot $ZPOOL online $TESTPOOL $dev - log_must check_state $TESTPOOL $dev "online" - - log_must $ZPOOL detach $TESTPOOL $dev } -log_assert "'zpool offline/online ' against a hot spare works as expect." +log_assert "'zpool offline/online ' should fail on inactive spares" log_onexit cleanup Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh Mon Sep 11 15:31:29 2017 (r323440) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh Mon Sep 11 15:33:40 2017 (r323441) @@ -392,13 +392,12 @@ hotspare_import_001_pos_cleanup() atf_test_case hotspare_onoffline_003_neg cleanup hotspare_onoffline_003_neg_head() { - atf_set "descr" "'zpool offline/online ' against a hot spare works as expect." + atf_set "descr" "'zpool offline/online ' should fail on inactive spares" atf_set "require.progs" zpool zdb atf_set "timeout" 3600 } hotspare_onoffline_003_neg_body() { - atf_expect_fail "This testcase has always failed on FreeBSD" . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg