svn commit: r292354 - in projects/zfsd/head/tests/sys/cddl/zfs: bin include tests/cli_root/zpool_clear tests/hotspare

Alan Somers asomers at FreeBSD.org
Wed Dec 16 19:35:00 UTC 2015


Author: asomers
Date: Wed Dec 16 19:34:58 2015
New Revision: 292354
URL: https://svnweb.freebsd.org/changeset/base/292354

Log:
  Misc improvements to the ZFS test suite
  
  zfs/tests/cli_root/zpool_clear/zpool_clear_001_pos.ksh
  	Make the outlines of some parts of this test more obvious.
  
  zfs/include/libtest.kshlib
  zfs/tests/hotspare/hotspare_detach_001_pos.ksh
  	Simplify test for "did the pool resilver happen?"
  
  zfs/include/Makefile
  	Specify variables with variables, and not immediately after targets.
  
  zfs/bin/Makefile
  	Style: expand variable assignments across multiple lines
  
  Submitted by:	Will
  Sponsored by:	Spectra Logic Corp

Modified:
  projects/zfsd/head/tests/sys/cddl/zfs/bin/Makefile
  projects/zfsd/head/tests/sys/cddl/zfs/include/Makefile
  projects/zfsd/head/tests/sys/cddl/zfs/include/libtest.kshlib
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_001_pos.ksh
  projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_detach_001_pos.ksh

Modified: projects/zfsd/head/tests/sys/cddl/zfs/bin/Makefile
==============================================================================
--- projects/zfsd/head/tests/sys/cddl/zfs/bin/Makefile	Wed Dec 16 19:30:44 2015	(r292353)
+++ projects/zfsd/head/tests/sys/cddl/zfs/bin/Makefile	Wed Dec 16 19:34:58 2015	(r292354)
@@ -6,19 +6,49 @@ MAN=
 BINDIR=	${TESTSBASE}/sys/cddl/zfs/bin
 SCRIPTSDIR=	${TESTSBASE}/sys/cddl/zfs/bin
 
-SCRIPTS+=	bsddisks.ksh df.ksh dircmp.ksh dumpadm.ksh ff.ksh fmadm.ksh
-SCRIPTS+=	fmdump.ksh format.ksh fstyp.ksh groupadd.ksh groupdel.ksh
-SCRIPTS+=	groupmod.ksh groupshow.ksh svcs.ksh swap.ksh useradd.ksh
-SCRIPTS+=	userdel.ksh usermod.ksh zfs.ksh zfs_crypto.ksh
-SCRIPTS+=	zfs_version.ksh zlogin.ksh zoneadm.ksh zonecfg.ksh zpool.ksh
-SCRIPTS+=	zpool_bsd.ksh zpool_smi.ksh zpool_version.ksh
+SCRIPTS+=	bsddisks.ksh
+SCRIPTS+=	df.ksh
+SCRIPTS+=	dircmp.ksh
+SCRIPTS+=	dumpadm.ksh
+SCRIPTS+=	ff.ksh
+SCRIPTS+=	fmadm.ksh
+SCRIPTS+=	fmdump.ksh
+SCRIPTS+=	format.ksh
+SCRIPTS+=	fstyp.ksh
+SCRIPTS+=	groupadd.ksh
+SCRIPTS+=	groupdel.ksh
+SCRIPTS+=	groupmod.ksh
+SCRIPTS+=	groupshow.ksh
+SCRIPTS+=	svcs.ksh
+SCRIPTS+=	swap.ksh
+SCRIPTS+=	useradd.ksh
+SCRIPTS+=	userdel.ksh
+SCRIPTS+=	usermod.ksh
+SCRIPTS+=	zfs.ksh
+SCRIPTS+=	zfs_crypto.ksh
+SCRIPTS+=	zfs_version.ksh
+SCRIPTS+=	zlogin.ksh
+SCRIPTS+=	zoneadm.ksh
+SCRIPTS+=	zonecfg.ksh
+SCRIPTS+=	zpool.ksh
+SCRIPTS+=	zpool_bsd.ksh
+SCRIPTS+=	zpool_smi.ksh
+SCRIPTS+=	zpool_version.ksh
 
-PROGS+=	chg_usr_exec
+PROGS+=		chg_usr_exec
 # Not ported to FreeBSD
-# PROGRS+= devname2devid
-PROGS += dir_rd_update file_check file_trunc
-PROGS+=	file_write largest_file mktree mmapwrite randfree_file readmmap
-PROGS+=	rename_dir rm_lnkcnt_zero_file
+# PROGRS+=	devname2devid
+PROGS+=		dir_rd_update
+PROGS+=		file_check
+PROGS+=		file_trunc
+PROGS+=		file_write
+PROGS+=		largest_file
+PROGS+=		mktree
+PROGS+=		mmapwrite
+PROGS+=		randfree_file
+PROGS+=		readmmap
+PROGS+=		rename_dir
+PROGS+=		rm_lnkcnt_zero_file
 
 .for p in ${PROGS}
 SRCS.$p=	$p.c

Modified: projects/zfsd/head/tests/sys/cddl/zfs/include/Makefile
==============================================================================
--- projects/zfsd/head/tests/sys/cddl/zfs/include/Makefile	Wed Dec 16 19:30:44 2015	(r292353)
+++ projects/zfsd/head/tests/sys/cddl/zfs/include/Makefile	Wed Dec 16 19:34:58 2015	(r292354)
@@ -13,13 +13,13 @@ FILES+=		libtest.kshlib
 FILES+=		stf.shlib
 
 FILES+=		commands.cfg
+CLEANFILES+=	commands.cfg
 commands.cfg:	translatecommands.awk commands.txt
 	awk -v stfsuitedir=${STFSUITEDIR} -f ${.ALLSRC} > ${.TARGET}
-CLEANFILES+=	commands.cfg
 
 FILES+=		default.cfg
+CLEANFILES+=	default.cfg
 default.cfg:	default.cfg.in
 	sed "s:%%STFSUITEDIR%%:${STFSUITEDIR}:" ${.ALLSRC} > ${.TARGET}
-CLEANFILES+=	default.cfg
 
 .include <bsd.prog.mk>

Modified: projects/zfsd/head/tests/sys/cddl/zfs/include/libtest.kshlib
==============================================================================
--- projects/zfsd/head/tests/sys/cddl/zfs/include/libtest.kshlib	Wed Dec 16 19:30:44 2015	(r292353)
+++ projects/zfsd/head/tests/sys/cddl/zfs/include/libtest.kshlib	Wed Dec 16 19:34:58 2015	(r292354)
@@ -1652,6 +1652,12 @@ function is_pool_resilvered #pool
 	return $?
 }
 
+function resilver_happened # pool
+{
+	typeset pool=$1
+	is_pool_resilvering "$pool" || is_pool_resilvered "$pool"
+}
+
 function is_pool_scrubbing #pool
 {
 	check_pool_status "$1" "scan" "scrub in progress"

Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_001_pos.ksh
==============================================================================
--- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_001_pos.ksh	Wed Dec 16 19:30:44 2015	(r292353)
+++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_001_pos.ksh	Wed Dec 16 19:34:58 2015	(r292354)
@@ -147,6 +147,8 @@ function do_testing #<clear type> <vdevs
 	shift
 	typeset vdev="$@"
 
+	log_note "Testing with vdevs ${vdev} ..."
+
 	log_must $ZPOOL create -f $TESTPOOL1 $vdev
 	log_must $ZFS create $FS
 	#
@@ -162,12 +164,12 @@ function do_testing #<clear type> <vdevs
         	(( $ret != 0 )) && break
         	(( i = i + 1 ))
 	done
-	(( $ret != 28 )) && log_fail "$FILE_WRITE fails to fully fill up the $FS." 
+	(( $ret != 28 )) && log_fail "ERROR: $FILE_WRITE failed with error $ret"
+	log_note "$FILE_WRITE has filled up $FS."
 	
 	#
-	#Make errors to the testing pool by overwrite the vdev device with  
-	#/bin/dd command. We donot want to have a full overwrite. That 
-	#may cause the system panic. So, we should skip the vdev label space. 
+	# Make errors to the testing pool by overwrite the vdev device with  
+	# the dd command, taking care to skip the first and last labels.
 	#
 	(( i = $RANDOM % 3 ))
 	typeset -i wcount=0

Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_detach_001_pos.ksh
==============================================================================
--- projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_detach_001_pos.ksh	Wed Dec 16 19:30:44 2015	(r292353)
+++ projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_detach_001_pos.ksh	Wed Dec 16 19:34:58 2015	(r292354)
@@ -79,9 +79,7 @@ function verify_assertion # dev
 	log_must $SYNC
 	log_must $ZPOOL replace $TESTPOOL $odev $dev
 
-	is_pool_resilvering "$TESTPOOL" || is_pool_resilvered "$TESTPOOL"
-	resilver_happened=$?
-	log_must test $resilver_happened -eq 0
+	log_must resilver_happened $TESTPOOL
 	log_must check_hotspare_state "$TESTPOOL" "$dev" "INUSE"
 
 	log_must $ZPOOL detach $TESTPOOL $dev


More information about the svn-src-projects mailing list