Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Sep 2017 15:33:41 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r323441 - projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare
Message-ID:  <201709111533.v8BFXf2p097406@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <pool> <vdev>' against a hot spare works as expect."
+log_assert "'zpool offline/online <pool> <vdev>' 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 <pool> <vdev>' against a hot spare works as expect."
+	atf_set "descr" "'zpool offline/online <pool> <vdev>' 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709111533.v8BFXf2p097406>