From 9068f23f9540093663b9c7afd5543154787926cd Mon Sep 17 00:00:00 2001 From: Chris Zankel Date: Wed, 22 Apr 2015 17:55:36 -0700 Subject: [PATCH] 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 --- test-tool/iscsi-support.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test-tool/iscsi-support.c b/test-tool/iscsi-support.c index 54f788a..1421518 100644 --- a/test-tool/iscsi-support.c +++ b/test-tool/iscsi-support.c @@ -196,13 +196,14 @@ static int check_result(const char *opcode, struct scsi_device *sdev, || task->sense.key != key || !ascq_ok)) { logging(LOG_NORMAL, "[FAILED] %s failed with wrong sense. " - "Should have failed with %s(0x%02x)/%s(0x%04x)" - "but failed with Sense:%s\n", + "Should have failed with %s(0x%02x)/%s(0x%04x) " + "but failed with Sense: %s(0x%02x)/(0x%04x)\n", opcode, scsi_sense_key_str(key), key, num_ascq ? scsi_sense_ascq_str(ascq[0]) : "NO ASCQ", num_ascq ? ascq[0] : 0, - sdev->error_str); + sdev->error_str, + task->sense.key, task->sense.ascq); return -1; } logging(LOG_VERBOSE, "[OK] %s returned %s %s(0x%02x) %s(0x%04x)",