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:
Ronnie Sahlberg
2013-05-11 17:27:35 -07:00
parent 5135836ee5
commit 67676d4756
15 changed files with 220 additions and 149 deletions

View File

@@ -40,15 +40,20 @@ test_writeverify10_wrprotect(void)
*/
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test WRITEVERIFY10 with non-zero WRPROTECT");
for (i = 1; i < 8; i++) {
ret = writeverify10_invalidfieldincdb(iscsic, tgt_lun, 0,
block_size, block_size,
i, 0, 0, 0, buf);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] WRITE1VERIFY10 is not implemented.");
CU_PASS("WRITEVERIFY10 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 = writeverify10_invalidfieldincdb(iscsic, tgt_lun, 0,
block_size, block_size,
i, 0, 0, 0, buf);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] WRITE1VERIFY10 is not implemented.");
CU_PASS("WRITEVERIFY10 is not implemented.");
return;
}
CU_ASSERT_EQUAL(ret, 0);
}
}
}