Re: [PATCH v11 34/34] scsi: Add kunit tests for scsi_check_passthrough

Mike Christie
2023-09-15T22:08:12Z

On 9/15/23 4:52 PM, Martin Wilck wrote:
>> +       /* Match using SCMD_FAILURE_ASCQ_ANY */
> This comment looks wrong to me. Are you missing an ABORTED_COMMAND,
> 0x11 case here?

Both are wrong :)

I'm actually testing that we don't match (get SCSI_RETURN_NOT_HANDLED)
even though the caller set SCMD_FAILURE_ASCQ_ANY. So the comment is wrong.

But yeah, I also wanted to test that SCMD_FAILURE_ASCQ_ANY works so I
need to add a test for that. I had tested this but then changed the test
for the above case while testing, but didn't go back and edit the tests
again to have them both.

>
>> +       scsi_build_sense(&sc, 0, ABORTED_COMMAND, 0x22, 0x22);
>> +       KUNIT_EXPECT_EQ(test, SCSI_RETURN_NOT_HANDLED,
>> +                       scsi_check_passthrough(&sc));