[PATCH 0/2] Fix testProutRegisterSimple to check for Reservation Conflict

7 views
Skip to first unread message

Lee Duncan

unread,
Mar 22, 2013, 6:43:27 PM3/22/13
to ronnies...@gmail.com, libi...@googlegroups.com
The first patch just fixes an oversite on the reregister test,
since REGISTER does not need a reservation type:

[PATCH 1/2] Reservation type not needed to register.

The second patch fixes a bug in testing reregister, making sure
the return status is Reservation Conflict:

[PATCH 2/2] fix reregister to check for resvn conflict

Lee Duncan

unread,
Mar 22, 2013, 6:43:28 PM3/22/13
to ronnies...@gmail.com, libi...@googlegroups.com, Lee Duncan
---
test-tool/iscsi-support.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/test-tool/iscsi-support.c b/test-tool/iscsi-support.c
index 1c091a2..7bf3aa6 100644
--- a/test-tool/iscsi-support.c
+++ b/test-tool/iscsi-support.c
@@ -683,9 +683,7 @@ prout_reregister_key_fails(struct iscsi_context *iscsi, int lun,
poc.service_action_reservation_key = sark;
task = iscsi_persistent_reserve_out_sync(iscsi, lun,
SCSI_PERSISTENT_RESERVE_REGISTER,
- SCSI_PERSISTENT_RESERVE_SCOPE_LU,
- SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE,
- &poc);
+ SCSI_PERSISTENT_RESERVE_SCOPE_LU, 0, &poc);
if (task == NULL) {
logging(LOG_NORMAL,
"[FAILED] Failed to send PROUT command: %s",
--
1.7.10.4

Lee Duncan

unread,
Mar 22, 2013, 6:43:29 PM3/22/13
to ronnies...@gmail.com, libi...@googlegroups.com, Lee Duncan
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) {
- logging(LOG_NORMAL,
- "[FAILED] PROUT/REGISTER when already registered should fail");
- ret = -1;
- goto dun;
- }
- if (task->status == SCSI_STATUS_GOOD) {
+
+ if (task->status != SCSI_STATUS_RESERVATION_CONFLICT) {
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;
}
--
1.7.10.4

ronnie sahlberg

unread,
Mar 22, 2013, 8:58:34 PM3/22/13
to Lee Duncan, libi...@googlegroups.com
Merged and pushed.

Thanks!
Reply all
Reply to author
Forward
0 new messages