From 9f5a315e0c3f0aea3fdfff03674a222273278cc2 Mon Sep 17 00:00:00 2001 From: Jon Grimm Date: Mon, 29 Oct 2012 10:55:02 -0500 Subject: [PATCH] TEST: skip optional return op codes if not supported. --- test-tool/0430_report_all_supported_ops.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test-tool/0430_report_all_supported_ops.c b/test-tool/0430_report_all_supported_ops.c index 70d59b0..34cbbc7 100644 --- a/test-tool/0430_report_all_supported_ops.c +++ b/test-tool/0430_report_all_supported_ops.c @@ -60,6 +60,16 @@ int T0430_report_all_supported_ops(const char *initiator, const char *url, int d ret = -1; goto finished; } + if (task->status == SCSI_STATUS_CHECK_CONDITION + && task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST + && task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { + printf("[SKIPPED]\n"); + printf("REPORT SUPPORTED OPCODES command failed : %s\n", + iscsi_get_error(iscsi)); + scsi_free_scsi_task(task); + ret = -2; + goto finished; + } if (task->status != SCSI_STATUS_GOOD) { printf("[FAILED]\n"); printf("REPORT SUPPORTED OPCODES command failed : %s\n", @@ -114,6 +124,17 @@ test2: ret = -1; goto finished; } + if (task->status == SCSI_STATUS_CHECK_CONDITION + && task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST + && (task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE + || task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_FIELD_IN_CDB)) { + printf("[SKIPPED]\n"); + printf("REPORT SUPPORTED OPCODES command failed : %s\n", + iscsi_get_error(iscsi)); + scsi_free_scsi_task(task); + ret = -2; + goto finished; + } if (task->status != SCSI_STATUS_GOOD) { printf("[FAILED]\n"); printf("REPORT SUPPORTED OPCODES command failed : %s\n",