TEST: reserve6_basic: Bail with success if command simply isn't supported.

This commit is contained in:
Jon Grimm
2012-09-27 14:33:32 -05:00
parent 26d090e191
commit 602f89f060

View File

@@ -68,11 +68,21 @@ int T0420_reserve6_simple(const char *initiator, const char *url, int data_loss,
goto finished;
}
if (task->status != SCSI_STATUS_GOOD) {
printf("[FAILED]\n");
printf("RESERVE6 command failed : %s\n",
iscsi_get_error(iscsi));
if (task->status == SCSI_STATUS_CHECK_CONDITION
&& task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST
&& task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
printf("[OK]\n");
printf("RESERVE6 Not Supported\n");
ret = 0;
} else {
printf("[FAILED]\n");
printf("RESERVE6 failed but ascq was wrong. Should "
"have failed with ILLEGAL_REQUEST/"
"INVALID OPERATOR. Sense:%s\n",
iscsi_get_error(iscsi));
ret = -1;
}
scsi_free_scsi_task(task);
ret = -1;
goto finished;
}