Skip to contentSkip to conversation

scsi: Add passthrough tests for success and no failure definitions

PATCH Applied Mike Christie 3 participants 4 messages Jan 13, 2025 – Feb 4, 2025 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: Add passthrough tests for success and no failure definitions

This patch adds scsi_check_passthrough tests for the cases where a command completes successfully and when the command failed but the caller did not pass in a list of failures.

---
 drivers/scsi/scsi_lib_test.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/scsi/scsi_lib_test.c +7 -0
index 99834426a100..ae8af0e0047a 100644
@@ -67,6 +67,13 @@ static void scsi_lib_test_multiple_sense(struct kunit *test)
 	};
 	int i;
 
+	/* Success */
+	sc.result = 0;
+	KUNIT_EXPECT_EQ(test, 0, scsi_check_passthrough(&sc, &failures));
+	KUNIT_EXPECT_EQ(test, 0, scsi_check_passthrough(&sc, NULL));
+	/* Command failed but caller did not pass in a failures array */
+	scsi_build_sense(&sc, 0, ILLEGAL_REQUEST, 0x91, 0x36);
+	KUNIT_EXPECT_EQ(test, 0, scsi_check_passthrough(&sc, NULL));
 	/* Match end of array */
 	scsi_build_sense(&sc, 0, ILLEGAL_REQUEST, 0x91, 0x36);
 	KUNIT_EXPECT_EQ(test, -EAGAIN, scsi_check_passthrough(&sc, &failures));
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Mike Christie

This patch adds scsi_check_passthrough tests for the cases where a command completes successfully and when the command failed but the caller did not pass in a list of failures.

#2 lore raw
In reply to Mike Christie

Mike,

Quoted 3 lines

This patch adds scsi_check_passthrough tests for the cases where a command completes successfully and when the command failed but the caller did not pass in a list of failures.

Applied to 6.14/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#3 lore raw
In reply to Mike Christie
Quoted 5 lines · Mike Christie

This patch adds scsi_check_passthrough tests for the cases where a command completes successfully and when the command failed but the caller did not pass in a list of failures.

Applied to 6.14/scsi-fixes, thanks!

[1/1] scsi: Add passthrough tests for success and no failure definitions

      https://git.kernel.org/mkp/scsi/c/b893d7ff853e
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering