From d34e28dc1a5bdbbd5075cd529dd93359f15c18ed Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sat, 18 May 2013 14:00:25 -0700 Subject: [PATCH] TESTS: Improve the REPORT SUPPORTED OPCODES test for RCTD and also verify that the returned timeout descriptors have the correct length. --- test-tool/test_report_supported_opcodes_rctd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test-tool/test_report_supported_opcodes_rctd.c b/test-tool/test_report_supported_opcodes_rctd.c index 33d0e97..ca19683 100644 --- a/test-tool/test_report_supported_opcodes_rctd.c +++ b/test-tool/test_report_supported_opcodes_rctd.c @@ -67,6 +67,7 @@ test_report_supported_opcodes_rctd(void) "CTDP set"); } } + scsi_free_scsi_task(rso_task); @@ -95,5 +96,16 @@ test_report_supported_opcodes_rctd(void) } } + logging(LOG_VERBOSE, "Verify that all timeout descriptors have the " + "correct length"); + for (i = 0; i < rsoc->num_descriptors; i++) { + if (rsoc->descriptors[i].to.descriptor_length != 0x0a) { + logging(LOG_NORMAL, "[FAILED] Command descriptor " + "with invalid TimeoutDescriptor length"); + CU_FAIL("[FAILED] Command descriptor with " + "invalid TimeoutDescriptor length"); + } + } + scsi_free_scsi_task(rso_task); }