--- src/ckpt/apitest/test_cpa.c | 82 ++++++++++++++++++++++++++++++++++++++++ src/ckpt/apitest/test_cpa_util.c | 4 ++ src/ckpt/apitest/test_cpsv.h | 1 + 3 files changed, 87 insertions(+)
diff --git a/src/ckpt/apitest/test_cpa.c b/src/ckpt/apitest/test_cpa.c index 4a94a31..9050713 100644 --- a/src/ckpt/apitest/test_cpa.c +++ b/src/ckpt/apitest/test_cpa.c @@ -4606,6 +4606,84 @@ final1: test_validate(result, TEST_PASS); } +void cpsv_it_secdel_10() +{ + int result; + printHead("To verify section delete after finalize"); + result = test_ckptInitialize(CKPT_INIT_SUCCESS_T, TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final1; + + result = + test_ckptOpen(CKPT_OPEN_ALL_CREATE_SUCCESS_T, TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final2; + + result = test_ckptOpen(CKPT_OPEN_ALL_WRITE_SUCCESS_T, TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final3; + + result = test_ckptSectionCreate(CKPT_SECTION_CREATE_SUCCESS3_T, + TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final3; + + result = test_ckptFinalize(CKPT_FIN_SUCCESS_T, TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final1; + + result = test_ckptSectionDelete(CKPT_DEL_BAD_HANDLE1_T, TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final3; + +final3: + test_ckpt_cleanup(CPSV_CLEAN_ALL_REPLICAS_CKPT); +final2: + test_cpsv_cleanup(CPSV_CLEAN_INIT_SUCCESS_T); +final1: + printResult(result); + test_validate(result, TEST_PASS); +} + +void cpsv_it_secdel_11() +{ + int result; + printHead("To verify section delete after close"); + result = test_ckptInitialize(CKPT_INIT_SUCCESS_T, TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final1; + + result = + test_ckptOpen(CKPT_OPEN_ALL_CREATE_SUCCESS_T, TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final2; + + result = test_ckptOpen(CKPT_OPEN_ALL_WRITE_SUCCESS_T, TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final3; + + result = test_ckptSectionCreate(CKPT_SECTION_CREATE_SUCCESS3_T, + TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final3; + + result = test_ckptClose(CKPT_CLOSE_SUCCESS3_T, TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final1; + + result = test_ckptSectionDelete(CKPT_DEL_BAD_HANDLE1_T, TEST_CONFIG_MODE); + if (result != TEST_PASS) + goto final3; + +final3: + test_ckpt_cleanup(CPSV_CLEAN_ALL_REPLICAS_CKPT); +final2: + test_cpsv_cleanup(CPSV_CLEAN_INIT_SUCCESS_T); +final1: + printResult(result); + test_validate(result, TEST_PASS); +} + /******* saCkptSectionExpirationTimeSet *******/ void cpsv_it_expset_01() @@ -8385,6 +8463,10 @@ __attribute__((constructor)) static void ckpt_cpa_test_constructor(void) "To verify that when a section is deleted it is deleted atleast in active replica"); test_case_add(12, cpsv_it_secdel_09, "To verify section delete when maxSections is 1"); + test_case_add(12, cpsv_it_secdel_10, + "To verify section delete after finalize"); + test_case_add(12, cpsv_it_secdel_11, + "To verify section delete after close"); test_suite_add(13, "CKPT API saCkptSectionExpirationTimeSet()"); test_case_add(13, cpsv_it_expset_01, diff --git a/src/ckpt/apitest/test_cpa_util.c b/src/ckpt/apitest/test_cpa_util.c index 787d765..8287978 100644 --- a/src/ckpt/apitest/test_cpa_util.c +++ b/src/ckpt/apitest/test_cpa_util.c @@ -2518,6 +2518,10 @@ struct SafCheckpointSectionDelete API_SectionDelete[] = { [CKPT_DEL_SUCCESS3_T] = {&tcd.active_colloc_Writehdl, &tcd.section1, SA_AIS_OK, "Section Deleted in active colloc replica"}, + [CKPT_DEL_BAD_HANDLE1_T] = {&tcd.all_replicas_Createhdl, &tcd.section1, + SA_AIS_ERR_BAD_HANDLE, + "Section Delete bad handle"}, + }; diff --git a/src/ckpt/apitest/test_cpsv.h b/src/ckpt/apitest/test_cpsv.h index df27a98..8c2888f 100644 --- a/src/ckpt/apitest/test_cpsv.h +++ b/src/ckpt/apitest/test_cpsv.h @@ -576,6 +576,7 @@ typedef enum { CKPT_DEL_NOT_EXIST4_T, CKPT_DEL_GEN_T, CKPT_DEL_SUCCESS3_T, + CKPT_DEL_BAD_HANDLE1_T, } CKPT_DEL_TC_TYPE; typedef enum { CKPT_FREE_GEN_T = 1 } CKPT_FREE_TC_TYPE; -- 2.7.4 _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel