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

diff --git a/src/ckpt/apitest/test_cpa.c b/src/ckpt/apitest/test_cpa.c
index eca13d6..9813bc2 100644
--- a/src/ckpt/apitest/test_cpa.c
+++ b/src/ckpt/apitest/test_cpa.c
@@ -6461,6 +6461,58 @@ final1:
        test_validate(result, TEST_PASS);
 }
 
+void cpsv_it_read_16()
+{
+       int result;
+       printHead("To verify read after checkpoint is closed");
+       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_ckptOpen(CKPT_OPEN_ALL_READ_SUCCESS_T, TEST_CONFIG_MODE);
+       if (result != TEST_PASS)
+               goto final3;
+
+       result = test_ckptSectionCreate(CKPT_SECTION_CREATE_SUCCESS_T,
+                                       TEST_CONFIG_MODE);
+       if (result != TEST_PASS)
+               goto final3;
+
+       result = test_ckptWrite(CKPT_WRITE_SUCCESS_T, TEST_NONCONFIG_MODE);
+       if (result != TEST_PASS)
+       goto final3;
+
+       result = test_ckptClose(CKPT_CLOSE_SUCCESS3_T, TEST_CONFIG_MODE);
+       if (result != TEST_PASS)
+       goto final2;
+
+       result = test_ckptClose(CKPT_CLOSE_SUCCESS4_T, TEST_CONFIG_MODE);
+       if (result != TEST_PASS)
+       goto final2;
+       result = test_ckptClose(CKPT_CLOSE_SUCCESS5_T, TEST_CONFIG_MODE);
+       if (result != TEST_PASS)
+       goto final2;
+
+       result = test_ckptRead(CKPT_READ_BAD_HANDLE1_T, TEST_NONCONFIG_MODE);
+
+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);
+}
+
 /********* saCkptCheckpointSynchronize **************/
 
 void cpsv_it_sync_01()
@@ -8638,6 +8690,8 @@ __attribute__((constructor)) static void 
ckpt_cpa_test_constructor(void)
                      "To verify read api when there is no data to be read");
        test_case_add(18, cpsv_it_read_15,
                      "To verify read api with NULL data buffer");
+       test_case_add(18, cpsv_it_read_16,
+                     "To verify read after checkpoint is closed");
 
        test_suite_add(19, "CKPT API saCkptCheckpointSynchronize()");
        test_case_add(19, cpsv_it_sync_01, "To verify sync api");
diff --git a/src/ckpt/apitest/test_cpa_util.c b/src/ckpt/apitest/test_cpa_util.c
index d7f3c87..7fbc048 100644
--- a/src/ckpt/apitest/test_cpa_util.c
+++ b/src/ckpt/apitest/test_cpa_util.c
@@ -1606,6 +1606,9 @@ struct SafCheckpointRead API_Read[] = {
                                    &tcd.default_read, &tcd.nOfE, &tcd.ind,
                                    SA_AIS_ERR_NOT_EXIST,
                                    "Read from default section"},
+       [CKPT_READ_BAD_HANDLE1_T] = {&tcd.active_replica_Readhdl,
+                                    &tcd.general_read, &tcd.nOfE, &tcd.ind,
+                                    SA_AIS_ERR_BAD_HANDLE, "Read from ckpt2"},
 
 };
 
diff --git a/src/ckpt/apitest/test_cpsv.h b/src/ckpt/apitest/test_cpsv.h
index 07db47c..b3c36bf 100644
--- a/src/ckpt/apitest/test_cpsv.h
+++ b/src/ckpt/apitest/test_cpsv.h
@@ -461,6 +461,7 @@ typedef enum {
   CKPT_READ_FIN_HANDLE_T,
   CKPT_READ_NULL_INDEX_T,
   CKPT_READ_NOT_EXIST3_T,
+  CKPT_READ_BAD_HANDLE1_T,
 } CKPT_READ_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