TESTS: SANITIZE tests. Print additional warnings.

If SANITIZE is supported but we dont have the BlockDeviceCharacteristics
page we produce a warning.
If OVERWRITE is supported on SSDs we warn.
If BLOCK ERASE is supported on HDDs we warn.
This commit is contained in:
Ronnie Sahlberg
2013-06-01 08:53:54 -07:00
parent 7d413da22c
commit 804ab643a3
2 changed files with 22 additions and 0 deletions

View File

@@ -48,6 +48,17 @@ test_sanitize_block_erase(void)
CU_PASS("SANITIZE is not implemented.");
return;
}
if (inq_bdc == NULL) {
logging(LOG_NORMAL, "[WARNING] SANITIZE BLOCK ERASE opcode is "
"supported but BlockDeviceCharacteristics VPD page is "
"missing");
}
if (inq_bdc && inq_bdc->medium_rotation_rate != 0) {
logging(LOG_NORMAL, "[WARNING] SANITIZE BLOCK ERASE opcode is "
"supported but MediumRotationRate is not 0 "
"indicating that this is a HDD. Only SSDs should "
"implement BLOCK ERASE");
}
logging(LOG_VERBOSE, "Test we can perform basic BLOCK ERASE SANITIZE");

View File

@@ -48,6 +48,17 @@ test_sanitize_overwrite(void)
CU_PASS("SANITIZE is not implemented.");
return;
}
if (inq_bdc == NULL) {
logging(LOG_NORMAL, "[WARNING] SANITIZE OVERWRITE opcode is "
"supported but BlockDeviceCharacteristics VPD page is "
"missing");
}
if (inq_bdc && inq_bdc->medium_rotation_rate == 0) {
logging(LOG_NORMAL, "[WARNING] SANITIZE OVERWRITE opcode is "
"supported but MediumRotationRate is 0 "
"indicating that this is an SSD. Only HDDs should "
"implement OVERWRITE");
}
logging(LOG_VERBOSE, "Test SANITIZE OVERWRITE with initialization pattern of one full block");
data.size = block_size + 4;