---
 src/ckpt/apitest/test_cpa.c      | 85 ++++++++++++++++++++++++++++++++++++++++
 src/ckpt/apitest/test_cpa_util.c |  4 ++
 src/ckpt/apitest/test_cpsv.h     |  1 +
 3 files changed, 90 insertions(+)

diff --git a/src/ckpt/apitest/test_cpa.c b/src/ckpt/apitest/test_cpa.c
index 9050713..bef68ca 100644
--- a/src/ckpt/apitest/test_cpa.c
+++ b/src/ckpt/apitest/test_cpa.c
@@ -4847,6 +4847,87 @@ final1:
        test_validate(result, TEST_PASS);
 }
 
+void cpsv_it_expset_08()
+{
+       int result;
+       printHead("To verify section expiration set 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_ckptExpirationSet(CKPT_EXP_BAD_HANDLE1_T, TEST_NONCONFIG_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_expset_09()
+{
+       int result;
+       printHead("To verify section expiration set  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_ckptExpirationSet(CKPT_EXP_BAD_HANDLE1_T, TEST_NONCONFIG_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);
+}
+
 /********* saCkptSectionIterationInitialize *****/
 
 void cpsv_it_iterinit_01()
@@ -8481,6 +8562,10 @@ __attribute__((constructor)) static void 
ckpt_cpa_test_constructor(void)
            "To verify section exp set when ckpt is opened in read mode");
        test_case_add(13, cpsv_it_expset_07,
                      "To verify section exp set with invalid sectionid");
+       test_case_add(13, cpsv_it_expset_08,
+                     "To verify section exp set after finalize");
+       test_case_add(13, cpsv_it_expset_09,
+                     "To verify section exp set after close");
 
        test_suite_add(14, "CKPT API saCkptSectionIterationInitialize()");
        test_case_add(14, cpsv_it_iterinit_01,
diff --git a/src/ckpt/apitest/test_cpa_util.c b/src/ckpt/apitest/test_cpa_util.c
index 8287978..f12dff4 100644
--- a/src/ckpt/apitest/test_cpa_util.c
+++ b/src/ckpt/apitest/test_cpa_util.c
@@ -1234,6 +1234,10 @@ struct SafCheckpointExpirationTimeSet 
API_ExpirationSet[] = {
        [CKPT_EXP_SUCCESS2_T] = {&tcd.active_colloc_Writehdl, &tcd.section1,
                                 APP_TIMEOUT, SA_AIS_OK,
                                 "Expiration Timeset success for ckpt4"},
+       [CKPT_EXP_BAD_HANDLE1_T] = {&tcd.all_replicas_Createhdl, &tcd.section1,
+                                  APP_TIMEOUT, SA_AIS_ERR_BAD_HANDLE,
+                                  "Expiration Timeset bad handle"},
+
 };
 
 int test_ckptExpirationSet(int i, CONFIG_FLAG cfg_flg)
diff --git a/src/ckpt/apitest/test_cpsv.h b/src/ckpt/apitest/test_cpsv.h
index 8c2888f..ec06a67 100644
--- a/src/ckpt/apitest/test_cpsv.h
+++ b/src/ckpt/apitest/test_cpsv.h
@@ -403,6 +403,7 @@ typedef enum {
   CKPT_EXP_SUCCESS_T,
   CKPT_EXP_ERR_NOT_EXIST2_T,
   CKPT_EXP_SUCCESS2_T,
+  CKPT_EXP_BAD_HANDLE1_T,
 } CKPT_EXP_TC_TYPE;
 
 typedef enum {
-- 
2.7.4



_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to