From owner-svn-src-head@freebsd.org Sat Jul 29 22:01:18 2017 Return-Path: Delivered-To: svn-src-head@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 EF70CDCC359; Sat, 29 Jul 2017 22:01:18 +0000 (UTC) (envelope-from ngie@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 B9E437E42E; Sat, 29 Jul 2017 22:01:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TM1HlC081076; Sat, 29 Jul 2017 22:01:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TM1Hvb081075; Sat, 29 Jul 2017 22:01:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707292201.v6TM1Hvb081075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 29 Jul 2017 22:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321702 - head/tests/sys/geom/class/gate X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/geom/class/gate X-SVN-Commit-Revision: 321702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jul 2017 22:01:19 -0000 Author: ngie Date: Sat Jul 29 22:01:17 2017 New Revision: 321702 URL: https://svnweb.freebsd.org/changeset/base/321702 Log: Load geom_gate(4) if necessary before running tests; skip if it can't be loaded The test code prior to r311893 loaded geom_gate at test start if necessary and skipped the tests if it couldn't be loaded. The ATF-ifcation of this test done in r311893 unfortunately dropped this functionality. This change restores the geom_gate module load and skips the test(s) if unavailable in an ATF-like way. MFC after: 1 month PR: 220164 Reported by: gjb Modified: head/tests/sys/geom/class/gate/ggate_test.sh Modified: head/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- head/tests/sys/geom/class/gate/ggate_test.sh Sat Jul 29 21:31:54 2017 (r321701) +++ head/tests/sys/geom/class/gate/ggate_test.sh Sat Jul 29 22:01:17 2017 (r321702) @@ -16,6 +16,8 @@ ggated_head() ggated_body() { + load_ggate + us=$(alloc_ggate_dev) work=$(alloc_md) src=$(alloc_md) @@ -57,6 +59,8 @@ ggatel_file_head() ggatel_file_body() { + load_ggate + us=$(alloc_ggate_dev) echo src work >> ${PLAINFILES} @@ -91,6 +95,8 @@ ggatel_md_head() ggatel_md_body() { + load_ggate + us=$(alloc_ggate_dev) work=$(alloc_md) src=$(alloc_md) @@ -193,6 +199,19 @@ common_cleanup() rm md.devs fi true +} + +load_ggate() +{ + local class=gate + + # If the geom class isn't already loaded, try loading it. + if ! kldstat -q -m g_${class}; then + if ! geom ${class} load; then + atf_skip "could not load module for geom class=${class}" + exit 0 + fi + fi } # Bug 204616: ggatel(8) creates /dev/ggate* asynchronously if `ggatel create`