TEST: update SANITIZE test output
This commit is contained in:
@@ -43,30 +43,50 @@ test_sanitize_block_erase(void)
|
||||
cd = get_command_descriptor(SCSI_OPCODE_SANITIZE,
|
||||
SCSI_SANITIZE_BLOCK_ERASE);
|
||||
if (cd == NULL) {
|
||||
logging(LOG_VERBOSE, "Opcode is not supported. Verify that "
|
||||
"WABEREQ is zero.");
|
||||
if (inq_bdc && inq_bdc->wabereq) {
|
||||
logging(LOG_NORMAL, "[WARNING] SANITIZE BLOCK ERASE "
|
||||
"opcode is not supported but WABEREQ is "
|
||||
"not 0");
|
||||
logging(LOG_NORMAL, "[FAILED] WABEREQ is not 0 but "
|
||||
"SANITIZE BLOCK ERASE opcode is not supported");
|
||||
CU_FAIL("[FAILED] WABEREQ is not 0 but BLOCK ERASE "
|
||||
"is not supported.");
|
||||
}
|
||||
}
|
||||
if (cd == NULL) {
|
||||
logging(LOG_NORMAL, "[SKIPPED] SANITIZE BLOCK_ERASE is not "
|
||||
"implemented according to REPORT_SUPPORTED_OPCODES.");
|
||||
CU_PASS("SANITIZE is not implemented.");
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "Verify that we have BlockDeviceCharacteristics "
|
||||
"VPD page.");
|
||||
if (inq_bdc == NULL) {
|
||||
logging(LOG_NORMAL, "[WARNING] SANITIZE BLOCK ERASE opcode is "
|
||||
logging(LOG_NORMAL, "[FAILED] SANITIZE BLOCK ERASE opcode is "
|
||||
"supported but BlockDeviceCharacteristics VPD page is "
|
||||
"missing");
|
||||
CU_FAIL("[FAILED] BlockDeviceCharacteristics VPD "
|
||||
"page is missing");
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "Check MediumRotationRate whether this is a HDD "
|
||||
"or a SSD device.");
|
||||
if (inq_bdc && inq_bdc->medium_rotation_rate != 0) {
|
||||
logging(LOG_NORMAL, "This is a HDD device");
|
||||
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");
|
||||
} else {
|
||||
logging(LOG_NORMAL, "This is a HDD device");
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "Verify that WABEREQ is specified");
|
||||
if (inq_bdc && !inq_bdc->wabereq) {
|
||||
logging(LOG_NORMAL, "[WARNING] SANITIZE BLOCK ERASE "
|
||||
"opcode is supproted but WABEREQ is 0");
|
||||
logging(LOG_NORMAL, "[FAILED] SANITIZE BLOCK ERASE "
|
||||
"opcode is supported but WABEREQ is 0");
|
||||
CU_FAIL("[FAILED] SANITIZE BLOCK ERASE "
|
||||
"opcode is supported but WABEREQ is 0");
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "Test we can perform basic BLOCK ERASE SANITIZE");
|
||||
|
||||
@@ -48,16 +48,27 @@ test_sanitize_overwrite(void)
|
||||
CU_PASS("SANITIZE is not implemented.");
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "Verify that we have BlockDeviceCharacteristics "
|
||||
"VPD page.");
|
||||
if (inq_bdc == NULL) {
|
||||
logging(LOG_NORMAL, "[WARNING] SANITIZE OVERWRITE opcode is "
|
||||
logging(LOG_NORMAL, "[FAILED] SANITIZE OVERWRITE opcode is "
|
||||
"supported but BlockDeviceCharacteristics VPD page is "
|
||||
"missing");
|
||||
CU_FAIL("[FAILED] BlockDeviceCharacteristics VPD "
|
||||
"page is missing");
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "Check MediumRotationRate whether this is a HDD "
|
||||
"or a SSD device.");
|
||||
if (inq_bdc && inq_bdc->medium_rotation_rate == 0) {
|
||||
logging(LOG_NORMAL, "This is a HDD device");
|
||||
logging(LOG_NORMAL, "[WARNING] SANITIZE OVERWRITE opcode is "
|
||||
"supported but MediumRotationRate is 0 "
|
||||
"indicating that this is an SSD. Only HDDs should "
|
||||
"implement OVERWRITE");
|
||||
} else {
|
||||
logging(LOG_NORMAL, "This is a SSD device");
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "Test SANITIZE OVERWRITE with initialization pattern of one full block");
|
||||
|
||||
Reference in New Issue
Block a user