From 0a0dfc4d65432c5c7ba836e2e5c15d0c675c0c79 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 5 Feb 2012 07:39:10 +1100 Subject: [PATCH] TEST-TOOL: only do the read10 rdprotect test for SBC devices --- test-tool/0103_read10_rdprotect.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test-tool/0103_read10_rdprotect.c b/test-tool/0103_read10_rdprotect.c index e6f655a..a3ab6f8 100644 --- a/test-tool/0103_read10_rdprotect.c +++ b/test-tool/0103_read10_rdprotect.c @@ -60,6 +60,12 @@ int T0103_read10_rdprotect(const char *initiator, const char *url) return -1; } + if (inq->periperal_device_type != SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_DIRECT_ACCESS) { + printf("LUN is not SBC device. Skipping test\n"); + scsi_free_scsi_task(task); + return -1; + } + if (inq->protect) { printf("LUN is formatted with protection information. Skipping test\n"); scsi_free_scsi_task(task); @@ -76,6 +82,7 @@ int T0103_read10_rdprotect(const char *initiator, const char *url) for (i = 1; i < 8; i++) { task = malloc(sizeof(struct scsi_task)); + if (task == NULL) { printf("Failed to allocate task structure\n"); ret = -1;