TESTS: Add remaining checks for *verify* opcode not implemented skip test
This commit is contained in:
@@ -81,13 +81,21 @@ int T0133_verify10_beyondeol(const char *initiator, const char *url, int data_lo
|
|||||||
printf("[FAILED]\n");
|
printf("[FAILED]\n");
|
||||||
printf("Failed to send verify10 command: %s\n", iscsi_get_error(iscsi));
|
printf("Failed to send verify10 command: %s\n", iscsi_get_error(iscsi));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto finished;
|
goto test2;
|
||||||
}
|
}
|
||||||
if (task->status == SCSI_STATUS_GOOD) {
|
if (task->status == SCSI_STATUS_GOOD) {
|
||||||
printf("[FAILED]\n");
|
printf("[FAILED]\n");
|
||||||
printf("Verify10 command should fail when reading beyond end of device\n");
|
printf("Verify10 command should fail when reading beyond end of device\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
|
goto test2;
|
||||||
|
}
|
||||||
|
if (task->status == SCSI_STATUS_CHECK_CONDITION
|
||||||
|
&& task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST
|
||||||
|
&& task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
|
||||||
|
printf("[SKIPPED]\n");
|
||||||
|
printf("Opcode is not implemented on target\n");
|
||||||
|
scsi_free_scsi_task(task);
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
if (task->status != SCSI_STATUS_CHECK_CONDITION
|
if (task->status != SCSI_STATUS_CHECK_CONDITION
|
||||||
@@ -97,12 +105,14 @@ int T0133_verify10_beyondeol(const char *initiator, const char *url, int data_lo
|
|||||||
printf("VERIFY10 failed but with the wrong sense code. It should have failed with ILLEGAL_REQUEST/LBA_OUT_OF_RANGE.\n");
|
printf("VERIFY10 failed but with the wrong sense code. It should have failed with ILLEGAL_REQUEST/LBA_OUT_OF_RANGE.\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
goto finished;
|
goto test2;
|
||||||
}
|
}
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
}
|
}
|
||||||
printf("[OK]\n");
|
printf("[OK]\n");
|
||||||
|
|
||||||
|
test2:
|
||||||
|
|
||||||
finished:
|
finished:
|
||||||
iscsi_logout_sync(iscsi);
|
iscsi_logout_sync(iscsi);
|
||||||
iscsi_destroy_context(iscsi);
|
iscsi_destroy_context(iscsi);
|
||||||
|
|||||||
@@ -143,6 +143,14 @@ int T0273_verify16_beyondeol(const char *initiator, const char *url, int data_lo
|
|||||||
printf("[FAILED]\n");
|
printf("[FAILED]\n");
|
||||||
printf("Failed to send verify16 command: %s\n", iscsi_get_error(iscsi));
|
printf("Failed to send verify16 command: %s\n", iscsi_get_error(iscsi));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
goto test2;
|
||||||
|
}
|
||||||
|
if (task->status == SCSI_STATUS_CHECK_CONDITION
|
||||||
|
&& task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST
|
||||||
|
&& task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
|
||||||
|
printf("[SKIPPED]\n");
|
||||||
|
printf("Opcode is not implemented on target\n");
|
||||||
|
scsi_free_scsi_task(task);
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
if (task->status == SCSI_STATUS_GOOD) {
|
if (task->status == SCSI_STATUS_GOOD) {
|
||||||
@@ -150,7 +158,7 @@ int T0273_verify16_beyondeol(const char *initiator, const char *url, int data_lo
|
|||||||
printf("verify16 command should fail when reading at LBA -1\n");
|
printf("verify16 command should fail when reading at LBA -1\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
goto finished;
|
goto test2;
|
||||||
}
|
}
|
||||||
if (task->status != SCSI_STATUS_CHECK_CONDITION
|
if (task->status != SCSI_STATUS_CHECK_CONDITION
|
||||||
|| task->sense.key != SCSI_SENSE_ILLEGAL_REQUEST
|
|| task->sense.key != SCSI_SENSE_ILLEGAL_REQUEST
|
||||||
@@ -159,12 +167,14 @@ int T0273_verify16_beyondeol(const char *initiator, const char *url, int data_lo
|
|||||||
printf("VERIFY16 failed but with the wrong sense code. It should have failed with ILLEGAL_REQUEST/LBA_OUT_OF_RANGE.\n");
|
printf("VERIFY16 failed but with the wrong sense code. It should have failed with ILLEGAL_REQUEST/LBA_OUT_OF_RANGE.\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
goto finished;
|
goto test2;
|
||||||
}
|
}
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
}
|
}
|
||||||
printf("[OK]\n");
|
printf("[OK]\n");
|
||||||
|
|
||||||
|
test2:
|
||||||
|
|
||||||
finished:
|
finished:
|
||||||
iscsi_logout_sync(iscsi);
|
iscsi_logout_sync(iscsi);
|
||||||
iscsi_destroy_context(iscsi);
|
iscsi_destroy_context(iscsi);
|
||||||
|
|||||||
@@ -81,6 +81,14 @@ int T0283_verify12_beyondeol(const char *initiator, const char *url, int data_lo
|
|||||||
printf("[FAILED]\n");
|
printf("[FAILED]\n");
|
||||||
printf("Failed to send verify12 command: %s\n", iscsi_get_error(iscsi));
|
printf("Failed to send verify12 command: %s\n", iscsi_get_error(iscsi));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
goto test2;
|
||||||
|
}
|
||||||
|
if (task->status == SCSI_STATUS_CHECK_CONDITION
|
||||||
|
&& task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST
|
||||||
|
&& task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
|
||||||
|
printf("[SKIPPED]\n");
|
||||||
|
printf("Opcode is not implemented on target\n");
|
||||||
|
scsi_free_scsi_task(task);
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
if (task->status == SCSI_STATUS_GOOD) {
|
if (task->status == SCSI_STATUS_GOOD) {
|
||||||
@@ -88,7 +96,7 @@ int T0283_verify12_beyondeol(const char *initiator, const char *url, int data_lo
|
|||||||
printf("Verify12 command should fail when reading beyond end of device\n");
|
printf("Verify12 command should fail when reading beyond end of device\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
goto finished;
|
goto test2;
|
||||||
}
|
}
|
||||||
if (task->status != SCSI_STATUS_CHECK_CONDITION
|
if (task->status != SCSI_STATUS_CHECK_CONDITION
|
||||||
|| task->sense.key != SCSI_SENSE_ILLEGAL_REQUEST
|
|| task->sense.key != SCSI_SENSE_ILLEGAL_REQUEST
|
||||||
@@ -97,12 +105,14 @@ int T0283_verify12_beyondeol(const char *initiator, const char *url, int data_lo
|
|||||||
printf("VERIFY12 failed but with the wrong sense code. It should have failed with ILLEGAL_REQUEST/LBA_OUT_OF_RANGE.\n");
|
printf("VERIFY12 failed but with the wrong sense code. It should have failed with ILLEGAL_REQUEST/LBA_OUT_OF_RANGE.\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
goto finished;
|
goto test2;
|
||||||
}
|
}
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
}
|
}
|
||||||
printf("[OK]\n");
|
printf("[OK]\n");
|
||||||
|
|
||||||
|
test2:
|
||||||
|
|
||||||
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