From owner-svn-src-all@freebsd.org Thu Jul 23 23:29:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B33F366F33; Thu, 23 Jul 2020 23:29:52 +0000 (UTC) (envelope-from bdrewery@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BCT802t6Mz4J44; Thu, 23 Jul 2020 23:29:52 +0000 (UTC) (envelope-from bdrewery@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 460AE20A47; Thu, 23 Jul 2020 23:29:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06NNTqeQ051771; Thu, 23 Jul 2020 23:29:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NNTo4d051764; Thu, 23 Jul 2020 23:29:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <202007232329.06NNTo4d051764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 23 Jul 2020 23:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363463 - head/tests/sys/geom/class/mirror X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/tests/sys/geom/class/mirror X-SVN-Commit-Revision: 363463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 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: Thu, 23 Jul 2020 23:29:52 -0000 Author: bdrewery Date: Thu Jul 23 23:29:50 2020 New Revision: 363463 URL: https://svnweb.freebsd.org/changeset/base/363463 Log: Limit gmirror failpoint tests to the test worker This avoids injecting errors into the test system's mirrors. gnop seems like a good solution here but it injects errors at the wrong place vs where these tests expect and does not support a 'max global count' like the failpoints do with 'n*' syntax. Reviewed by: cem, vangyzen Sponsored by: Dell EMC Isilon Modified: head/tests/sys/geom/class/mirror/10_test.sh head/tests/sys/geom/class/mirror/11_test.sh head/tests/sys/geom/class/mirror/12_test.sh head/tests/sys/geom/class/mirror/13_test.sh head/tests/sys/geom/class/mirror/9_test.sh head/tests/sys/geom/class/mirror/conf.sh head/tests/sys/geom/class/mirror/sync_error.sh Modified: head/tests/sys/geom/class/mirror/10_test.sh ============================================================================== --- head/tests/sys/geom/class/mirror/10_test.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/10_test.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -30,7 +30,7 @@ tmp2=$(mktemp $base.XXXXXX) EIO=5 # gmirror should retry a failed read from the other mirror. -sysctl ${regreadfp}="1*return(${EIO})" +sysctl ${regreadfp}="1*return(${EIO})[pid $(gmirror_worker_pid)]" dd if=/dev/mirror/$name of=$tmp1 iseek=256 bs=$ddbs count=1 >/dev/null 2>&1 dd if=/dev/$us1 of=$tmp2 iseek=256 bs=$ddbs count=1 >/dev/null 2>&1 sysctl ${regreadfp}='off' Modified: head/tests/sys/geom/class/mirror/11_test.sh ============================================================================== --- head/tests/sys/geom/class/mirror/11_test.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/11_test.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -31,7 +31,7 @@ tmp2=$(mktemp $base.XXXXXX) ENXIO=6 # gmirror has special handling for ENXIO. It does not mark the failed component # as broken, allowing it to rejoin the mirror automatically when it appears. -sysctl ${regreadfp}="1*return(${ENXIO})" +sysctl ${regreadfp}="1*return(${ENXIO})[pid $(gmirror_worker_pid)]" dd if=/dev/mirror/$name of=$tmp1 iseek=512 bs=$ddbs count=1 >/dev/null 2>&1 dd if=/dev/$us1 of=$tmp2 iseek=512 bs=$ddbs count=1 >/dev/null 2>&1 sysctl ${regreadfp}='off' Modified: head/tests/sys/geom/class/mirror/12_test.sh ============================================================================== --- head/tests/sys/geom/class/mirror/12_test.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/12_test.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -29,7 +29,7 @@ dd if=/dev/random of=$tmp1 bs=$ddbs count=1 >/dev/null EIO=5 # gmirror should kick one of the mirrors out after hitting EIO. -sysctl ${regwritefp}="1*return(${EIO})" +sysctl ${regwritefp}="1*return(${EIO})[pid $(gmirror_worker_pid)]" dd if=$tmp1 of=/dev/mirror/$name bs=$ddbs count=1 >/dev/null 2>&1 dd if=/dev/mirror/$name of=$tmp2 bs=$ddbs count=1 >/dev/null 2>&1 sysctl ${regwritefp}='off' Modified: head/tests/sys/geom/class/mirror/13_test.sh ============================================================================== --- head/tests/sys/geom/class/mirror/13_test.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/13_test.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -31,7 +31,7 @@ dd if=/dev/random of=$tmp1 bs=$ddbs count=1 >/dev/null ENXIO=6 # gmirror has special handling for ENXIO. It does not mark the failed component # as broken, allowing it to rejoin the mirror automatically when it appears. -sysctl ${regwritefp}="1*return(${ENXIO})" +sysctl ${regwritefp}="1*return(${ENXIO})[pid $(gmirror_worker_pid)]" dd if=$tmp1 of=/dev/mirror/$name bs=$ddbs count=1 >/dev/null 2>&1 dd if=/dev/mirror/$name of=$tmp2 bs=$ddbs count=1 >/dev/null 2>&1 sysctl ${regwritefp}='off' Modified: head/tests/sys/geom/class/mirror/9_test.sh ============================================================================== --- head/tests/sys/geom/class/mirror/9_test.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/9_test.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -26,7 +26,7 @@ devwait # Break one of the mirrors by forcing a single metadata write error. # When dd closes the mirror provider, gmirror will attempt to mark the mirrors # clean, and will kick one of the mirrors out upon hitting the error. -sysctl debug.fail_point.g_mirror_metadata_write='1*return(5)' || exit 1 +sysctl debug.fail_point.g_mirror_metadata_write="1*return(5)[pid $(gmirror_worker_pid)]" || exit 1 dd if=/dev/random of=/dev/mirror/$name bs=$ddbs count=1 >/dev/null 2>&1 sysctl debug.fail_point.g_mirror_metadata_write='off' || exit 1 Modified: head/tests/sys/geom/class/mirror/conf.sh ============================================================================== --- head/tests/sys/geom/class/mirror/conf.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/conf.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -12,6 +12,11 @@ gmirror_test_cleanup() } trap gmirror_test_cleanup ABRT EXIT INT TERM +gmirror_worker_pid() +{ + pgrep -S -n "g_mirror mirror\..*" +} + syncwait() { while $(gmirror status -s $name | grep -q SYNCHRONIZING); do Modified: head/tests/sys/geom/class/mirror/sync_error.sh ============================================================================== --- head/tests/sys/geom/class/mirror/sync_error.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/sync_error.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -28,7 +28,7 @@ sync_read_error_2_disks_body() atf_check gmirror label $name $md1 devwait - atf_check -s ignore -e empty -o not-empty sysctl ${REG_READ_FP}='1*return(5)' + atf_check -s ignore -e empty -o not-empty sysctl ${REG_READ_FP}="1*return(5)[pid $(gmirror_worker_pid)]" # If a read error occurs while synchronizing and the mirror contains # a single active disk, gmirror has no choice but to fail the @@ -75,7 +75,7 @@ sync_read_error_3_disks_body() atf_check gmirror insert $name $md2 syncwait - atf_check -s exit:0 -e empty -o not-empty sysctl ${REG_READ_FP}='1*return(5)' + atf_check -s exit:0 -e empty -o not-empty sysctl ${REG_READ_FP}="1*return(5)[pid $(gmirror_worker_pid)]" # If a read error occurs while synchronizing a new disk, and we have # multiple active disks, we retry the read after an error. The disk