tests/immsv/common/immtest.c | 2 +
tests/immsv/common/immtest.h | 1 +
tests/immsv/implementer/test_saImmOiAugmentCcbInitialize.c | 63 +++++-
tests/immsv/management/test_saImmOmCcbInitialize.c | 7 +
tests/immsv/management/test_saImmOmCcbObjectModify_2.c | 126 +++++++++++-
5 files changed, 173 insertions(+), 26 deletions(-)
New tests for transactional safe read
diff --git a/tests/immsv/common/immtest.c b/tests/immsv/common/immtest.c
--- a/tests/immsv/common/immtest.c
+++ b/tests/immsv/common/immtest.c
@@ -41,6 +41,8 @@ const SaNameT rootObj = {
.value = "rdn=root"
};
+const SaConstStringT rootObjS = "Obj1,rdn=root";
+
void (*test_setup)(void) = NULL;
void (*test_cleanup)(void) = NULL;
diff --git a/tests/immsv/common/immtest.h b/tests/immsv/common/immtest.h
--- a/tests/immsv/common/immtest.h
+++ b/tests/immsv/common/immtest.h
@@ -43,6 +43,7 @@ extern const SaImmClassNameT configClass
extern const SaImmClassNameT runtimeClassName;
extern const SaImmClassNameT nodanglingClassName;
extern const SaNameT rootObj;
+extern const SaConstStringT rootObjS;
/* Implementer globals */
extern SaImmHandleT immOiHandle;
diff --git a/tests/immsv/implementer/test_saImmOiAugmentCcbInitialize.c
b/tests/immsv/implementer/test_saImmOiAugmentCcbInitialize.c
--- a/tests/immsv/implementer/test_saImmOiAugmentCcbInitialize.c
+++ b/tests/immsv/implementer/test_saImmOiAugmentCcbInitialize.c
@@ -30,7 +30,9 @@ typedef struct ImmThreadArg {
static int objectDispatchThreadIsSet = 0;
static int classDispatchThreadIsSet = 0;
static int useAdminOwner = 0;
-static int testValidate = 0;
+static int testCcbValidate = 0;
+static int testAugmentSafeReadInCompleted = 0;
+static int testModificationInCompleted = 0;
static SaAisErrorT globalRc = SA_AIS_OK;
static const SaNameT rdnObj1 = {sizeof("Obj1"), "Obj1"};
@@ -133,10 +135,27 @@ static void saImmOiCcbApplyCallback(SaIm
static SaAisErrorT saImmOiCcbCompletedCallback(SaImmOiHandleT immOiHandle,
SaImmOiCcbIdT ccbId)
{
+ SaAisErrorT err = SA_AIS_OK;
+ SaImmCcbHandleT ccbHandle=0LL;
+ SaImmAdminOwnerHandleT ownerHandle=0LL;
+ SaImmAttrValuesT_2** attributes=NULL;
TRACE_ENTER2();
callbackCounter++;
+ if(testAugmentSafeReadInCompleted) {
+ globalRc = err = saImmOiAugmentCcbInitialize(immOiHandle, ccbId,
&ccbHandle, &ownerHandle);
+ if(err == SA_AIS_OK) {
+ globalRc = err = saImmOmCcbObjectRead(ccbHandle,
"opensafImm=opensafImm,safApp=safImmService", NULL, &attributes);
+ err = saImmOmCcbApply(ccbHandle);
+ }
+ } else if(testModificationInCompleted) {
+ globalRc = err = saImmOiAugmentCcbInitialize(immOiHandle, ccbId,
&ccbHandle, &ownerHandle);
+ if(err == SA_AIS_OK) {
+ globalRc = err = saImmOmCcbObjectDelete_o3(ccbHandle,
(SaConstStringT) rdnObj1.value);
+ err = saImmOmCcbApply(ccbHandle);
+ }
+ }
TRACE_LEAVE2();
- return saImmOiCcbCompletedCallback_response;
+ return (testAugmentSafeReadInCompleted) ? err :
saImmOiCcbCompletedCallback_response;
}
static SaAisErrorT saImmOiCcbObjectCreateCallback(SaImmOiHandleT immOiHandle,
@@ -233,7 +252,7 @@ static SaAisErrorT saImmOiAugCcbObjectMo
if(useAdminOwner)
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
if((rc = saImmOmCcbObjectModify_2(ccbHandle, &rdnObj2, attrMods)) ==
SA_AIS_OK) {
- if(testValidate) {
+ if(testCcbValidate) {
globalRc = saImmOmCcbValidate(ccbHandle);
} //else {
rc = saImmOmCcbApply(ccbHandle);
@@ -512,7 +531,9 @@ static void saImmOiCcbAugmentInitialize_
assert(callbackCounter == 1);
- safassert(saImmOmCcbApply(ccbHandle), SA_AIS_OK);
+ rc = saImmOmCcbApply(ccbHandle);
+
+ if(!testModificationInCompleted) safassert(rc, SA_AIS_OK);
/* Wait for completed and apply collbacks */
while(callbackCounter != 3 && threadCounter == 1)
@@ -523,14 +544,14 @@ static void saImmOiCcbAugmentInitialize_
if ((rc = saImmOmCcbObjectDelete(ccbHandle, &rdnObj1)) != SA_AIS_OK)
goto done;
- assert(callbackCounter == 1);
+ assert(callbackCounter == 1);
safassert(saImmOmCcbApply(ccbHandle), SA_AIS_OK);
done:
pthread_join(threadid, NULL);
- if(!testValidate) {
+ if(!testCcbValidate && !testAugmentSafeReadInCompleted &&
!testModificationInCompleted) {
test_validate(rc, SA_AIS_OK);
}
@@ -734,13 +755,39 @@ static void saImmOiCcbAugmentInitialize_
*/
TRACE_ENTER();
- testValidate = 1;
+ testCcbValidate = 1;
saImmOiCcbAugmentInitialize_02();
test_validate(globalRc, SA_AIS_ERR_BAD_OPERATION);
TRACE_LEAVE();
}
+static void saImmOiCcbAugmentInitialize_06(void)
+{
+ TRACE_ENTER();
+
+ testCcbValidate = 0;
+ testAugmentSafeReadInCompleted = 1;
+ testModificationInCompleted = 0;
+ saImmOiCcbAugmentInitialize_02();
+ test_validate(globalRc, SA_AIS_OK);
+ testAugmentSafeReadInCompleted = 0;
+ TRACE_LEAVE();
+}
+
+static void saImmOiCcbAugmentInitialize_07(void)
+{
+ TRACE_ENTER();
+
+ testCcbValidate = 0;
+ testAugmentSafeReadInCompleted = 0;
+ testModificationInCompleted = 1;
+ saImmOiCcbAugmentInitialize_02();
+ test_validate(globalRc, SA_AIS_ERR_FAILED_OPERATION);
+ testModificationInCompleted = 0;
+ TRACE_LEAVE();
+}
+
__attribute__ ((constructor)) static void
saImmOiCcbAugmentInitialize_constructor(void)
{
test_suite_add(6, "Augmented CCBs");
@@ -749,5 +796,7 @@ static void saImmOiCcbAugmentInitialize_
test_case_add(6, saImmOiCcbAugmentInitialize_03,
"saImmOiCcbAugmentInitialize - SA_AIS_OK - two object implementers: modify,
delete");
test_case_add(6, saImmOiCcbAugmentInitialize_04,
"saImmOiCcbAugmentInitialize - SA_AIS_OK - two object implementers: modify and
delete with saImmOmAdminOwnerSet");
test_case_add(6, saImmOiCcbAugmentInitialize_05,
"saImmOiCcbAugmentInitialize - SA_AIS_ERR_BAD_OPERATION - saImmOmValidate not
allowed in augmentation");
+ test_case_add(6, saImmOiCcbAugmentInitialize_06,
"saImmOiCcbAugmentInitialize - SA_AIS_OK - augment with safe read allowed in
completed");
+ test_case_add(6, saImmOiCcbAugmentInitialize_07,
"saImmOiCcbAugmentInitialize - SA_AIS_ERR_FAIlED_OPERATION - augment with
mutation (delete) NOT allowed in completed");
}
diff --git a/tests/immsv/management/test_saImmOmCcbInitialize.c
b/tests/immsv/management/test_saImmOmCcbInitialize.c
--- a/tests/immsv/management/test_saImmOmCcbInitialize.c
+++ b/tests/immsv/management/test_saImmOmCcbInitialize.c
@@ -177,6 +177,9 @@ extern void saImmOmCcbAbort_02(void);
extern void saImmOmCcbAbort_03(void);
extern void saImmOmCcbValidate_01(void);
extern void saImmOmCcbValidate_02(void);
+extern void saImmOmCcbObjectRead_01(void);
+extern void saImmOmCcbObjectRead_02(void);
+extern void saImmOmCcbObjectRead_03(void);
__attribute__ ((constructor)) static void saImmOmInitialize_constructor(void)
{
@@ -261,5 +264,9 @@ extern void saImmOmCcbValidate_02(void);
test_case_add(6, saImmOmCcbAbort_03, "saImmOmCcbAbort after apply with
lower imm version - SA_AIS_ERR_VERSION");
test_case_add(6, saImmOmCcbValidate_01, "saImmOmCcbValidate followed by
apply - SA_AIS_OK");
test_case_add(6, saImmOmCcbValidate_02, "saImmOmCcbValidate followed by
abort - SA_AIS_OK");
+
+ test_case_add(6, saImmOmCcbObjectRead_01, "saImmOmCcbObjectRead Normal
Case - SA_AIS_OK");
+ test_case_add(6, saImmOmCcbObjectRead_02, "saImmOmCcbObjectRead escalated
to modify - SA_AIS_OK");
+ test_case_add(6, saImmOmCcbObjectRead_03, "saImmOmCcbObjectRead escalated
to delete - SA_AIS_OK");
}
diff --git a/tests/immsv/management/test_saImmOmCcbObjectModify_2.c
b/tests/immsv/management/test_saImmOmCcbObjectModify_2.c
--- a/tests/immsv/management/test_saImmOmCcbObjectModify_2.c
+++ b/tests/immsv/management/test_saImmOmCcbObjectModify_2.c
@@ -23,12 +23,14 @@ static const SaNameT rdnObj2 = {sizeof("
static SaNameT dnObj1;
static SaNameT dnObj2;
static const SaNameT *dnObjs[] = {&dnObj1, NULL};
+static SaImmAttrValuesT_2** attributes;
static SaAisErrorT config_object_create(SaImmHandleT immHandle,
SaImmAdminOwnerHandleT ownerHandle,
+ SaImmCcbHandleT ccbHandle,
const SaNameT *parentName)
{
- SaImmCcbHandleT ccbHandle;
+ SaAisErrorT rc = SA_AIS_OK;
const SaNameT* nameValues[] = {&rdnObj1, NULL};
SaImmAttrValuesT_2 v2 = {"rdn", SA_IMM_ATTR_SANAMET, 1,
(void**)nameValues};
SaUint32T int1Value1 = __LINE__;
@@ -41,11 +43,15 @@ static SaAisErrorT config_object_create(
SaImmAttrValuesT_2 v3 = {"attr3", SA_IMM_ATTR_SASTRINGT, 3,
(void**)str2Values};
SaImmAttrValuesT_2 v4 = {"attr4", SA_IMM_ATTR_SASTRINGT, 1,
(void**)strValues};
const SaImmAttrValuesT_2 * attrValues[] = {&v1, &v2, &v3, &v4, NULL};
+ bool localCcb = (ccbHandle == 0LL);
- safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
+ if(localCcb) {safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle),
SA_AIS_OK);}
safassert(saImmOmCcbObjectCreate_2(ccbHandle, configClassName, parentName,
attrValues), SA_AIS_OK);
- safassert(saImmOmCcbApply(ccbHandle), SA_AIS_OK);
- return saImmOmCcbFinalize(ccbHandle);
+ if(localCcb) {
+ safassert(saImmOmCcbApply(ccbHandle), SA_AIS_OK);
+ rc = saImmOmCcbFinalize(ccbHandle);
+ }
+ return rc;
}
static SaAisErrorT config_object_delete(SaImmHandleT immHandle,
@@ -54,7 +60,7 @@ static SaAisErrorT config_object_delete(
SaImmCcbHandleT ccbHandle;
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
- safassert(saImmOmCcbObjectDelete(ccbHandle, &dnObj1), SA_AIS_OK);
+ saImmOmCcbObjectDelete(ccbHandle, &dnObj1);
safassert(saImmOmCcbApply(ccbHandle), SA_AIS_OK);
return saImmOmCcbFinalize(ccbHandle);
}
@@ -74,7 +80,7 @@ void saImmOmCcbObjectModify_2_01(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
@@ -103,7 +109,7 @@ void saImmOmCcbObjectModify_2_02(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
/* invalid handle */
@@ -146,7 +152,7 @@ void saImmOmCcbObjectModify_2_03(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
@@ -198,7 +204,7 @@ void saImmOmCcbObjectModify_2_04(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_SUBTREE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerRelease(ownerHandle, objectNames,
SA_IMM_SUBTREE), SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
rc = saImmOmCcbObjectModify_2(ccbHandle, &dnObj1, attrMods);
@@ -230,7 +236,7 @@ void saImmOmCcbObjectModify_2_05(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, SA_IMM_CCB_REGISTERED_OI,
&ccbHandle), SA_AIS_OK);
/*
@@ -280,7 +286,7 @@ void saImmOmCcbObjectModify_2_06(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle1), SA_AIS_OK);
safassert(saImmOmCcbObjectModify_2(ccbHandle1, &dnObj1, attrMods),
SA_AIS_OK);
@@ -311,7 +317,7 @@ void saImmOmCcbObjectModify_2_07(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
@@ -339,7 +345,7 @@ void saImmOmCcbObjectModify_2_08(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
@@ -366,7 +372,7 @@ void saImmOmCcbObjectModify_2_09(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
@@ -393,7 +399,7 @@ void saImmOmCcbObjectModify_2_10(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
@@ -421,7 +427,7 @@ void saImmOmCcbObjectModify_2_11(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
@@ -453,7 +459,7 @@ void saImmOmCcbObjectModify_2_12(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
@@ -502,7 +508,7 @@ void saImmOmCcbObjectModify_2_13(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
@@ -571,7 +577,7 @@ void saImmOmCcbObjectModify_2_14(void)
safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
- safassert(config_object_create(immOmHandle, ownerHandle, &rootObj),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
@@ -1024,6 +1030,88 @@ void saImmOmCcbObjectModify_2_24(void) {
safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
}
+void saImmOmCcbObjectRead_01(void)
+{
+ //SaVersionT immVersion = {'A', 0x2, 0x11};
+ const SaImmAdminOwnerNameT adminOwnerName = (SaImmAdminOwnerNameT)
__FUNCTION__;
+ SaImmAdminOwnerHandleT ownerHandle;
+ SaImmCcbHandleT ccbHandle;
+ const SaNameT *objectNames[] = {&rootObj, NULL};
+ SaAisErrorT err=SA_AIS_OK;
+ safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
+ safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
+ safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
+ safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, ccbHandle,
&rootObj), SA_AIS_OK);
+
+ err = saImmOmCcbObjectRead(ccbHandle, rootObjS, NULL, &attributes);
+ err = saImmOmCcbObjectRead(ccbHandle, "rdn=root", NULL, &attributes);
+ test_validate(err, SA_AIS_OK);
+
+ safassert(saImmOmCcbFinalize(ccbHandle), SA_AIS_OK);
+ safassert(config_object_delete(immOmHandle, ownerHandle), SA_AIS_OK);
+ safassert(saImmOmAdminOwnerFinalize(ownerHandle), SA_AIS_OK);
+ safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
+}
+
+void saImmOmCcbObjectRead_02(void)
+{
+ SaAisErrorT err=SA_AIS_OK;
+ //SaVersionT immVersion = {'A', 0x2, 0x11};
+ const SaImmAdminOwnerNameT adminOwnerName = (SaImmAdminOwnerNameT)
__FUNCTION__;
+ SaImmAdminOwnerHandleT ownerHandle;
+ SaImmCcbHandleT ccbHandle;
+ const SaNameT *objectNames[] = {&rootObj, NULL};
+ SaUint32T int1Value1 = __LINE__;
+ SaUint32T* int1Values[] = {&int1Value1};
+ SaImmAttrValuesT_2 v1 = {"attr1", SA_IMM_ATTR_SAUINT32T, 1,
(void**)int1Values};
+ SaImmAttrModificationT_2 attrMod = {SA_IMM_ATTR_VALUES_REPLACE, v1};
+ const SaImmAttrModificationT_2 *attrMods[] = {&attrMod, NULL};
+
+ safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
+ safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
+ safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
+ safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
+ safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
+
+ err = saImmOmCcbObjectRead(ccbHandle, rootObjS, NULL, &attributes);
+ err = saImmOmCcbObjectModify_2(ccbHandle, &dnObj1, attrMods);
+ safassert(saImmOmCcbFinalize(ccbHandle), SA_AIS_OK);
+ safassert(config_object_delete(immOmHandle, ownerHandle), SA_AIS_OK);
+ safassert(saImmOmAdminOwnerFinalize(ownerHandle), SA_AIS_OK);
+ safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
+
+ test_validate(err, SA_AIS_OK);
+}
+
+void saImmOmCcbObjectRead_03(void)
+{
+ SaAisErrorT err=SA_AIS_OK;
+ //SaVersionT immVersion = {'A', 0x2, 0x11};
+ const SaImmAdminOwnerNameT adminOwnerName = (SaImmAdminOwnerNameT)
__FUNCTION__;
+ SaImmAdminOwnerHandleT ownerHandle;
+ SaImmCcbHandleT ccbHandle;
+ const SaNameT *objectNames[] = {&rootObj, NULL};
+
+ safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
+ safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName,
SA_TRUE, &ownerHandle), SA_AIS_OK);
+ safassert(saImmOmAdminOwnerSet(ownerHandle, objectNames, SA_IMM_ONE),
SA_AIS_OK);
+ safassert(config_object_create(immOmHandle, ownerHandle, 0LL, &rootObj),
SA_AIS_OK);
+ safassert(saImmOmAdminOwnerSet(ownerHandle, dnObjs, SA_IMM_ONE),
SA_AIS_OK);
+ safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
+
+ err = saImmOmCcbObjectRead(ccbHandle, rootObjS, NULL, &attributes);
+ err = saImmOmCcbObjectDelete(ccbHandle, &dnObj1);
+ safassert(saImmOmCcbFinalize(ccbHandle), SA_AIS_OK);
+ safassert(config_object_delete(immOmHandle, ownerHandle), SA_AIS_OK);
+ safassert(saImmOmAdminOwnerFinalize(ownerHandle), SA_AIS_OK);
+ safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
+
+ test_validate(err, SA_AIS_OK);
+}
+
+
__attribute__ ((constructor)) static void
saImmOmCcbObjectModify_2_constructor(void)
{
dnObj1.length = (SaUint16T) sprintf((char*) dnObj1.value, "%s,%s",
rdnObj1.value, rootObj.value);
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel