From ac3da5df3824235ba10ac4e9277f128f2dd3b097 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 2 May 2012 21:41:44 +1000 Subject: [PATCH] TESTS: fix bug in read 0 blocks at end of device. rc16->returned_lba is the lba of the last block which can be accessed on the device, not the first block beyond the end of the device --- test-tool/0203_read16_0blocks.c | 4 ++-- test-tool/0213_read12_0blocks.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test-tool/0203_read16_0blocks.c b/test-tool/0203_read16_0blocks.c index 07f3d72..4f08bf6 100644 --- a/test-tool/0203_read16_0blocks.c +++ b/test-tool/0203_read16_0blocks.c @@ -79,7 +79,7 @@ int T0203_read16_0blocks(const char *initiator, const char *url) printf("[OK]\n"); printf("Read16 0blocks at LBA: "); - task = iscsi_read16_sync(iscsi, lun, num_blocks - 1, 0, block_size, 0, 0, 0, 0, 0); + task = iscsi_read16_sync(iscsi, lun, num_blocks, 0, block_size, 0, 0, 0, 0, 0); if (task == NULL) { printf("[FAILED]\n"); printf("Failed to send read16 command: %s\n", iscsi_get_error(iscsi)); @@ -96,7 +96,7 @@ int T0203_read16_0blocks(const char *initiator, const char *url) printf("[OK]\n"); printf("Read16 0blocks at LBA: "); - task = iscsi_read16_sync(iscsi, lun, num_blocks , 0, block_size, 0, 0, 0, 0, 0); + task = iscsi_read16_sync(iscsi, lun, num_blocks + 1, 0, block_size, 0, 0, 0, 0, 0); if (task == NULL) { printf("[FAILED]\n"); printf("Failed to send read16 command: %s\n", iscsi_get_error(iscsi)); diff --git a/test-tool/0213_read12_0blocks.c b/test-tool/0213_read12_0blocks.c index 775520f..3cf443a 100644 --- a/test-tool/0213_read12_0blocks.c +++ b/test-tool/0213_read12_0blocks.c @@ -79,7 +79,7 @@ int T0213_read12_0blocks(const char *initiator, const char *url) printf("[OK]\n"); printf("Read12 0blocks at LBA: "); - task = iscsi_read12_sync(iscsi, lun, num_blocks - 1, 0, block_size, 0, 0, 0, 0, 0); + task = iscsi_read12_sync(iscsi, lun, num_blocks, 0, block_size, 0, 0, 0, 0, 0); if (task == NULL) { printf("[FAILED]\n"); printf("Failed to send read12 command: %s\n", iscsi_get_error(iscsi)); @@ -96,7 +96,7 @@ int T0213_read12_0blocks(const char *initiator, const char *url) printf("[OK]\n"); printf("Read12 0blocks at LBA: "); - task = iscsi_read12_sync(iscsi, lun, num_blocks , 0, block_size, 0, 0, 0, 0, 0); + task = iscsi_read12_sync(iscsi, lun, num_blocks + 1, 0, block_size, 0, 0, 0, 0, 0); if (task == NULL) { printf("[FAILED]\n"); printf("Failed to send read12 command: %s\n", iscsi_get_error(iscsi));