From 52a57d26f2b97b24ba5c33487568907556e2a52c Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 21 Apr 2015 14:14:11 +0200 Subject: [PATCH] test-tool: Improve reliability of status_is_invalid_opcode() The test_report_supported_opcodes_one_command() sends SCSI commands to the target for which the target has to reply with ILLEGAL REQUEST / INVALID FIELD IN CDB. Avoid that such a reply is misinterpret as "command not supported" by checking the field offset in the sense descriptor. See also patch "test tool: Detect unsupported opcodes correctly" (commit ID fe9620092c5d). Signed-off-by: Bart Van Assche --- test-tool/iscsi-support.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test-tool/iscsi-support.c b/test-tool/iscsi-support.c index 655d562..6f4cc24 100644 --- a/test-tool/iscsi-support.c +++ b/test-tool/iscsi-support.c @@ -135,7 +135,8 @@ static int status_is_invalid_opcode(struct scsi_task *task) switch (task->sense.ascq) { case SCSI_SENSE_ASCQ_INVALID_FIELD_IN_CDB: case SCSI_SENSE_ASCQ_INVALID_FIELD_IN_PARAMETER_LIST: - return 1; + return !task->sense.sense_specific || + task->sense.field_pointer == 1; } } }