diff --git a/test-tool/iscsi-support.c b/test-tool/iscsi-support.c index 3190cef..4c44f14 100644 --- a/test-tool/iscsi-support.c +++ b/test-tool/iscsi-support.c @@ -472,6 +472,13 @@ prin_task(struct iscsi_context *iscsi, int lun, int service_action, iscsi_get_error(iscsi)); return -1; } + if (task->status == SCSI_STATUS_CHECK_CONDITION + && task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST + && task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { + scsi_free_scsi_task(task); + logging(LOG_NORMAL, "[SKIPPED] PERSISTENT RESERVE IN is not implemented."); + return -2; + } if (success_expected) { if (task->status != SCSI_STATUS_GOOD) { @@ -513,6 +520,12 @@ prin_read_keys(struct iscsi_context *iscsi, int lun, struct scsi_task **tp, iscsi_get_error(iscsi)); return -1; } + if ((*tp)->status == SCSI_STATUS_CHECK_CONDITION + && (*tp)->sense.key == SCSI_SENSE_ILLEGAL_REQUEST + && (*tp)->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { + logging(LOG_NORMAL, "[SKIPPED] PERSISTENT RESERVE IN is not implemented."); + return -2; + } if ((*tp)->status != SCSI_STATUS_GOOD) { logging(LOG_NORMAL, "[FAILED] PRIN command: failed with sense. %s", @@ -614,6 +627,13 @@ prout_register_key(struct iscsi_context *iscsi, int lun, iscsi_get_error(iscsi)); return -1; } + if (task->status == SCSI_STATUS_CHECK_CONDITION + && task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST + && task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { + scsi_free_scsi_task(task); + logging(LOG_NORMAL, "[SKIPPED] PERSISTENT RESERVE OUT is not implemented."); + return -2; + } if (task->status != SCSI_STATUS_GOOD) { logging(LOG_NORMAL, "[FAILED] PROUT command: failed with sense: %s", @@ -651,6 +671,13 @@ prin_verify_key_presence(struct iscsi_context *iscsi, int lun, iscsi_get_error(iscsi)); return -1; } + if (task->status == SCSI_STATUS_CHECK_CONDITION + && task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST + && task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { + scsi_free_scsi_task(task); + logging(LOG_NORMAL, "[SKIPPED] PERSISTENT RESERVE IN is not implemented."); + return -2; + } if (task->status != SCSI_STATUS_GOOD) { logging(LOG_NORMAL, @@ -719,6 +746,13 @@ prout_reregister_key_fails(struct iscsi_context *iscsi, int lun, iscsi_get_error(iscsi)); return -1; } + if (task->status == SCSI_STATUS_CHECK_CONDITION + && task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST + && task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { + scsi_free_scsi_task(task); + logging(LOG_NORMAL, "[SKIPPED] PERSISTENT RESERVE OUT is not implemented."); + return -2; + } if (task->status != SCSI_STATUS_RESERVATION_CONFLICT) { logging(LOG_NORMAL, @@ -762,6 +796,13 @@ prout_reserve(struct iscsi_context *iscsi, int lun, iscsi_get_error(iscsi)); return -1; } + if (task->status == SCSI_STATUS_CHECK_CONDITION + && task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST + && task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { + scsi_free_scsi_task(task); + logging(LOG_NORMAL, "[SKIPPED] PERSISTENT RESERVE OUT is not implemented."); + return -2; + } if (task->status != SCSI_STATUS_GOOD) { logging(LOG_NORMAL, @@ -804,6 +845,13 @@ prout_release(struct iscsi_context *iscsi, int lun, iscsi_get_error(iscsi)); return -1; } + if (task->status == SCSI_STATUS_CHECK_CONDITION + && task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST + && task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { + scsi_free_scsi_task(task); + logging(LOG_NORMAL, "[SKIPPED] PERSISTENT RESERVE OUT is not implemented."); + return -2; + } if (task->status != SCSI_STATUS_GOOD) { logging(LOG_NORMAL, @@ -838,6 +886,13 @@ prin_verify_reserved_as(struct iscsi_context *iscsi, int lun, iscsi_get_error(iscsi)); return -1; } + if (task->status == SCSI_STATUS_CHECK_CONDITION + && task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST + && task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { + scsi_free_scsi_task(task); + logging(LOG_NORMAL, "[SKIPPED] PERSISTENT RESERVE IN is not implemented."); + return -2; + } if (task->status != SCSI_STATUS_GOOD) { logging(LOG_NORMAL, @@ -903,6 +958,13 @@ prin_verify_not_reserved(struct iscsi_context *iscsi, int lun) iscsi_get_error(iscsi)); return -1; } + if (task->status == SCSI_STATUS_CHECK_CONDITION + && task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST + && task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { + scsi_free_scsi_task(task); + logging(LOG_NORMAL, "[SKIPPED] PERSISTENT RESERVE IN is not implemented."); + return -2; + } if (task->status != SCSI_STATUS_GOOD) { logging(LOG_NORMAL, diff --git a/test-tool/test_prin_read_keys_simple.c b/test-tool/test_prin_read_keys_simple.c index ba7b81e..53e2aca 100644 --- a/test-tool/test_prin_read_keys_simple.c +++ b/test-tool/test_prin_read_keys_simple.c @@ -37,6 +37,11 @@ test_prin_read_keys_simple(void) logging(LOG_VERBOSE, "Test Persistent Reserve IN READ_KEYS works."); ret = prin_read_keys(iscsic, tgt_lun, &task, NULL); + if (ret == -2) { + logging(LOG_NORMAL, "[SKIPPED] PERSISTEN RESERVE IN is not implemented."); + CU_PASS("PERSISTENT RESERVE IN is not implemented."); + return; + } CU_ASSERT_EQUAL(ret, 0); logging(LOG_VERBOSE, "Test DATA-IN is at least 8 bytes."); diff --git a/test-tool/test_prin_serviceaction_range.c b/test-tool/test_prin_serviceaction_range.c index 7e3420b..d8f3a00 100644 --- a/test-tool/test_prin_serviceaction_range.c +++ b/test-tool/test_prin_serviceaction_range.c @@ -38,6 +38,11 @@ test_prin_serviceaction_range(void) /* verify PRIN/READ_KEYS works -- XXX redundant -- remove this? */ ret = prin_read_keys(iscsic, tgt_lun, &task, NULL); + if (ret == -2) { + logging(LOG_NORMAL, "[SKIPPED] PERSISTEN RESERVE IN is not implemented."); + CU_PASS("PERSISTENT RESERVE IN is not implemented."); + return; + } CU_ASSERT_EQUAL(ret, 0); /* verify that PRIN/SA={0,1,2,3} works ... */ diff --git a/test-tool/test_prout_register_simple.c b/test-tool/test_prout_register_simple.c index 4cdd6eb..ca13193 100644 --- a/test-tool/test_prout_register_simple.c +++ b/test-tool/test_prout_register_simple.c @@ -38,6 +38,11 @@ test_prout_register_simple(void) /* register our reservation key with the target */ ret = prout_register_and_ignore(iscsic, tgt_lun, key); + if (ret == -2) { + logging(LOG_NORMAL, "[SKIPPED] PERSISTEN RESERVE OUT is not implemented."); + CU_PASS("PERSISTENT RESERVE OUT is not implemented."); + return; + } CU_ASSERT_EQUAL(ret, 0); /* verify we can read the registration */ diff --git a/test-tool/test_prout_reserve_access.c b/test-tool/test_prout_reserve_access.c index 481178c..2d4dd65 100644 --- a/test-tool/test_prout_reserve_access.c +++ b/test-tool/test_prout_reserve_access.c @@ -49,6 +49,11 @@ verify_persistent_reserve_access(struct iscsi_context *iscsi1, int lun1, /* register our reservation key with the target */ ret = prout_register_and_ignore(iscsi1, lun1, key); + if (ret == -2) { + logging(LOG_NORMAL, "[SKIPPED] PERSISTEN RESERVE OUT is not implemented."); + CU_PASS("PERSISTENT RESERVE OUT is not implemented."); + return; + } CU_ASSERT_EQUAL(0, ret); ret = prout_register_and_ignore(iscsi2, lun2, key2); CU_ASSERT_EQUAL(0, ret); diff --git a/test-tool/test_prout_reserve_ownership.c b/test-tool/test_prout_reserve_ownership.c index d374d4b..9404e6d 100644 --- a/test-tool/test_prout_reserve_ownership.c +++ b/test-tool/test_prout_reserve_ownership.c @@ -46,6 +46,11 @@ verify_persistent_reserve_ownership(struct iscsi_context *iscsi1, int lun1, /* register our reservation key with the target */ ret = prout_register_and_ignore(iscsi1, lun1, key1); + if (ret == -2) { + logging(LOG_NORMAL, "[SKIPPED] PERSISTEN RESERVE OUT is not implemented."); + CU_PASS("PERSISTENT RESERVE OUT is not implemented."); + return; + } CU_ASSERT_EQUAL(0, ret); ret = prout_register_and_ignore(iscsi2, lun2, key2); CU_ASSERT_EQUAL(0, ret); diff --git a/test-tool/test_prout_reserve_simple.c b/test-tool/test_prout_reserve_simple.c index 9266711..c7a0c42 100644 --- a/test-tool/test_prout_reserve_simple.c +++ b/test-tool/test_prout_reserve_simple.c @@ -53,6 +53,11 @@ test_prout_reserve_simple(void) /* register our reservation key with the target */ ret = prout_register_and_ignore(iscsic, tgt_lun, key); + if (ret == -2) { + logging(LOG_NORMAL, "[SKIPPED] PERSISTEN RESERVE OUT is not implemented."); + CU_PASS("PERSISTENT RESERVE OUT is not implemented."); + return; + } CU_ASSERT_EQUAL(ret, 0); /* test each reservatoin type */