git: 1fce096e2a0d - stable/14 - nvmecontrol tests: Fix nvmecontrol usage in a couple of tests

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 19 Nov 2024 14:31:17 UTC
The branch stable/14 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=1fce096e2a0d27d53962938c4cc09448d681c079

commit 1fce096e2a0d27d53962938c4cc09448d681c079
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-11-09 19:59:46 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-11-19 14:15:06 +0000

    nvmecontrol tests: Fix nvmecontrol usage in a couple of tests
    
    nvmecontrol {admin,io}-passthru's -r option doesn't take an argument,
    so the tests which added one failed because they tried to open /dev/0.
    
    MFC after:      1 week
    
    (cherry picked from commit f7c45c012201aff52a83c45c1ba516a855b11ed9)
---
 sbin/nvmecontrol/tests/basic.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sbin/nvmecontrol/tests/basic.sh b/sbin/nvmecontrol/tests/basic.sh
index f4a6b9504a3e..83b74721c66b 100755
--- a/sbin/nvmecontrol/tests/basic.sh
+++ b/sbin/nvmecontrol/tests/basic.sh
@@ -94,11 +94,11 @@ admin_passthru_head()
 admin_passthru_body()
 {
 	if [ -c "${TEST_DEV_PATH}" ] ; then
-		atf_check -o not-empty -e empty nvmecontrol admin-passthru --opcode=06 --data-len=4096 --cdw10=1 -r 0 ${TEST_DEV}
+		atf_check -o not-empty -e empty nvmecontrol admin-passthru --opcode=06 --data-len=4096 --cdw10=1 -r ${TEST_DEV}
 	else
-		atf_check -s not-exit:0 -o empty -e not-empty nvmecontrol admin-passthru --opcode=06 --data-len=4096 --cdw10=1 -r 0 ${TEST_DEV}
+		atf_check -s not-exit:0 -o empty -e not-empty nvmecontrol admin-passthru --opcode=06 --data-len=4096 --cdw10=1 -r ${TEST_DEV}
 	fi
-	atf_check -s not-exit:0 -o ignore -e match:"${INV_OPT_MSG}" nvmecontrol admin-passthru ${INV_OPT} --opcode=06 --data-len=4096 --cdw10=1 -r 0 ${TEST_DEV}
+	atf_check -s not-exit:0 -o ignore -e match:"${INV_OPT_MSG}" nvmecontrol admin-passthru ${INV_OPT} --opcode=06 --data-len=4096 --cdw10=1 -r ${TEST_DEV}
 }
 
 atf_test_case devlist
@@ -142,11 +142,11 @@ io_passthru_head()
 io_passthru_body()
 {
 	if [ -c "${TEST_DEV_PATH}" ] ; then
-		atf_check -o not-empty -e empty nvmecontrol io-passthru --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r 0 nvme0 ${TEST_DEV}
+		atf_check -o not-empty -e empty nvmecontrol io-passthru --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r nvme0 ${TEST_DEV}
 	else
-		atf_check -s not-exit:0 -o empty -e not-empty nvmecontrol io-passthru --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r 0 nvme0 ${TEST_DEV}
+		atf_check -s not-exit:0 -o empty -e not-empty nvmecontrol io-passthru --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r nvme0 ${TEST_DEV}
 	fi
-	atf_check -s not-exit:0 -o ignore -e match:"${INV_OPT_MSG}" nvmecontrol io-passthru ${INV_OPT} --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r 0 nvme0 ${TEST_DEV}
+	atf_check -s not-exit:0 -o ignore -e match:"${INV_OPT_MSG}" nvmecontrol io-passthru ${INV_OPT} --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r nvme0 ${TEST_DEV}
 }
 
 atf_test_case logpage