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:
@@ -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");
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user