TESTS: skip COMPARE-AND-WRITE tests on targets missing this opcode
This commit is contained in:
@@ -117,6 +117,14 @@ int T0340_compareandwrite_simple(const char *initiator, const char *url, int dat
|
||||
ret++;
|
||||
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;
|
||||
}
|
||||
if (task->status != SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
printf("COMPAREANDWRITE command: failed with sense. %s\n", iscsi_get_error(iscsi));
|
||||
|
||||
@@ -120,6 +120,14 @@ int T0341_compareandwrite_mismatch(const char *initiator, const char *url, int d
|
||||
ret++;
|
||||
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;
|
||||
}
|
||||
if (task->status == SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
printf("COMPAREANDWRITE successful. It should have failed with MISCOMPARE/MISCOMPARE_DURING_VERIFY\n");
|
||||
|
||||
@@ -91,6 +91,14 @@ int T0343_compareandwrite_beyondeol(const char *initiator, const char *url, int
|
||||
ret++;
|
||||
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;
|
||||
}
|
||||
if (task->status == SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
printf("COMPAREANDWRITE command should fail when writing beyond end of device\n");
|
||||
|
||||
Reference in New Issue
Block a user