From dbc9ffb5cbf68756fa1c28f6ad9c83bfc473cdb5 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Mon, 24 Feb 2014 19:04:58 -0800 Subject: [PATCH] TESTS: ReportSupportedOpcodes return the opcode itself as data[0], not 0xff The first byte of CDB USAGE FIELD contains the opcode value itself, not 0xff. From SPC4 : ... The first byte of the CDB USAGE FIELD field shall contain the operation code for the command being queried. ... --- .../test_report_supported_opcodes_one_command.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test-tool/test_report_supported_opcodes_one_command.c b/test-tool/test_report_supported_opcodes_one_command.c index 46318b7..b49f11c 100644 --- a/test-tool/test_report_supported_opcodes_one_command.c +++ b/test-tool/test_report_supported_opcodes_one_command.c @@ -136,11 +136,15 @@ test_report_supported_opcodes_one_command(void) logging(LOG_NORMAL, "[FAILED] CDB length is 0"); } - logging(LOG_VERBOSE, "Verify CDB[0] Usage Data is 0xFF"); - CU_ASSERT_EQUAL(rsoc_one->cdb_usage_data[0], 0xff); - if (rsoc_one->cdb_usage_data[0] != 0xff) { - logging(LOG_NORMAL, "[FAILED] CDB[0] Usage Data is " - "not 0xFF"); + logging(LOG_VERBOSE, "Verify CDB[0] Usage Data == "); + CU_ASSERT_EQUAL(rsoc_one->cdb_usage_data[0], + rsoc->descriptors[i].opcode); + if (rsoc_one->cdb_usage_data[0] != rsoc->descriptors[i].opcode) { + logging(LOG_NORMAL, "[FAILED] CDB[0] Usage Data was " + "0x%02x, expected 0x%02x for opcode 0x%02x", + rsoc_one->cdb_usage_data[0], + rsoc->descriptors[i].opcode, + rsoc->descriptors[i].opcode); } scsi_free_scsi_task(one_task);