From 510883f28fca2f7e8468f0411946a216902442d4 Mon Sep 17 00:00:00 2001 From: Lee Duncan Date: Fri, 22 Mar 2013 15:43:29 -0700 Subject: [PATCH] fix reregister to check for resvn conflict According to SPC, an attempt to register on a registeried I_T Nexus with the incorrect reservation key should produce a reservation conflict. --- test-tool/iscsi-support.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/test-tool/iscsi-support.c b/test-tool/iscsi-support.c index 7bf3aa6..ca189a3 100644 --- a/test-tool/iscsi-support.c +++ b/test-tool/iscsi-support.c @@ -690,22 +690,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) { + + if (task->status != SCSI_STATUS_RESERVATION_CONFLICT) { logging(LOG_NORMAL, - "[FAILED] PROUT/REGISTER when already registered should fail"); - ret = -1; - goto dun; - } - if (task->status == SCSI_STATUS_GOOD) { - logging(LOG_NORMAL, - "[FAILED] PROUT/REGISTER command: succeeded when it should not have"); + "[FAILED] Expected RESERVATION CONFLICT"); ret = -1; } - dun: scsi_free_scsi_task(task); return ret; }