TESTS: READ6 is optional(==obsolete)

This commit is contained in:
Ronnie Sahlberg
2013-04-27 16:22:58 -07:00
parent 94d048afae
commit f8e317c355
5 changed files with 34 additions and 0 deletions

View File

@@ -1884,6 +1884,13 @@ read6(struct iscsi_context *iscsi, int lun, uint32_t lba,
iscsi_get_error(iscsi));
return -1;
}
if (task->status == SCSI_STATUS_CHECK_CONDITION
&& task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST
&& task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
scsi_free_scsi_task(task);
logging(LOG_NORMAL, "[SKIPPED] READ6 is not implemented.");
return -2;
}
if (task->status != SCSI_STATUS_GOOD) {
logging(LOG_NORMAL, "[FAILED] READ6 command: "
"failed with sense. %s", iscsi_get_error(iscsi));
@@ -1917,6 +1924,13 @@ read6_lbaoutofrange(struct iscsi_context *iscsi, int lun, uint32_t lba,
iscsi_get_error(iscsi));
return -1;
}
if (task->status == SCSI_STATUS_CHECK_CONDITION
&& task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST
&& task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
scsi_free_scsi_task(task);
logging(LOG_NORMAL, "[SKIPPED] READ6 is not implemented.");
return -2;
}
if (task->status == SCSI_STATUS_GOOD) {
logging(LOG_NORMAL, "[FAILED] READ6 successful but should "
"have failed with ILLEGAL_REQUEST/LBA_OUT_OF_RANGE");

View File

@@ -31,6 +31,11 @@ test_read6_0blocks(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test READ6 0-blocks at LBA==0");
ret = read6(iscsic, tgt_lun, 0, 0, block_size, NULL);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] READ6 is not implemented.");
CU_PASS("READ6 is not implemented.");
return;
}
CU_ASSERT_EQUAL(ret, 0);
if (num_blocks > 0x1fffff) {

View File

@@ -41,6 +41,11 @@ test_read6_beyond_eol(void)
ret = read6_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
i * block_size, block_size,
NULL);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] READ6 is not implemented.");
CU_PASS("READ6 is not implemented.");
return;
}
CU_ASSERT_EQUAL(ret, 0);
}

View File

@@ -36,6 +36,11 @@ test_read6_simple(void)
for (i = 1; i <= 255; i++) {
ret = read6(iscsic, tgt_lun, 0, i * block_size,
block_size, NULL);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] READ6 is not implemented.");
CU_PASS("READ6 is not implemented.");
return;
}
CU_ASSERT_EQUAL(ret, 0);
}

View File

@@ -45,6 +45,11 @@ test_writesame10_wrprotect(void)
ret = writesame10_invalidfieldincdb(iscsic, tgt_lun, 0,
block_size, 1,
0, 0, i, 0, buf);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] WRITESAME10 is not implemented.");
CU_PASS("WRITESAME10 is not implemented.");
return;
}
CU_ASSERT_EQUAL(ret, 0);
}
free(buf);