From 2b6bc6c6875629749c69744deddebde6e04c60dd Mon Sep 17 00:00:00 2001 From: Jon Grimm Date: Fri, 28 Sep 2012 10:09:14 -0500 Subject: [PATCH] test: Add test to release from second initiator when already reserved by first initiator. --- test-tool/0420_reserve6_simple.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test-tool/0420_reserve6_simple.c b/test-tool/0420_reserve6_simple.c index 994fc47..3f8a2ba 100644 --- a/test-tool/0420_reserve6_simple.c +++ b/test-tool/0420_reserve6_simple.c @@ -36,6 +36,7 @@ int T0420_reserve6_simple(const char *initiator, const char *url, int data_loss, printf("1. Test simple RESERVE6 followed by RELEASE6\n"); printf("2. Test Initator 1 can reserve if already reserved by Intiator 1.\n"); printf("3. Test Initiator 2 can't reserve if already reserved by Initiator 1.\n"); + printf("3a. Test Initiator 2 release when reserved by Initiator 1 returns success, but without releasing.\n"); printf("4. Test Initiator 1 can testunitready if reserved by Initiator 1.\n"); printf("5. Test Initiator 2 can't testunitready if reserved by Initiator 1.\n"); printf("6. Test Initiator 2 can get reservation once Intiator 1 releases reservation.\n"); @@ -174,6 +175,27 @@ test3: printf("[OK]\n"); +test3a: + printf("Send RELEASE6 from Initiator 2. Expect NO-OP ..."); + task = iscsi_release6_sync(iscsi2, lun); + if (task == NULL) { + printf("[FAILED]\n"); + printf("Failed to send RELEASE6 command : %s\n", + iscsi_get_error(iscsi)); + ret = -1; + goto finished; + } + /* We expect this command to pass. */ + if (task->status != SCSI_STATUS_GOOD) { + printf("[FAILED]\n"); + printf("RELEASE6 command: failed with sense %s\n", + iscsi_get_error(iscsi)); + scsi_free_scsi_task(task); + ret = -1; + goto test4; + } + printf("[OK]\n"); + test4: printf("Send TESTUNITREADY from Initiator 1 ... ");