diff mbox series

[blktests,07/12] nvme/018: Ignore error message generated by nvme read

Message ID 20190712235742.22646-8-logang@deltatee.com (mailing list archive)
State New, archived
Headers show
Series Fix nvme block test issues | expand

Commit Message

Logan Gunthorpe July 12, 2019, 11:57 p.m. UTC
nvme-cli at some point started printing the error message:

  NVMe status: CAP_EXCEEDED: The execution of the command has caused the
	capacity of the namespace to be exceeded(0x6081)

This was not accounted for by test 018 and caused it to fail.

This test does not need to test the error message content, it's
only important that a read past the end of the file fails. Therefore,
pipe stderr of nvme-cli to /dev/null.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
---
 tests/nvme/018 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Johannes Thumshirn July 15, 2019, 7:15 a.m. UTC | #1
On Fri, Jul 12, 2019 at 05:57:37PM -0600, Logan Gunthorpe wrote:
> nvme-cli at some point started printing the error message:
> 
>   NVMe status: CAP_EXCEEDED: The execution of the command has caused the
> 	capacity of the namespace to be exceeded(0x6081)
> 
> This was not accounted for by test 018 and caused it to fail.
> 
> This test does not need to test the error message content, it's
> only important that a read past the end of the file fails. Therefore,
> pipe stderr of nvme-cli to /dev/null.

How about redirecting all of the output to $FULL?
Logan Gunthorpe July 15, 2019, 3:40 p.m. UTC | #2
On 2019-07-15 1:15 a.m., Johannes Thumshirn wrote:
> On Fri, Jul 12, 2019 at 05:57:37PM -0600, Logan Gunthorpe wrote:
>> nvme-cli at some point started printing the error message:
>>
>>   NVMe status: CAP_EXCEEDED: The execution of the command has caused the
>> 	capacity of the namespace to be exceeded(0x6081)
>>
>> This was not accounted for by test 018 and caused it to fail.
>>
>> This test does not need to test the error message content, it's
>> only important that a read past the end of the file fails. Therefore,
>> pipe stderr of nvme-cli to /dev/null.
> 
> How about redirecting all of the output to $FULL?

Sure, I'll update it and send a v2.

Logan
diff mbox series

Patch

diff --git a/tests/nvme/018 b/tests/nvme/018
index e29fa92e8153..7b5ade5d3c40 100755
--- a/tests/nvme/018
+++ b/tests/nvme/018
@@ -44,9 +44,8 @@  test() {
 	sectors="$(blockdev --getsz "/dev/${nvmedev}n1")"
 	bs="$(blockdev --getbsz "/dev/${nvmedev}n1")"
 
-	if nvme read "/dev/${nvmedev}n1" -s "$sectors" -c 0 -z "$bs"; then
-		echo "ERROR: Successfully read out of device lba range"
-	fi
+	nvme read "/dev/${nvmedev}n1" -s "$sectors" -c 0 -z "$bs" 2>/dev/null \
+		&& echo "ERROR: Successfully read out of device lba range"
 
 	nvme disconnect -n "${subsys_name}"