From nobody Tue Nov 05 02:07:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjBYC10zFz5crg3; Tue, 05 Nov 2024 02:07:11 +0000 (UTC) (envelope-from git@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjBYC0DQzz42BQ; Tue, 5 Nov 2024 02:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Ls/L8y3tF6DWJzrFvDZOh7BtdqKxAkyUzpFBSe/8Rc=; b=gmDz/dar3bPIGczWmzml9VJcVbvh8HzktKLwhDR8ZYrqfQZYTYP5zGoccJzG+ATr9qs+EP N/7e1C1h7j9OtYnYmLav+ZNnflnne5ZUb0oEH/Xjxq+TlSnBfKSDbnQplZh/865EMbmDy2 /HML21kjG+B7Pjw6NNVlr8Z4pQgSuTbv1O1gUedoC0DxOHfF0bjS3PqkPcrrQFmcD7LFDZ djEbrRsuG0Xj4sgPHcNVZix+MzHrg67yHv+nHVyIL/V7/Gqu7o2XEvdr8gPBhQL5Py/Ywh XJuVRgJS+CTWAKmp7rtw9kmIAKmTTwpcw4fqIoy1H3qB1K9ckzOM5VPEOtfoOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Ls/L8y3tF6DWJzrFvDZOh7BtdqKxAkyUzpFBSe/8Rc=; b=RVSMTyK5xNhlkAoHz4n/7TfoBni/AFm/Xo9l4FzC+1i9BUknb3d5IORUNCcNjVPCmZ4jA5 5i0aCDNR+xptwKvrXso12gdL3wIre55zysMWTNsuEx9sWpPJie7BYBtr5ShmsMrJDu1Bvb p0W0ooshY6cUOzu3P5pMVLYDtuVKE2yHY1DOs9vxw3FPjhe1T9Tp2t03BcSZLULeWvb8rj DTsX5FgQhBsQWKt6vRyB9Xcr2qAxUTUUqCSvMPHmx4SqnOScBdl5f1STxfJWmCUvyp3NEg AB/Ob7wYF2Gu5FhHWonmOH541xGSbn5C4jZXTHb46wPPUoiM87l6HZHei8MDZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730772431; a=rsa-sha256; cv=none; b=WwXCjAH5NXyQQshSHayv30FkmGlzcHbc5Fs5Zgq7qXk9gUumxFuxTdeADtiPVzlco9JFM6 DveDbT599UB0MsMIvezGrM6K/DTkiQQkepIAHG7lhrmje88nWqZTRygE8d7E91jWTiWzdC 0ByeNSd1LnfYBhquIei9KKrWg6JGOtYrXDNBmn8f3vtomw7RHWD+2viKLdbtVfHgz0SAjL 6RaJazqhsINLeI7y7pT2vBdS8GbDONgV5m1BRf2QvPTgs4qeukXByJJoZZVq/mjKCKtrNL 8YG2MGHRFriboVc7PrbilYKwfSvVHbZmQlXwP/qweI0J4Bruj1mah4Zv3qf1EQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XjBYB6xRLzxvJ; Tue, 5 Nov 2024 02:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A527AkV006529; Tue, 5 Nov 2024 02:07:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A527Aib006526; Tue, 5 Nov 2024 02:07:10 GMT (envelope-from git) Date: Tue, 5 Nov 2024 02:07:10 GMT Message-Id: <202411050207.4A527Aib006526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: b032be711c74 - main - Make the CTL tests more resilient List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b032be711c740d2f25b27c92069537edcfac221c Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=b032be711c740d2f25b27c92069537edcfac221c commit b032be711c740d2f25b27c92069537edcfac221c Author: Alan Somers AuthorDate: 2024-11-05 00:26:01 +0000 Commit: Alan Somers CommitDate: 2024-11-05 02:06:53 +0000 Make the CTL tests more resilient Fix the find_device function to work regardless of whether "camcontrol devlist" lists the da device first and the pass device second or vice versa. On FreeBSD 14 and 15 it apparently always lists da first. But on 13 it can do it in either order. MFC after: 2 weeks MFC with: fe1755fa Sponsored by: ConnectWise Reviewed by: emaste, markj, #cam Differential Revision: https://reviews.freebsd.org/D47446 --- tests/sys/cam/ctl/ctl.subr | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/sys/cam/ctl/ctl.subr b/tests/sys/cam/ctl/ctl.subr index 18991e0fa144..868b1c809571 100644 --- a/tests/sys/cam/ctl/ctl.subr +++ b/tests/sys/cam/ctl/ctl.subr @@ -47,7 +47,14 @@ find_device() { ctladm port -o on -p 0 >/dev/null HEXLUN=`printf %x $LUN` while true; do - dev=`camcontrol devlist | awk -v lun=$HEXLUN '/FREEBSD CTL/ && $9==lun {split($10, fields, /[,]/); print fields[1];}' | sed 's:[()]::'` + dev=`camcontrol devlist | awk -v lun=$HEXLUN ' + /FREEBSD CTL.*,pass/ && $9==lun { + split($10, fields, /[,]/); print fields[1]; + } + /FREEBSD CTL.*\(pass/ && $9==lun { + split($10, fields, /[,]/); print fields[2]; + } + ' | sed 's:[()]::'` if [ -z "$dev" -o ! -c /dev/$dev ]; then retries=$(( $retries - 1 )) if [ $retries -eq 0 ]; then