Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 2018 17:58:03 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r329235 - projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool
Message-ID:  <201802131758.w1DHw36x008058@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Tue Feb 13 17:58:02 2018
New Revision: 329235
URL: https://svnweb.freebsd.org/changeset/base/329235

Log:
  Eliminate the "is_zfs_root" kyua config variable.
  
  If the user forgets to set it, then certain tests will misbehave.  Better to
  detect a ZFS root filesystem automatically.
  
  tests/sys/cddl/zfs/tests/rootpool/rootpool_test.sh
  	Automatically skip if there's no ZFS root filesystem
  
  Sponsored by:	Spectra Logic Corp

Modified:
  projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_test.sh

Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_test.sh
==============================================================================
--- projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_test.sh	Tue Feb 13 17:56:00 2018	(r329234)
+++ projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_test.sh	Tue Feb 13 17:58:02 2018	(r329235)
@@ -28,12 +28,16 @@ atf_test_case rootpool_001_pos cleanup
 rootpool_001_pos_head()
 {
 	atf_set "descr" "rootpool's bootfs property must be equal to <rootfs>"
-	atf_set "require.config"  is_zfs_root
 }
 rootpool_001_pos_body()
 {
 	. $(atf_get_srcdir)/../../include/default.cfg
 
+	if ! is_zfsroot ; then
+		atf_skip "This test requires a ZFS root filesystem."
+	fi
+
+	ksh93 $(atf_get_srcdir)/setup.ksh
 	ksh93 $(atf_get_srcdir)/rootpool_001_pos.ksh || atf_fail "Testcase failed"
 }
 rootpool_001_pos_cleanup()
@@ -48,13 +52,16 @@ atf_test_case rootpool_002_neg cleanup
 rootpool_002_neg_head()
 {
 	atf_set "descr" "zpool/zfs destory <rootpool> should return error"
-	atf_set "require.config"  is_zfs_root
 	atf_set "require.progs"  zfs zpool
 }
 rootpool_002_neg_body()
 {
 	. $(atf_get_srcdir)/../../include/default.cfg
 
+	if ! is_zfsroot ; then
+		atf_skip "This test requires a ZFS root filesystem."
+	fi
+
 	ksh93 $(atf_get_srcdir)/rootpool_002_neg.ksh || atf_fail "Testcase failed"
 }
 rootpool_002_neg_cleanup()
@@ -69,12 +76,15 @@ atf_test_case rootpool_007_neg cleanup
 rootpool_007_neg_head()
 {
 	atf_set "descr" "the zfs rootfs's compression property can not set to gzip and gzip[1-9]"
-	atf_set "require.config"  is_zfs_root
 	atf_set "require.progs"  zfs
 }
 rootpool_007_neg_body()
 {
 	. $(atf_get_srcdir)/../../include/default.cfg
+
+	if ! is_zfsroot ; then
+		atf_skip "This test requires a ZFS root filesystem."
+	fi
 
 	ksh93 $(atf_get_srcdir)/rootpool_007_neg.ksh || atf_fail "Testcase failed"
 }



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