diff --git a/test-tool/test_reserve6_2initiators.c b/test-tool/test_reserve6_2initiators.c index 589af26..e0b6b4e 100644 --- a/test-tool/test_reserve6_2initiators.c +++ b/test-tool/test_reserve6_2initiators.c @@ -91,4 +91,8 @@ test_reserve6_2initiators(void) logging(LOG_NORMAL, "RELEASE6 from the second initiator"); ret = release6(iscsic2, tgt_lun); CU_ASSERT_EQUAL(ret, 0); + + iscsi_logout_sync(iscsic2); + iscsi_destroy_context(iscsic2); + iscsic2 = NULL; } diff --git a/test-tool/test_reserve6_itnexus_loss.c b/test-tool/test_reserve6_itnexus_loss.c index 8894c39..7aebbd6 100644 --- a/test-tool/test_reserve6_itnexus_loss.c +++ b/test-tool/test_reserve6_itnexus_loss.c @@ -66,7 +66,7 @@ test_reserve6_itnexus_loss(void) iscsic = iscsi_context_login(initiatorname1, tgt_url, &tgt_lun); if (iscsic == NULL) { logging(LOG_VERBOSE, "Failed to login to target"); - return; + goto finished; } logging(LOG_NORMAL, "RESERVE6 from the second initiator should work now"); @@ -76,4 +76,9 @@ test_reserve6_itnexus_loss(void) logging(LOG_NORMAL, "RELEASE6 from the second initiator"); ret = release6(iscsic2, tgt_lun); CU_ASSERT_EQUAL(ret, 0); + +finished: + iscsi_logout_sync(iscsic2); + iscsi_destroy_context(iscsic2); + iscsic2 = NULL; } diff --git a/test-tool/test_reserve6_logout.c b/test-tool/test_reserve6_logout.c index 3b0ccf6..476b1e7 100644 --- a/test-tool/test_reserve6_logout.c +++ b/test-tool/test_reserve6_logout.c @@ -73,4 +73,8 @@ test_reserve6_logout(void) logging(LOG_NORMAL, "RELEASE6 from the second initiator"); ret = release6(iscsic2, tgt_lun); CU_ASSERT_EQUAL(ret, 0); + + iscsi_logout_sync(iscsic2); + iscsi_destroy_context(iscsic2); + iscsic2 = NULL; } diff --git a/test-tool/test_reserve6_target_cold_reset.c b/test-tool/test_reserve6_target_cold_reset.c index 00a847e..15914c7 100644 --- a/test-tool/test_reserve6_target_cold_reset.c +++ b/test-tool/test_reserve6_target_cold_reset.c @@ -69,4 +69,8 @@ test_reserve6_target_cold_reset(void) logging(LOG_VERBOSE, "RELEASE6 from the second initiator"); ret = release6(iscsic2, tgt_lun); CU_ASSERT_EQUAL(ret, 0); + + iscsi_logout_sync(iscsic2); + iscsi_destroy_context(iscsic2); + iscsic2 = NULL; } diff --git a/test-tool/test_reserve6_target_warm_reset.c b/test-tool/test_reserve6_target_warm_reset.c index 41ed515..db5bdd3 100644 --- a/test-tool/test_reserve6_target_warm_reset.c +++ b/test-tool/test_reserve6_target_warm_reset.c @@ -71,4 +71,8 @@ test_reserve6_target_warm_reset(void) logging(LOG_VERBOSE, "RELEASE6 from the second initiator"); ret = release6(iscsic2, tgt_lun); CU_ASSERT_EQUAL(ret, 0); + + iscsi_logout_sync(iscsic2); + iscsi_destroy_context(iscsic2); + iscsic2 = NULL; }