diff --git a/test-tool/test_reserve6_lun_reset.c b/test-tool/test_reserve6_lun_reset.c index 7e70ec7..12c9b53 100644 --- a/test-tool/test_reserve6_lun_reset.c +++ b/test-tool/test_reserve6_lun_reset.c @@ -45,19 +45,6 @@ test_reserve6_lun_reset(void) CU_ASSERT_EQUAL(ret, 0); - logging(LOG_VERBOSE, "Create a second connection to the target"); - iscsic2 = iscsi_context_login(initiatorname1, tgt_url, &tgt_lun); - if (iscsic2 == NULL) { - logging(LOG_VERBOSE, "Failed to login to target"); - return; - } - - logging(LOG_VERBOSE, "Try to take out a RESERVE6 from the second initiator"); - ret = reserve6_conflict(iscsic2, tgt_lun); - CU_ASSERT_EQUAL(ret, 0); - - - logging(LOG_VERBOSE, "Send a LUN Reset"); ret = iscsi_task_mgmt_lun_reset_sync(iscsic, tgt_lun); if (ret != 0) { @@ -69,6 +56,13 @@ test_reserve6_lun_reset(void) sleep(3); + logging(LOG_VERBOSE, "Create a second connection to the target"); + iscsic2 = iscsi_context_login(initiatorname1, tgt_url, &tgt_lun); + if (iscsic2 == NULL) { + logging(LOG_VERBOSE, "Failed to login to target"); + return; + } + logging(LOG_VERBOSE, "RESERVE6 from the second initiator should work now"); ret = reserve6(iscsic2, tgt_lun); CU_ASSERT_EQUAL(ret, 0); diff --git a/test-tool/test_reserve6_target_cold_reset.c b/test-tool/test_reserve6_target_cold_reset.c index 3402b61..5817a2e 100644 --- a/test-tool/test_reserve6_target_cold_reset.c +++ b/test-tool/test_reserve6_target_cold_reset.c @@ -45,19 +45,6 @@ test_reserve6_target_cold_reset(void) CU_ASSERT_EQUAL(ret, 0); - logging(LOG_VERBOSE, "Create a second connection to the target"); - iscsic2 = iscsi_context_login(initiatorname1, tgt_url, &tgt_lun); - if (iscsic2 == NULL) { - logging(LOG_VERBOSE, "Failed to login to target"); - return; - } - - logging(LOG_VERBOSE, "Try to take out a RESERVE6 from the second initiator"); - ret = reserve6_conflict(iscsic2, tgt_lun); - CU_ASSERT_EQUAL(ret, 0); - - - logging(LOG_VERBOSE, "Send a Cold Reset to the target"); ret = iscsi_task_mgmt_target_cold_reset_sync(iscsic); if (ret != 0) { @@ -68,6 +55,13 @@ test_reserve6_target_cold_reset(void) logging(LOG_VERBOSE, "Sleep for three seconds incase the target is slow to reset"); sleep(3); + logging(LOG_VERBOSE, "Create a second connection to the target"); + iscsic2 = iscsi_context_login(initiatorname1, tgt_url, &tgt_lun); + if (iscsic2 == NULL) { + logging(LOG_VERBOSE, "Failed to login to target"); + return; + } + logging(LOG_VERBOSE, "RESERVE6 from the second initiator should work now"); ret = reserve6(iscsic2, tgt_lun); CU_ASSERT_EQUAL(ret, 0); diff --git a/test-tool/test_reserve6_target_warm_reset.c b/test-tool/test_reserve6_target_warm_reset.c index e24b3b3..762cbc1 100644 --- a/test-tool/test_reserve6_target_warm_reset.c +++ b/test-tool/test_reserve6_target_warm_reset.c @@ -45,19 +45,6 @@ test_reserve6_target_warm_reset(void) CU_ASSERT_EQUAL(ret, 0); - logging(LOG_VERBOSE, "Create a second connection to the target"); - iscsic2 = iscsi_context_login(initiatorname1, tgt_url, &tgt_lun); - if (iscsic2 == NULL) { - logging(LOG_VERBOSE, "Failed to login to target"); - return; - } - - logging(LOG_VERBOSE, "Try to take out a RESERVE6 from the second initiator"); - ret = reserve6_conflict(iscsic2, tgt_lun); - CU_ASSERT_EQUAL(ret, 0); - - - logging(LOG_VERBOSE, "Send a Warm Reset to the target"); ret = iscsi_task_mgmt_target_warm_reset_sync(iscsic); if (ret != 0) { @@ -69,6 +56,14 @@ test_reserve6_target_warm_reset(void) sleep(3); + logging(LOG_VERBOSE, "Create a second connection to the target"); + iscsic2 = iscsi_context_login(initiatorname1, tgt_url, &tgt_lun); + if (iscsic2 == NULL) { + logging(LOG_VERBOSE, "Failed to login to target"); + return; + } + + logging(LOG_VERBOSE, "RESERVE6 from the second initiator should work now"); ret = reserve6(iscsic2, tgt_lun); CU_ASSERT_EQUAL(ret, 0);