TESTS: ReadCapacity16 is also mandatory in SBC-2 when INQ->PROTECT is set.

Check for this in the support functions and return error.
This commit is contained in:
Ronnie Sahlberg
2013-05-12 21:19:51 -07:00
parent d166d27ab8
commit f9fb1e0ee3
2 changed files with 8 additions and 1 deletions

View File

@@ -2654,6 +2654,13 @@ readcapacity16(struct iscsi_context *iscsi, int lun, int alloc_len)
&& task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST
&& task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
scsi_free_scsi_task(task);
if (inq->protect) {
logging(LOG_NORMAL, "[FAILED] READCAPACITY16 is not "
"available but INQ->PROTECT is set. "
"ReadCapacity16 is mandatory when INQ->PROTECT "
"is set.");
return -1;
}
if (sbc3_support) {
logging(LOG_NORMAL, "[FAILED] READCAPACITY16 is not available but the device claims SBC-3 support.");
return -1;

View File

@@ -36,7 +36,7 @@ test_readcapacity16_simple(void)
ret = readcapacity16(iscsic, tgt_lun, 16);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] READCAPACITY16 is not implemented on this target and it does not claim SBC-3 support.");
logging(LOG_NORMAL, "[SKIPPED] READCAPACITY16 is not implemented on this target and it does not claim support.");
CU_PASS("READCAPACITY16 is not implemented and no SBC-3 support claimed.");
return;
}