test-tool: fix Inquiry.AllocLength

according to SBC-2 the alloc length should be at least 5 when
evpd is set to zero.

Also don't leak task if SPC-3 or later.

Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
Peter Lieven
2014-08-13 18:53:52 +02:00
parent b9cf7e8cd2
commit 1f900054e1

View File

@@ -35,8 +35,8 @@ test_inquiry_alloc_length(void)
logging(LOG_VERBOSE, "Test of the INQUIRY allocation length");
logging(LOG_VERBOSE, "Verify we can read standard INQUIRY page with alloc length from 0-255");
for (i = 0; i < 256 ; i++) {
logging(LOG_VERBOSE, "Verify we can read standard INQUIRY page with alloc length from 5-255");
for (i = 5; i < 256 ; i++) {
if (task != NULL) {
scsi_free_scsi_task(task);
task = NULL;
@@ -78,6 +78,9 @@ test_inquiry_alloc_length(void)
goto finished;
}
scsi_free_scsi_task(task);
task = NULL;
logging(LOG_VERBOSE, "Version is SPC-3 or later. Read INQUIRY data using 16-bit allocation length");
logging(LOG_VERBOSE, "Read INQUIRY data with allocation length 511 (low order byte is 0xff)");
ret = inquiry(iscsic, tgt_lun, 0, 0, 511, &task);