git: f7c45c012201 - main - nvmecontrol tests: Fix nvmecontrol usage in a couple of tests

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Sat, 09 Nov 2024 20:04:53 UTC
The branch main has been updated by markj:

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

commit f7c45c012201aff52a83c45c1ba516a855b11ed9
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-11-09 19:59:46 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-11-09 20:04:04 +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
---
 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