From owner-svn-src-all@freebsd.org Tue Apr 9 16:20:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C7891563998; Tue, 9 Apr 2019 16:20:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D91A46CBE4; Tue, 9 Apr 2019 16:20:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B25ACD86A; Tue, 9 Apr 2019 16:20:36 +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 x39GKaVd049856; Tue, 9 Apr 2019 16:20:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x39GKamM049855; Tue, 9 Apr 2019 16:20:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904091620.x39GKamM049855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 9 Apr 2019 16:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346057 - head/tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/geom/class/eli X-SVN-Commit-Revision: 346057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D91A46CBE4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Apr 2019 16:20:37 -0000 Author: ngie Date: Tue Apr 9 16:20:36 2019 New Revision: 346057 URL: https://svnweb.freebsd.org/changeset/base/346057 Log: Fix geli device cleanup Final cleanup routines shouldn't be called from testcases; it should be called from the testcase cleanup routine. Furthermore, `geli_test_cleanup` should take care of cleaning up geli providers and the memory disks used for the geli providers. `geli_test_cleanup` will always be executed whereas the equivalent logic in `geli_test_body`, may not have been executed if the test failed prior to the logic being run. Prior to this change, the test case was trying to clean up `$md` twice: once in at the end of the test case body function, and the other in the cleanup function. The cleanup function logic was failing because there wasn't anything to clean up in the cleanup function and the errors weren't being ignored. This fixes FreeBSD test suite runs after r345864. PR: 237128 Reviewed by: asomers, pjd Approved by: emaste (mentor) MFC with: r345864 Differential Revision: https://reviews.freebsd.org/D19854 Modified: head/tests/sys/geom/class/eli/online_resize_test.sh Modified: head/tests/sys/geom/class/eli/online_resize_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/online_resize_test.sh Tue Apr 9 16:17:31 2019 (r346056) +++ head/tests/sys/geom/class/eli/online_resize_test.sh Tue Apr 9 16:20:36 2019 (r346057) @@ -172,22 +172,18 @@ online_resize_body() atf_check -s exit:0 -o match:'^Flags: .*AUTORESIZE' geli list ${md}p1.eli atf_check -s exit:0 -o match:resized gpart resize -i 1 -s 30${prefix} ${md} atf_check -s exit:0 -o match:"^[[:space:]]${osize30}[[:space:]]+# mediasize in bytes" diskinfo -v ${md}p1.eli - atf_check geli detach ${md}p1.eli - - # Cleanup. - atf_check -s exit:0 -o match:deleted gpart delete -i 1 ${md} - atf_check -s exit:0 -o match:destroyed gpart destroy ${md} - atf_check -s exit:0 -o ignore mdconfig -d -u ${md} done } online_resize_cleanup() { if [ -f "$TEST_MDS_FILE" ]; then while read md; do - [ -c /dev/${md}p1.eli ] && geli detach ${md}p1.eli - mdconfig -d -u ${md} 2>/dev/null + atf_check -s ignore -e ignore -o ignore geli detach ${md}p1.eli + atf_check -s ignore -e ignore -o ignore gpart delete -i 1 ${md} + atf_check -s ignore -e ignore -o ignore gpart destroy ${md} done < $TEST_MDS_FILE fi + geli_test_cleanup } atf_init_test_cases()