TESTS: UNMAP/WRITESAME10/16 Check LBPRZ before we read the unmapped blocks and verify they are blank.

This commit is contained in:
Ronnie Sahlberg
2013-05-15 17:10:20 -07:00
parent bdce246bc0
commit 8c22f8d986
6 changed files with 94 additions and 44 deletions

View File

@@ -58,14 +58,23 @@ test_writesame16_unmap_until_end(void)
}
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks and verify they are now zero", i);
ret = read16(iscsic, tgt_lun, num_blocks - i,
i * block_size, block_size,
0, 0, 0, 0, 0, buf);
for (j = 0; j < block_size * i; j++) {
if (buf[j] != 0) {
CU_ASSERT_EQUAL(buf[j], 0);
if (rc16->lbprz) {
logging(LOG_VERBOSE, "LBPRZ is set. Read the unmapped "
"blocks back and verify they are all zero");
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read16(iscsic, tgt_lun, num_blocks - i,
i * block_size, block_size,
0, 0, 0, 0, 0, buf);
for (j = 0; j < block_size * i; j++) {
if (buf[j] != 0) {
CU_ASSERT_EQUAL(buf[j], 0);
}
}
} else {
logging(LOG_VERBOSE, "LBPRZ is clear. Skip the read "
"and verify zero test");
}
}
}