tests/cpsv/test_cpa.c | 35 ++++++++++++++++++++++++++++++++++-
tests/cpsv/test_cpa_util.c | 2 ++
tests/cpsv/test_cpsv.h | 1 +
tests/cpsv/test_cpsv_conf.h | 2 ++
4 files changed, 39 insertions(+), 1 deletions(-)
diff --git a/tests/cpsv/test_cpa.c b/tests/cpsv/test_cpa.c
--- a/tests/cpsv/test_cpa.c
+++ b/tests/cpsv/test_cpa.c
@@ -303,9 +303,12 @@ void fill_testcase_data()
tcd.invalidSection.idLen = 3;
tcd.invalidSection.id = tcd.sec_id4;
- tcd.long_section_id.idLen = 30;
+ tcd.long_section_id.idLen = 29;
tcd.long_section_id.id = (SaUint8T *)"long_section_id_size=30_00000";
+ tcd.too_long_section_id.idLen = 70;
+ tcd.too_long_section_id.id = (SaUint8T
*)"long_section_id_size=70_000000000000000000000000000000000000000000000";
+
fill_sec_attri(&tcd.general_attr,&tcd.section1,SA_TIME_ONE_DAY);
fill_sec_attri(&tcd.expiration_attr,&tcd.section2,SA_TIME_END);
fill_sec_attri(&tcd.section_attr,&tcd.section3,SA_TIME_ONE_DAY);
@@ -315,6 +318,7 @@ void fill_testcase_data()
fill_sec_attri(&tcd.special_attr3,&tcd.section7,SA_TIME_END);
fill_sec_attri(&tcd.invalid_attr,&tcd.invalid_sec,SA_TIME_END);
fill_sec_attri(&tcd.section_attr_with_long_id, &tcd.long_section_id,
SA_TIME_END);
+ fill_sec_attri(&tcd.section_attr_with_too_long_id,
&tcd.too_long_section_id, SA_TIME_END);
strcpy(tcd.data1,"This is data1");
strcpy(tcd.data2,"This is data2");
@@ -3679,6 +3683,34 @@ final1:
test_validate(result, TEST_PASS);
}
+void cpsv_it_seccreate_20()
+{
+ int result;
+ printHead("To verify section create with section id length longer than
MAX_SIZE(30)");
+ result = test_ckptInitialize(CKPT_INIT_SUCCESS_T,TEST_CONFIG_MODE);
+ if(result != TEST_PASS)
+ goto final1;
+
+ tcd.all_replicas.maxSectionIdSize = 100;
+ 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_TOO_LONG_SECION_ID_SUCCESS_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);
+}
+
/******* saCkptSectionDelete ******/
@@ -6932,6 +6964,7 @@ final1:
test_case_add(11, cpsv_it_seccreate_17, "To verify section create with
section idSize zero");
test_case_add(11, cpsv_it_seccreate_18, "To verify free of section create
with generated sectionId");
test_case_add(11, cpsv_it_seccreate_19, "To verify section create with long
section id");
+ test_case_add(11, cpsv_it_seccreate_20, "To verify section create with
section id length longer than MAX_SIZE(30)");
test_suite_add(12, "CKPT API saCkptSectionDelete()");
test_case_add(12, cpsv_it_secdel_01, "To verify section delete with
arbitrary handle");
diff --git a/tests/cpsv/test_cpa_util.c b/tests/cpsv/test_cpa_util.c
--- a/tests/cpsv/test_cpa_util.c
+++ b/tests/cpsv/test_cpa_util.c
@@ -674,6 +674,8 @@ struct SafCheckpointSectionCreate API_Se
[CKPT_SECTION_CREATE_LONG_SECION_ID_SUCCESS_T] =
{&tcd.all_replicas_Writehdl ,&tcd.section_attr_with_long_id,tcd.data1,&tcd.size,
SA_AIS_OK,"Section id long_id
Created in all replicas ckpt"},
+ [CKPT_SECTION_CREATE_TOO_LONG_SECION_ID_SUCCESS_T] =
{&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"},
};
diff --git a/tests/cpsv/test_cpsv.h b/tests/cpsv/test_cpsv.h
--- a/tests/cpsv/test_cpsv.h
+++ b/tests/cpsv/test_cpsv.h
@@ -372,6 +372,7 @@ typedef enum {
CKPT_SECTION_CREATE_GEN2_T,
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_TC_TYPE;
diff --git a/tests/cpsv/test_cpsv_conf.h b/tests/cpsv/test_cpsv_conf.h
--- a/tests/cpsv/test_cpsv_conf.h
+++ b/tests/cpsv/test_cpsv_conf.h
@@ -68,8 +68,10 @@ struct cpsv_testcase_data
SaCkptSectionIdT
section1,section2,section3,section4,section5,section6,section7,invalid_sec,invalidsection,gen_sec,invalidSection,gen_sec_del;
SaCkptSectionIdT long_section_id;
+ SaCkptSectionIdT too_long_section_id;
SaCkptSectionCreationAttributesT
general_attr,expiration_attr,section_attr,special_attr,special_attr2,special_attr3,invalid_attr,multi_attr;
SaCkptSectionCreationAttributesT section_attr_with_long_id;
+ SaCkptSectionCreationAttributesT section_attr_with_too_long_id;
char data1[14],data2[14],data3[14];
SaSizeT size,size_zero;
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel