Fix the 4 residual tests for read10
This commit is contained in:
@@ -63,13 +63,20 @@ int T0105_read10_invalid(const char *initiator, const char *url)
|
|||||||
|
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
if (task->status == SCSI_STATUS_GOOD) {
|
if (task->status != SCSI_STATUS_GOOD) {
|
||||||
printf("[FAILED]\n");
|
printf("[FAILED]\n");
|
||||||
printf("Read10 of 1 block with iscsi ExpectedDataTransferLength==0 should fail.\n");
|
printf("Read10 of 1 block with iscsi ExpectedDataTransferLength==0 should not fail.\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
goto test2;
|
goto test2;
|
||||||
}
|
}
|
||||||
|
if (task->residual_status != SCSI_RESIDUAL_OVERFLOW || task->residual != 512) {
|
||||||
|
printf("[FAILED]\n");
|
||||||
|
printf("Read10 returned incorrect residual overflow.\n");
|
||||||
|
ret = -1;
|
||||||
|
scsi_free_scsi_task(task);
|
||||||
|
goto test5;
|
||||||
|
}
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
printf("[OK]\n");
|
printf("[OK]\n");
|
||||||
|
|
||||||
@@ -99,13 +106,20 @@ test2:
|
|||||||
|
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
if (task->status == SCSI_STATUS_GOOD) {
|
if (task->status != SCSI_STATUS_GOOD) {
|
||||||
printf("[FAILED]\n");
|
printf("[FAILED]\n");
|
||||||
printf("Read10 of 1 block with iscsi ExpectedDataTransferLength==1024 should fail.\n");
|
printf("Read10 of 1 block with iscsi ExpectedDataTransferLength==1024 should not fail.\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
goto test3;
|
goto test3;
|
||||||
}
|
}
|
||||||
|
if (task->residual_status != SCSI_RESIDUAL_UNDERFLOW || task->residual != 512) {
|
||||||
|
printf("[FAILED]\n");
|
||||||
|
printf("Read10 returned incorrect residual underflow.\n");
|
||||||
|
ret = -1;
|
||||||
|
scsi_free_scsi_task(task);
|
||||||
|
goto test5;
|
||||||
|
}
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
printf("[OK]\n");
|
printf("[OK]\n");
|
||||||
|
|
||||||
@@ -135,17 +149,23 @@ test3:
|
|||||||
|
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
if (task->status == SCSI_STATUS_GOOD) {
|
if (task->status != SCSI_STATUS_GOOD) {
|
||||||
printf("[FAILED]\n");
|
printf("[FAILED]\n");
|
||||||
printf("Read10 of 1 block with iscsi ExpectedDataTransferLength==200 should fail.\n");
|
printf("Read10 of 1 block with iscsi ExpectedDataTransferLength==200 should not fail.\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
goto test4;
|
goto test4;
|
||||||
}
|
}
|
||||||
|
if (task->residual_status != SCSI_RESIDUAL_OVERFLOW || task->residual != 312) {
|
||||||
|
printf("[FAILED]\n");
|
||||||
|
printf("Read10 returned incorrect residual overflow.\n");
|
||||||
|
ret = -1;
|
||||||
|
scsi_free_scsi_task(task);
|
||||||
|
goto test5;
|
||||||
|
}
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
printf("[OK]\n");
|
printf("[OK]\n");
|
||||||
|
|
||||||
|
|
||||||
test4:
|
test4:
|
||||||
/* Try a read of 2 blocks but xferlength == 512 */
|
/* Try a read of 2 blocks but xferlength == 512 */
|
||||||
printf("Read10 2 blocks but with iscsi ExpectedDataTransferLength==512 ... ");
|
printf("Read10 2 blocks but with iscsi ExpectedDataTransferLength==512 ... ");
|
||||||
@@ -171,13 +191,21 @@ test4:
|
|||||||
|
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
if (task->status == SCSI_STATUS_GOOD) {
|
if (task->status != SCSI_STATUS_GOOD) {
|
||||||
printf("[FAILED]\n");
|
printf("[FAILED]\n");
|
||||||
printf("Read10 of 2 blocks with iscsi ExpectedDataTransferLength==512 should fail.\n");
|
printf("Read10 of 2 blocks with iscsi ExpectedDataTransferLength==512 should succeed.\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
goto test5;
|
goto test5;
|
||||||
}
|
}
|
||||||
|
if (task->residual_status != SCSI_RESIDUAL_OVERFLOW || task->residual != 512) {
|
||||||
|
printf("[FAILED]\n");
|
||||||
|
printf("Read10 returned incorrect residual overflow.\n");
|
||||||
|
ret = -1;
|
||||||
|
scsi_free_scsi_task(task);
|
||||||
|
goto test5;
|
||||||
|
}
|
||||||
|
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
printf("[OK]\n");
|
printf("[OK]\n");
|
||||||
|
|
||||||
@@ -220,7 +248,6 @@ test5:
|
|||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
printf("[OK]\n");
|
printf("[OK]\n");
|
||||||
|
|
||||||
|
|
||||||
finished:
|
finished:
|
||||||
iscsi_logout_sync(iscsi);
|
iscsi_logout_sync(iscsi);
|
||||||
iscsi_destroy_context(iscsi);
|
iscsi_destroy_context(iscsi);
|
||||||
|
|||||||
Reference in New Issue
Block a user