test-tool: print (logging) the actual sense code if mismatch
Print (log) the actual sense code that was returned if it doesn't match the expected value. Signed-off-by: Chris Zankel <chris@zankel.net>
This commit is contained in:
@@ -196,13 +196,14 @@ static int check_result(const char *opcode, struct scsi_device *sdev,
|
|||||||
|| task->sense.key != key
|
|| task->sense.key != key
|
||||||
|| !ascq_ok)) {
|
|| !ascq_ok)) {
|
||||||
logging(LOG_NORMAL, "[FAILED] %s failed with wrong sense. "
|
logging(LOG_NORMAL, "[FAILED] %s failed with wrong sense. "
|
||||||
"Should have failed with %s(0x%02x)/%s(0x%04x)"
|
"Should have failed with %s(0x%02x)/%s(0x%04x) "
|
||||||
"but failed with Sense:%s\n",
|
"but failed with Sense: %s(0x%02x)/(0x%04x)\n",
|
||||||
opcode,
|
opcode,
|
||||||
scsi_sense_key_str(key), key,
|
scsi_sense_key_str(key), key,
|
||||||
num_ascq ? scsi_sense_ascq_str(ascq[0]) : "NO ASCQ",
|
num_ascq ? scsi_sense_ascq_str(ascq[0]) : "NO ASCQ",
|
||||||
num_ascq ? ascq[0] : 0,
|
num_ascq ? ascq[0] : 0,
|
||||||
sdev->error_str);
|
sdev->error_str,
|
||||||
|
task->sense.key, task->sense.ascq);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
logging(LOG_VERBOSE, "[OK] %s returned %s %s(0x%02x) %s(0x%04x)",
|
logging(LOG_VERBOSE, "[OK] %s returned %s %s(0x%02x) %s(0x%04x)",
|
||||||
|
|||||||
Reference in New Issue
Block a user