TESTS: *protect field set to non-zero are only guaranteed to fail if the device does not support protection information
This commit is contained in:
@@ -41,15 +41,20 @@ test_write16_wrprotect(void)
|
||||
*/
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE16 with non-zero WRPROTECT");
|
||||
for (i = 1; i < 8; i++) {
|
||||
ret = write16_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||
block_size, block_size,
|
||||
i, 0, 0, 0, 0, buf);
|
||||
if (ret == -2) {
|
||||
logging(LOG_NORMAL, "[SKIPPED] WRITE16 is not implemented.");
|
||||
CU_PASS("WRITE16 is not implemented.");
|
||||
return;
|
||||
}
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (inq->protect) {
|
||||
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||
} else {
|
||||
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||
for (i = 1; i < 8; i++) {
|
||||
ret = write16_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||
block_size, block_size,
|
||||
i, 0, 0, 0, 0, buf);
|
||||
if (ret == -2) {
|
||||
logging(LOG_NORMAL, "[SKIPPED] WRITE16 is not implemented.");
|
||||
CU_PASS("WRITE16 is not implemented.");
|
||||
return;
|
||||
}
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user