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:
@@ -35,18 +35,22 @@ test_verify16_vrprotect(void)
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY16 with non-zero VRPROTECT");
|
||||
|
||||
for (i = 1; i < 8; i++) {
|
||||
ret = read16(iscsic, tgt_lun, 0, block_size,
|
||||
block_size, 0, 0, 0, 0, 0, buf);
|
||||
|
||||
ret = verify16_invalidfieldincdb(iscsic, tgt_lun, 0, block_size,
|
||||
block_size, i, 0, 1, buf);
|
||||
if (ret == -2) {
|
||||
logging(LOG_NORMAL, "[SKIPPED] VERIFY16 is not implemented.");
|
||||
CU_PASS("[SKIPPED] Target does not support VERIFY16. Skipping test");
|
||||
return;
|
||||
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 = read16(iscsic, tgt_lun, 0, block_size,
|
||||
block_size, 0, 0, 0, 0, 0, buf);
|
||||
|
||||
ret = verify16_invalidfieldincdb(iscsic, tgt_lun, 0, block_size,
|
||||
block_size, i, 0, 1, buf);
|
||||
if (ret == -2) {
|
||||
logging(LOG_NORMAL, "[SKIPPED] VERIFY16 is not implemented.");
|
||||
CU_PASS("[SKIPPED] Target does not support VERIFY16. Skipping test");
|
||||
return;
|
||||
}
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
}
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user