TESTS: Additional checks for missing opcodes and skipping tests
This commit is contained in:
@@ -131,7 +131,7 @@ int T0131_verify10_mismatch(const char *initiator, const char *url, int data_los
|
||||
|
||||
if (vtask->sense.key != SCSI_SENSE_MISCOMPARE) {
|
||||
printf("[FAILED]\n");
|
||||
printf("Verify10 command returned wrong sense key. MISCOMPARE 0x%x expected but got key 0x%x\n", SCSI_SENSE_MISCOMPARE, vtask->sense.key);
|
||||
printf("Verify10 command returned wrong sense key. MISCOMPARE 0x%x expected but got key 0x%x. Sense:%s\n", SCSI_SENSE_MISCOMPARE, vtask->sense.key, iscsi_get_error(iscsi));
|
||||
ret = -1;
|
||||
scsi_free_scsi_task(task);
|
||||
scsi_free_scsi_task(vtask);
|
||||
|
||||
@@ -125,7 +125,7 @@ int T0132_verify10_mismatch_no_cmp(const char *initiator, const char *url, int d
|
||||
}
|
||||
if (vtask->status != SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
printf("Verify10 returned sense but BYTCHK==1 means it should not check/compare the data.\n");
|
||||
printf("Verify10 returned sense but BYTCHK==1 means it should not check/compare the data. Sense:%s\n", iscsi_get_error(iscsi));
|
||||
ret = -1;
|
||||
scsi_free_scsi_task(task);
|
||||
scsi_free_scsi_task(vtask);
|
||||
|
||||
@@ -102,7 +102,7 @@ int T0133_verify10_beyondeol(const char *initiator, const char *url, int data_lo
|
||||
|| task->sense.key != SCSI_SENSE_ILLEGAL_REQUEST
|
||||
|| task->sense.ascq != SCSI_SENSE_ASCQ_LBA_OUT_OF_RANGE) {
|
||||
printf("[FAILED]\n");
|
||||
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. Sense:%s\n", iscsi_get_error(iscsi));
|
||||
ret = -1;
|
||||
scsi_free_scsi_task(task);
|
||||
goto test2;
|
||||
|
||||
@@ -166,6 +166,14 @@ test2:
|
||||
ret = -1;
|
||||
goto test3;
|
||||
}
|
||||
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 (lbpws10) {
|
||||
if (task->status != SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
|
||||
@@ -102,6 +102,14 @@ int T0181_writesame10_unmap_unaligned(const char *initiator, const char *url, in
|
||||
printf("[FAILED]\n");
|
||||
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
|
||||
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;
|
||||
}
|
||||
if (task->status == SCSI_STATUS_GOOD) {
|
||||
@@ -109,12 +117,14 @@ int T0181_writesame10_unmap_unaligned(const char *initiator, const char *url, in
|
||||
printf("WRITESAME10 command to unmap a fractional physical block should fail\n");
|
||||
ret = -1;
|
||||
scsi_free_scsi_task(task);
|
||||
goto finished;
|
||||
goto test2;
|
||||
}
|
||||
scsi_free_scsi_task(task);
|
||||
}
|
||||
printf("[OK]\n");
|
||||
|
||||
test2:
|
||||
|
||||
finished:
|
||||
iscsi_logout_sync(iscsi);
|
||||
iscsi_destroy_context(iscsi);
|
||||
|
||||
@@ -92,6 +92,14 @@ int T0182_writesame10_beyondeol(const char *initiator, const char *url, int data
|
||||
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;
|
||||
}
|
||||
if (task->status == SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
printf("WRITESAME10 command should fail when writing beyond end of device\n");
|
||||
|
||||
@@ -90,6 +90,14 @@ int T0183_writesame10_wrprotect(const char *initiator, const char *url, int data
|
||||
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;
|
||||
}
|
||||
if (task->status == SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
printf("WRITESAME10 command should fail when WRPROTECT is set\n");
|
||||
|
||||
@@ -91,6 +91,14 @@ int T0184_writesame10_0blocks(const char *initiator, const char *url, int data_l
|
||||
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;
|
||||
}
|
||||
if (task->status != SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
printf("WRITESAME10 command: failed with sense. %s\n", iscsi_get_error(iscsi));
|
||||
|
||||
@@ -166,6 +166,14 @@ test2:
|
||||
ret = -1;
|
||||
goto test3;
|
||||
}
|
||||
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 (lbpws) {
|
||||
if (task->status != SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
|
||||
@@ -104,6 +104,14 @@ int T0191_writesame16_unmap_unaligned(const char *initiator, const char *url, in
|
||||
ret = -1;
|
||||
goto finished;
|
||||
}
|
||||
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("WRITESAME16 command to unmap a fractional physical block should fail\n");
|
||||
|
||||
@@ -91,6 +91,14 @@ int T0192_writesame16_beyondeol(const char *initiator, const char *url, int data
|
||||
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;
|
||||
}
|
||||
if (task->status == SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
printf("WRITESAME16 command should fail when writing beyond end of device\n");
|
||||
|
||||
@@ -90,6 +90,14 @@ int T0193_writesame16_wrprotect(const char *initiator, const char *url, int data
|
||||
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;
|
||||
}
|
||||
if (task->status == SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
printf("WRITESAME16 command should fail when WRPROTECT is set\n");
|
||||
|
||||
@@ -91,6 +91,14 @@ int T0194_writesame16_0blocks(const char *initiator, const char *url, int data_l
|
||||
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;
|
||||
}
|
||||
if (task->status != SCSI_STATUS_GOOD) {
|
||||
printf("[FAILED]\n");
|
||||
printf("WRITESAME16 command: failed with sense. %s\n", iscsi_get_error(iscsi));
|
||||
|
||||
Reference in New Issue
Block a user