---
 src/ckpt/apitest/test_cpa.c      | 65 ++++++++++++++++++++++++++++++++++++++++
 src/ckpt/apitest/test_cpa_util.c |  5 ++++
 src/ckpt/apitest/test_cpsv.h     |  1 +
 3 files changed, 71 insertions(+)

diff --git a/src/ckpt/apitest/test_cpa.c b/src/ckpt/apitest/test_cpa.c
index 51f3c99..4a94a31 100644
--- a/src/ckpt/apitest/test_cpa.c
+++ b/src/ckpt/apitest/test_cpa.c
@@ -4350,6 +4350,67 @@ final1:
        test_validate(result, TEST_PASS);
 }
 
+void cpsv_it_seccreate_21()
+{
+       int result;
+       printHead(
+           "To verify Section create after Closing  the checkpoint designated 
by checkpointHandle");
+       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_ckptClose(CKPT_CLOSE_SUCCESS3_T, TEST_CONFIG_MODE);
+       if (result != TEST_PASS)
+               goto final3;
+
+       result = test_ckptUnlink(CKPT_UNLINK_NOT_EXIST2_T, TEST_NONCONFIG_MODE);
+       goto final2;
+
+       result = test_ckptSectionCreate(CKPT_SECTION_CREATE_BAD_HANDLE1_T,
+                                       TEST_NONCONFIG_MODE);
+       printResult(result);
+       test_validate(result, TEST_PASS);
+
+final3:
+       test_ckpt_cleanup(CPSV_CLEAN_COLLOCATED_REPLICAS_CKPT);
+final2:
+       test_cpsv_cleanup(CPSV_CLEAN_INIT_SUCCESS_T);
+final1:
+       printResult(result);
+       test_validate(result, TEST_PASS);
+}
+
+void cpsv_it_seccreate_22()
+{
+       int result;
+       printHead(
+           "To verify that section create after finalize");
+       result = test_ckptInitialize(CKPT_INIT_SUCCESS_T, TEST_CONFIG_MODE);
+       if (result != TEST_PASS)
+       goto final;
+
+       result = test_ckptFinalize(CKPT_FIN_SUCCESS_T, TEST_CONFIG_MODE);
+       if (result != TEST_PASS)
+       goto final;
+
+       result = test_ckptOpen(CKPT_OPEN_BAD_HANDLE2_T, TEST_NONCONFIG_MODE);
+
+       result = test_ckptClose(CKPT_CLOSE_BAD_HANDLE2_T, TEST_CONFIG_MODE);
+       if (result != TEST_PASS)
+       goto final;
+       result = test_ckptSectionCreate(CKPT_SECTION_CREATE_BAD_HANDLE1_T,
+                                       TEST_NONCONFIG_MODE);
+
+final:
+       printResult(result);
+       test_validate(result, TEST_PASS);
+}
+
 /******* saCkptSectionDelete ******/
 
 void cpsv_it_secdel_01()
@@ -8304,6 +8365,10 @@ __attribute__((constructor)) static void 
ckpt_cpa_test_constructor(void)
        test_case_add(
            11, cpsv_it_seccreate_20,
            "To verify section create with section id length longer than 
MAX_SEC_ID_LEN(50)");
+       test_case_add(11, cpsv_it_seccreate_21,
+                     "To verify Section create after Closing  the checkpoint 
designated by checkpointHandle");
+       test_case_add(11, cpsv_it_seccreate_22,
+                     "To verify that section create after finalize");
 
        test_suite_add(12, "CKPT API saCkptSectionDelete()");
        test_case_add(12, cpsv_it_secdel_01,
diff --git a/src/ckpt/apitest/test_cpa_util.c b/src/ckpt/apitest/test_cpa_util.c
index bc52ff9..787d765 100644
--- a/src/ckpt/apitest/test_cpa_util.c
+++ b/src/ckpt/apitest/test_cpa_util.c
@@ -983,6 +983,11 @@ struct SafCheckpointSectionCreate API_SectionCreate[] = {
            {&tcd.all_replicas_Writehdl, &tcd.section_attr_with_too_long_id,
             tcd.data1, &tcd.size, SA_AIS_ERR_INVALID_PARAM,
             "Section id long_id Created in all replicas ckpt"},
+       [CKPT_SECTION_CREATE_BAD_HANDLE1_T] = {&tcd.all_replicas_Createhdl,
+                                             &tcd.general_attr, tcd.data1,
+                                             &tcd.size, SA_AIS_ERR_BAD_HANDLE,
+                                             "Section Create with bad handle"},
+
 };
 
 int test_ckptSectionCreate(int i, CONFIG_FLAG cfg_flg)
diff --git a/src/ckpt/apitest/test_cpsv.h b/src/ckpt/apitest/test_cpsv.h
index 7acb622..df27a98 100644
--- a/src/ckpt/apitest/test_cpsv.h
+++ b/src/ckpt/apitest/test_cpsv.h
@@ -387,6 +387,7 @@ typedef enum {
   CKPT_SECTION_CREATE_INVALID_PARAM3_T,
   CKPT_SECTION_CREATE_LONG_SECION_ID_SUCCESS_T,
   CKPT_SECTION_CREATE_TOO_LONG_SECION_ID_SUCCESS_T,
+  CKPT_SECTION_CREATE_BAD_HANDLE1_T,
 } CKPT_SECTION_CREATE_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