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
This commit is contained in:
Ronnie Sahlberg
2012-05-02 21:41:44 +10:00
parent 9e303bf635
commit ac3da5df38
2 changed files with 4 additions and 4 deletions

View File

@@ -79,7 +79,7 @@ int T0203_read16_0blocks(const char *initiator, const char *url)
printf("[OK]\n");
printf("Read16 0blocks at LBA:<end-of-disk> ");
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:<beyond end-of-disk> ");
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));

View File

@@ -79,7 +79,7 @@ int T0213_read12_0blocks(const char *initiator, const char *url)
printf("[OK]\n");
printf("Read12 0blocks at LBA:<end-of-disk> ");
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:<beyond end-of-disk> ");
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));