From: Chris B. <buc...@us...> - 2013-05-29 18:52:11
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "sfcb - Small Footprint CIM Broker". The branch, master has been updated via b1cc1c88698c708c71c631ae29d0efcc14ebfb45 (commit) via a8de78de69d582274f2c0c4f7bc01ce3c00b8742 (commit) from 77222df9ea5b733d8e6bbe82b143bdc07ddf155a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b1cc1c88698c708c71c631ae29d0efcc14ebfb45 Merge: a8de78d 77222df Author: buccella <buc...@li...> Date: Wed May 29 14:51:32 2013 -0400 Merging in sfcb-tix:#49 commit a8de78de69d582274f2c0c4f7bc01ce3c00b8742 Author: buccella <buc...@li...> Date: Wed May 22 21:45:27 2013 -0400 [sfcb-tix:#49] Cannot return EmbeddedInstance property from provider ----------------------------------------------------------------------- Summary of changes: cimXmlGen.c | 87 ++++++++++++-------- cimXmlGen.h | 2 +- constClass.c | 18 ++++ instance.c | 38 +++++++-- interopProvider.c | 9 +- objectImpl.c | 33 +++++++- objectImpl.h | 2 + test/TestProviders/cmpiTestIndicationProvider.c | 8 ++ test/TestProviders/cmpiTestInstanceProvider.c | 13 ++- .../tests/Test1EnumerateInstances.lines | 23 ++++- test/schema/root/cimv2/Test_Instance.mof | 3 + test/schema/root/interop/Test_Indication.mof | 1 + 12 files changed, 184 insertions(+), 53 deletions(-) diff --git a/cimXmlGen.c b/cimXmlGen.c index 7c67652..6d7abd9 100644 --- a/cimXmlGen.c +++ b/cimXmlGen.c @@ -50,14 +50,21 @@ extern CMPIData opGetKeyCharsAt(CMPIObjectPath * cop, unsigned int index, const char **name, CMPIStatus *rc); extern CMPIData __ift_internal_getPropertyAt(const CMPIInstance *ci, CMPICount i, char **name, - CMPIStatus *rc, int readonly); + CMPIStatus *rc, int readonly, + unsigned long* quals); extern int getCustomHostname(char *httpHost, char **hn, unsigned int len); const char *opGetClassNameChars(CMPIObjectPath * cop); +/* We introduce additional parameter in data2xml, use this macro when you want + * pass it, use the original when you want data2xml behave as usual */ +#define EMBDATA2XML(data,name,refname,btag,etag,sb,qsb,inst,param,embInst) \ + data2xml((data),(name),(refname),(btag),sizeof(btag)-1,(etag), \ + sizeof(etag)-1,(sb),(qsb),(inst),(param),(embInst)) + #define DATA2XML(data,name,refname,btag,etag,sb,qsb,inst,param) \ data2xml((data),(name),(refname),(btag),sizeof(btag)-1,(etag), \ - sizeof(etag)-1,(sb),(qsb),(inst),(param)) + sizeof(etag)-1,(sb),(qsb),(inst),(param),0) static int add_escaped_instance(UtilStringBuffer *sb, CMPIInstance *inst) { @@ -742,10 +749,9 @@ void data2xml(CMPIData *data, CMPIString *name, CMPIString *refName, char *bTag, int bTagLen, char *eTag, int eTagLen, UtilStringBuffer * sb, UtilStringBuffer * qsb, - int inst, int param) + int inst, int param, int embInst) { _SFCB_ENTER(TRACE_CIMXMLPROC, "data2xml"); - char *type; if (data->type & CMPI_ARRAY) { @@ -764,7 +770,11 @@ data2xml(CMPIData *data, CMPIString *name, SFCB_APPENDCHARS_BLOCK(sb, "reference"); } else if (((data->type & ~CMPI_ARRAY) == CMPI_instance) || ((data->type & ~CMPI_ARRAY) == CMPI_class)) { - SFCB_APPENDCHARS_BLOCK(sb, "string\" EmbeddedObject=\"object"); + if (embInst == 1) { + SFCB_APPENDCHARS_BLOCK(sb, "\" EmbeddedObject=\"instance"); + } else { + SFCB_APPENDCHARS_BLOCK(sb, "\" EmbeddedObject=\"object"); + } } else { sb->ft->appendChars(sb, dataType(data->type)); } @@ -817,7 +827,11 @@ data2xml(CMPIData *data, CMPIString *name, else if (*type == '%') { sb->ft->appendBlock(sb, bTag, bTagLen); sb->ft->appendChars(sb, (char *) name->hdl); - SFCB_APPENDCHARS_BLOCK(sb, "\" EmbeddedObject=\"object"); + if (embInst == 1) { + SFCB_APPENDCHARS_BLOCK(sb, "\" EmbeddedObject=\"instance"); + } else { + SFCB_APPENDCHARS_BLOCK(sb, "\" EmbeddedObject=\"object"); + } if (param) SFCB_APPENDCHARS_BLOCK(sb, "\" PARAMTYPE=\"string\">\n"); else @@ -869,10 +883,14 @@ quals2xml(unsigned long quals, UtilStringBuffer * sb) SFCB_APPENDCHARS_BLOCK(sb, "<QUALIFIER NAME=\"Key\" TYPE=\"boolean\">\n" "<VALUE>TRUE</VALUE>\n</QUALIFIER>\n"); - if (quals & (ClProperty_Q_EmbeddedObject << 8)) + if ((quals & (ClProperty_Q_EmbeddedObject << 8)) && !(quals & (ClProperty_Q_EmbeddedInstance << 8))) SFCB_APPENDCHARS_BLOCK(sb, "<QUALIFIER NAME=\"EmbeddedObject\" TYPE=\"boolean\">\n" "<VALUE>TRUE</VALUE>\n</QUALIFIER>\n"); + if (quals & (ClProperty_Q_EmbeddedInstance << 8)) + SFCB_APPENDCHARS_BLOCK(sb, + "<QUALIFIER NAME=\"EmbeddedInstance\" TYPE=\"boolean\">\n" + "<VALUE>TRUE</VALUE>\n</QUALIFIER>\n"); } static void @@ -880,8 +898,7 @@ param2xml(CMPIParameter * pdata, CMPIConstClass * cls, ClParameter * parm, CMPIString *pname, UtilStringBuffer * sb, unsigned int flags) { ClClass *cl = (ClClass *) cls->hdl; - int i, - m; + int i, m; CMPIData data; CMPIString qname; char *etag = "</PARAMETER>\n"; @@ -947,12 +964,7 @@ int cls2xml(CMPIConstClass * cls, UtilStringBuffer * sb, unsigned int flags) { ClClass *cl = (ClClass *) cls->hdl; - int i, - m, - q, - qm, - p, - pm; + int i, m, q, qm, p, pm, embInst = 0; char *type, *superCls; CMPIString *name, @@ -1000,19 +1012,24 @@ cls2xml(CMPIConstClass * cls, UtilStringBuffer * sb, unsigned int flags) CMRelease(qname); sfcb_native_release_CMPIValue(qdata.type, &qdata.value); } - if (data.type & CMPI_ARRAY) - DATA2XML(&data, name, NULL, "<PROPERTY.ARRAY NAME=\"", - "</PROPERTY.ARRAY>\n", sb, qsb, 0, 0); + if (quals & ClProperty_Q_EmbeddedInstance) embInst = 1; + + if (data.type & CMPI_ARRAY) EMBDATA2XML(&data,name,NULL,"<PROPERTY.ARRAY NAME=\"", + "</PROPERTY.ARRAY>\n", sb, qsb, 0, 0, embInst); + else { type = dataType(data.type); if (*type == '*') { - DATA2XML(&data, name, refName, "<PROPERTY.REFERENCE NAME=\"", - "</PROPERTY.REFERENCE>\n", sb, qsb, 0, 0); - } else - DATA2XML(&data, name, NULL, "<PROPERTY NAME=\"", - "</PROPERTY>\n", sb, qsb, 0, 0); + EMBDATA2XML(&data,name,refName,"<PROPERTY.REFERENCE NAME=\"", + "</PROPERTY.REFERENCE>\n", sb, qsb, 0, 0, embInst); + + } + else EMBDATA2XML(&data,name,NULL,"<PROPERTY NAME=\"", "</PROPERTY>\n", + sb, qsb, 0, 0, embInst); + } CMRelease(name); + embInst = 0; } for (i = 0, m = ClClassGetMethodCount(cl); i < m; i++) { @@ -1064,9 +1081,11 @@ instance2xml(CMPIInstance *ci, UtilStringBuffer * sb, unsigned int flags) { ClInstance *inst = (ClInstance *) ci->hdl; int i, - m = ClInstanceGetPropertyCount(inst); + m = ClInstanceGetPropertyCount(inst), + embInst = 0; char *type; UtilStringBuffer *qsb = UtilFactory->newStrinBuffer(1024); + unsigned long quals; _SFCB_ENTER(TRACE_CIMXMLPROC, "instance2xml"); @@ -1085,19 +1104,20 @@ instance2xml(CMPIInstance *ci, UtilStringBuffer * sb, unsigned int flags) continue; } data = - __ift_internal_getPropertyAt(ci, i, (char **) &name.hdl, NULL, 1); + __ift_internal_getPropertyAt(ci, i, (char **) &name.hdl, NULL, 1, &quals); + + if (quals & ClProperty_Q_EmbeddedInstance) { + embInst = 1; + } if (data.type & CMPI_ARRAY) { - DATA2XML(&data, &name, NULL, "<PROPERTY.ARRAY NAME=\"", - "</PROPERTY.ARRAY>\n", sb, qsb, 1, 0); + EMBDATA2XML(&data,&name,NULL,"<PROPERTY.ARRAY NAME=\"", "</PROPERTY.ARRAY>\n", + sb, qsb, 1, 0, embInst); } else { type = dataType(data.type); - if (*type == '*') - DATA2XML(&data, &name, NULL, "<PROPERTY.REFERENCE NAME=\"", - "</PROPERTY.REFERENCE>\n", sb, qsb, 1, 0); - else - DATA2XML(&data, &name, NULL, "<PROPERTY NAME=\"", - "</PROPERTY>\n", sb, qsb, 1, 0); + if (*type == '*') EMBDATA2XML(&data,&name,NULL,"<PROPERTY.REFERENCE NAME=\"", + "</PROPERTY.REFERENCE>\n", sb, qsb, 1,0, embInst); + else EMBDATA2XML(&data,&name,NULL,"<PROPERTY NAME=\"", "</PROPERTY>\n", sb, qsb, 1,0, embInst); } if (data.type & (CMPI_ENC | CMPI_ARRAY)) { // don't get confused @@ -1105,6 +1125,7 @@ instance2xml(CMPIInstance *ci, UtilStringBuffer * sb, unsigned int flags) if ((data.state & ~CMPI_keyValue) == 0 && data.type != CMPI_instance) data.value.inst->ft->release(data.value.inst); } + embInst = 0; } SFCB_APPENDCHARS_BLOCK(sb, "</INSTANCE>\n"); diff --git a/cimXmlGen.h b/cimXmlGen.h index bbf9e85..46f25a9 100644 --- a/cimXmlGen.h +++ b/cimXmlGen.h @@ -61,7 +61,7 @@ extern char *XMLEscape(char *in, int *outlen); extern void data2xml(CMPIData *data, CMPIString *name, CMPIString *refName, char *bTag, int bTagLen, char *eTag, int eTagLen, UtilStringBuffer * sb, - UtilStringBuffer * qsb, int inst, int param); + UtilStringBuffer * qsb, int inst, int param, int embInst); CMPIType guessType(char *val); extern int invalid_int(const char *v, const CMPIType type); diff --git a/constClass.c b/constClass.c index a483255..db06c17 100644 --- a/constClass.c +++ b/constClass.c @@ -417,6 +417,24 @@ getPropQualifier(CMPIConstClass * cc, const char *cp, const char *cpq, return rv_notFound; } } + if (strcasecmp(cpq, "embeddedinstance") == 0) { + unsigned long quals; + getPropertyQualsAt(cc,p-1,NULL,&quals,NULL,rc); + if (quals & ClProperty_Q_EmbeddedInstance) { + rv.type = CMPI_boolean; + rv.state = CMPI_goodValue; + rv.value.boolean = 1; + if (rc) { + CMSetStatus(rc, CMPI_RC_OK); + } + return rv; + } else { + if (rc) { + CMSetStatus(rc, CMPI_RC_ERR_NOT_FOUND); + } + return rv_notFound; + } + } for (i = 0; i < num; i++) { if (ClClassGetPropQualifierAt(cls, p - 1, i, &rv, &n) == 0 diff --git a/instance.c b/instance.c index 1cb5755..6f335e5 100644 --- a/instance.c +++ b/instance.c @@ -218,11 +218,12 @@ __ift_clone(const CMPIInstance *instance, CMPIStatus *rc) CMPIData __ift_internal_getPropertyAt(const CMPIInstance *ci, CMPICount i, - char **name, CMPIStatus *rc, int readonly) + char **name, CMPIStatus *rc, int readonly, + unsigned long* quals) { ClInstance *inst = (ClInstance *) ci->hdl; CMPIData rv = { 0, CMPI_notFound, {0} }; - if (ClInstanceGetPropertyAt(inst, i, &rv, name, NULL)) { + if (ClInstanceGetPropertyAt(inst, i, &rv, name, quals)) { if (rc) CMSetStatus(rc, CMPI_RC_ERR_NO_SUCH_PROPERTY); return rv; @@ -268,7 +269,7 @@ __ift_getPropertyAt(const CMPIInstance *ci, CMPICount i, return rv; } - rv = __ift_internal_getPropertyAt(ci, i, &sname, rc, 0); + rv = __ift_internal_getPropertyAt(ci, i, &sname, rc, 0, NULL); if (name) { *name = sfcb_native_new_CMPIString(sname, NULL, 0); } @@ -321,6 +322,22 @@ __ift_getPropertyCount(const CMPIInstance *ci, CMPIStatus *rc) return (CMPICount) ClInstanceGetPropertyCount(inst); } +static CMPIStatus __ift_addPropertyQualifier(const CMPIInstance * instance, + const char *name, + const char *qualifier ) +{ + ClInstance *inst; + int rc; + + if (!instance->hdl) { + CMReturn(CMPI_RC_ERR_INVALID_HANDLE); + } + + inst = (ClInstance *) instance->hdl; + rc = ClInstanceAddPropertyQualifierSpecial(inst, name, qualifier); + CMReturn(rc); +} + static CMPIStatus __ift_setProperty(const CMPIInstance *instance, const char *name, const CMPIValue * value, CMPIType type) @@ -508,7 +525,7 @@ __ift_getObjectPath(const CMPIInstance *instance, CMPIStatus *rc) while (j--) { char *keyName; CMPIData d = - __ift_internal_getPropertyAt(instance, j, &keyName, &tmp, 1); + __ift_internal_getPropertyAt(instance, j, &keyName, &tmp, 1, NULL); if (d.state & CMPI_keyValue) { CMAddKey(cop, keyName, &d.value, d.type); f++; @@ -598,7 +615,7 @@ __ift_internal_setPropertyFilter(CMPIInstance *instance, iNew->property_list = __duplicate_list(propertyList); iNew->key_list = __duplicate_list(keys); for (j = 0, m = __ift_getPropertyCount(instance, &st); j < m; j++) { - data = __ift_internal_getPropertyAt(instance, j, &name, &st, 1); + data = __ift_internal_getPropertyAt(instance, j, &name, &st, 1, NULL); if (__contained_list((char **) propertyList, name) || __contained_list((char **) keys, name)) { if ((data.state & ~CMPI_keyValue) != 0) { @@ -769,7 +786,7 @@ instance2String(CMPIInstance *inst, CMPIStatus *rc) add(&buf, &bp, &bm, "\n"); for (i = 0, m = __ift_getPropertyCount(inst, rc); i < m; i++) { - data = __ift_internal_getPropertyAt(inst, i, &pname, rc, 1); + data = __ift_internal_getPropertyAt(inst, i, &pname, rc, 1, NULL); add(&buf, &bp, &bm, " "); add(&buf, &bp, &bm, pname); add(&buf, &bp, &bm, " = "); @@ -1107,6 +1124,7 @@ instFillDefaultProperties(struct native_instance *inst, pd = cc->ft->getPropertyAt(cc, pc, &pn, &ps); /* if this prop is an EmbeddedObject, force type to CMPI_instance to allow CMSetProperty with a CMPI_Instance */ + /* (also works for EmbeddedInstance, since the EmbeddedObject qual will also be set in that case */ CMPIData pqd = cc->ft->getPropQualifier(cc, CMGetCharsPtr(pn, NULL), "EmbeddedObject", NULL); if ((pqd.state == CMPI_goodValue) && (pqd.value.boolean == 1)) { pd.type = CMPI_instance; @@ -1127,6 +1145,14 @@ instFillDefaultProperties(struct native_instance *inst, } __ift_setProperty(&inst->instance, CMGetCharsPtr(pn, NULL), vp, pd.type); + + /* Copy EmbeddedInstance qualifier from the class to the instance, + so we know, what to put into CIM-XML */ + CMPIData pqd = cc->ft->getPropQualifier(cc, CMGetCharsPtr(pn, NULL), "EmbeddedInstance", NULL); + if ((pqd.state == CMPI_goodValue) && (pqd.value.string != NULL)) { + __ift_addPropertyQualifier(&inst->instance, CMGetCharsPtr(pn,NULL), "EmbeddedInstance"); + } + } } } diff --git a/interopProvider.c b/interopProvider.c index c6dc5bf..c460466 100644 --- a/interopProvider.c +++ b/interopProvider.c @@ -881,8 +881,7 @@ initInterOp(const CMPIBroker * broker, const CMPIContext *ctx) cop = CMGetObjectPath(ci, &st); if (RIEnabled) { // check and set context for migrated listeners. - CMPIInstance *ldi = _broker->bft->getInstance(_broker, ctxLocal, cop, NULL, NULL); - ld = CMGetProperty(ldi, "SequenceContext", NULL); + ld = CMGetProperty(ci, "SequenceContext", NULL); if (ld.state != CMPI_goodValue) { _SFCB_TRACE(1,("--- adding SequenceContext to migrated cim_listenerdestination")); // build and set the context string, we can't know the actual creation @@ -891,12 +890,12 @@ initInterOp(const CMPIBroker * broker, const CMPIContext *ctx) sprintf (context,"%s#%sM%d#",mc.value.string->ft->getCharPtr(mc.value.string,NULL),sfcBrokerStart,ldcount); CMPIValue scontext; scontext.string = sfcb_native_new_CMPIString(context, NULL, 0); - CMSetProperty(ldi, "SequenceContext", &scontext, CMPI_string); + CMSetProperty(ci, "SequenceContext", &scontext, CMPI_string); } // Reset the sequence numbers on sfcb restart CMPIValue zarro = {.sint64 = -1 }; - CMSetProperty(ldi, "LastSequenceNumber", &zarro, CMPI_sint64); - CBModifyInstance(_broker, ctxLocal, cop, ldi, NULL); + CMSetProperty(ci, "LastSequenceNumber", &zarro, CMPI_sint64); + CBModifyInstance(_broker, ctxLocal, cop, ci, NULL); } addHandler(ci, cop); } diff --git a/objectImpl.c b/objectImpl.c index aa22848..e31caa5 100644 --- a/objectImpl.c +++ b/objectImpl.c @@ -1012,7 +1012,11 @@ ClClassAddPropertyQualifierSpecial(ClObjectHdr * hdr, ClProperty * p, p->quals |= ClProperty_Q_Key; else if (strcasecmp(id, "embeddedobject") == 0) p->quals |= ClProperty_Q_EmbeddedObject; - else + /* Make EmbeddedInstance behave as EmbeddedObject, but be able to distinguish between them */ + else if (strcasecmp(id, "embeddedinstance") == 0) { + p->quals |= ClProperty_Q_EmbeddedObject; + p->quals |= ClProperty_Q_EmbeddedInstance; + } else return ClClassAddQualifierSpecial(hdr, &p->qualifiers, id, d, arrHdr); return 0; } @@ -2407,6 +2411,33 @@ ClInstanceGetPropertyAt(ClInstance * inst, int id, CMPIData *data, _SFCB_RETURN(0); } +int ClInstanceAddPropertyQualifierSpecial(ClInstance *inst, const char *id, + const char *qualifier) +{ + int i; + ClProperty *p; + + _SFCB_ENTER(TRACE_OBJECTIMPL, "ClInstanceAddPropertyQualifierSpecial"); + + i = ClObjectLocateProperty(&inst->hdr, &inst->properties, id); + if (i == 0) + /* cannot find the property */ + _SFCB_RETURN(CMPI_RC_ERR_NO_SUCH_PROPERTY); + + p = (ClProperty*) getSectionPtr(&inst->hdr, &inst->properties); + p = p + i - 1; + + if (strcasecmp(qualifier, "embeddedinstance") == 0) { + p->quals |= ClProperty_Q_EmbeddedObject; + p->quals |= ClProperty_Q_EmbeddedInstance; + } else if (strcasecmp(qualifier, "embeddedobject") == 0) { + p->quals |= ClProperty_Q_EmbeddedObject; + } + + _SFCB_RETURN(0) +} + + int ClInstanceAddProperty(ClInstance * inst, const char *id, CMPIData d) { diff --git a/objectImpl.h b/objectImpl.h index 0359c61..16c31a6 100644 --- a/objectImpl.h +++ b/objectImpl.h @@ -286,6 +286,7 @@ typedef struct { #ifndef SETCLPFX #define ClProperty_Q_Key 1 #define ClProperty_Q_EmbeddedObject 8 +#define ClProperty_Q_EmbeddedInstance 16 #endif unsigned char originId; PFX(CLPFX, ClSection) qualifiers; @@ -534,6 +535,7 @@ extern int ClInstanceGetPropertyCount(ClInstance * inst); extern int ClInstanceGetPropertyAt(ClInstance * inst, int id, CMPIData *data, char **name, unsigned long *quals); +extern int ClInstanceAddPropertyQualifierSpecial(ClInstance *inst, const char *id, const char *qualifier); extern int ClInstanceAddProperty(ClInstance * inst, const char *id, CMPIData d); extern void ClInstanceFilterFlagProperty(ClInstance * inst, int id); diff --git a/test/TestProviders/cmpiTestIndicationProvider.c b/test/TestProviders/cmpiTestIndicationProvider.c index 348aef8..6f8bb47 100644 --- a/test/TestProviders/cmpiTestIndicationProvider.c +++ b/test/TestProviders/cmpiTestIndicationProvider.c @@ -41,6 +41,14 @@ generateIndication(const char *methodname, const CMPIContext *ctx) dat = CMNewDateTime(broker, &rc); CMSetProperty(inst, "IndicationTime", &dat, CMPI_dateTime); + CMPIObjectPath* cop1 = CMNewObjectPath(broker, "root/cimv2", "Sample_Instance", &rc); + CMPIValue value3; + value3.string = CMNewString(broker, "I'm an EmbeddedObject", &rc); + CMPIInstance* Einst; + Einst = CMNewInstance(broker, cop1, &rc); + CMSetProperty(Einst, "Message", &value3, CMPI_string); + CMSetProperty(inst, "EInst", &Einst, CMPI_instance); + CMSetProperty(inst, "MethodName", methodname, CMPI_chars); ar = CMNewArray(broker, 0, CMPI_string, &rc); diff --git a/test/TestProviders/cmpiTestInstanceProvider.c b/test/TestProviders/cmpiTestInstanceProvider.c index eba1812..3e68932 100644 --- a/test/TestProviders/cmpiTestInstanceProvider.c +++ b/test/TestProviders/cmpiTestInstanceProvider.c @@ -104,11 +104,13 @@ initialize() CMPIValue value1, value2, value3, + value4, value_inst1, value_inst2; CMPIInstance *instance1, *instance2, *instance3, + *Eobj, *Einst; CMPIObjectPath *cop1, *cop2, @@ -116,6 +118,7 @@ initialize() value1.uint8 = 1; value2.string = CMNewString(_broker, "Hello World", &rc); value3.string = CMNewString(_broker, "I'm an EmbeddedObject", &rc); + value4.string = CMNewString(_broker, "I'm an EmbeddedInstance", &rc); /* * create a new array to hold the instances created @@ -144,10 +147,14 @@ initialize() CMSetProperty(instance1, "Message", &value2, CMPI_string); /* EmbeddedObject */ - Einst = CMNewInstance(_broker, cop1, &rc); - CMSetProperty(Einst, "Message", &value3, CMPI_string); - CMSetProperty(instance1, "EInst", &Einst, CMPI_instance); + Eobj = CMNewInstance(_broker, cop1, &rc); + CMSetProperty(Eobj, "Message", &value3, CMPI_string); + CMSetProperty(instance1, "Eobj", &Eobj, CMPI_instance); + /* EmbeddedInstance */ + Einst = CMNewInstance(_broker, cop1, &rc); + CMSetProperty(Einst, "Message", &value4, CMPI_string); + CMSetProperty(instance1, "Einst", &Einst, CMPI_instance); value_inst1.inst = instance1; diff --git a/test/TestProviders/tests/Test1EnumerateInstances.lines b/test/TestProviders/tests/Test1EnumerateInstances.lines index 19b725f..ef23387 100644 --- a/test/TestProviders/tests/Test1EnumerateInstances.lines +++ b/test/TestProviders/tests/Test1EnumerateInstances.lines @@ -3,13 +3,27 @@ <KEYVALUE VALUETYPE="numeric">1</KEYVALUE> <INSTANCE CLASSNAME="Sample_Instance"> <PROPERTY NAME="Identifier" TYPE="uint8"> -<VALUE>1</VALUE> -<PROPERTY NAME="Einst" EmbeddedObject="object" TYPE="string"> +<PROPERTY NAME="Einst" EmbeddedObject="instance" TYPE="string"> <VALUE><INSTANCE CLASSNAME="Sample_Instance"> <PROPERTY NAME="Identifier" TYPE="uint8"> <VALUE>1</VALUE> </PROPERTY> -<PROPERTY NAME="Einst" EmbeddedObject="object" TYPE="string"> +<PROPERTY NAME="Einst" EmbeddedObject="instance" TYPE="string"> +</PROPERTY> +<PROPERTY NAME="Eobj" EmbeddedObject="object" TYPE="string"> +</PROPERTY> +<PROPERTY NAME="Message" TYPE="string"> +<VALUE>I&apos;m an EmbeddedInstance</VALUE> +</PROPERTY> +</INSTANCE> +<PROPERTY NAME="Eobj" EmbeddedObject="object" TYPE="string"> +<VALUE><INSTANCE CLASSNAME="Sample_Instance"> +<PROPERTY NAME="Identifier" TYPE="uint8"> +<VALUE>1</VALUE> +</PROPERTY> +<PROPERTY NAME="Einst" EmbeddedObject="instance" TYPE="string"> +</PROPERTY> +<PROPERTY NAME="Eobj" EmbeddedObject="object" TYPE="string"> </PROPERTY> <PROPERTY NAME="Message" TYPE="string"> <VALUE>I&apos;m an EmbeddedObject</VALUE> @@ -19,7 +33,8 @@ <VALUE>Hello World</VALUE> <KEYVALUE VALUETYPE="numeric">2</KEYVALUE> <VALUE>2</VALUE> +<PROPERTY NAME="Einst" EmbeddedObject="instance" TYPE="string"> +<PROPERTY NAME="Eobj" EmbeddedObject="object" TYPE="string"> <VALUE>Yo Planet</VALUE> <KEYVALUE VALUETYPE="numeric">3</KEYVALUE> <VALUE>3</VALUE> -<VALUE>Hey Earth</VALUE> diff --git a/test/schema/root/cimv2/Test_Instance.mof b/test/schema/root/cimv2/Test_Instance.mof index 066dd8c..8cb6de6 100644 --- a/test/schema/root/cimv2/Test_Instance.mof +++ b/test/schema/root/cimv2/Test_Instance.mof @@ -13,5 +13,8 @@ class Sample_Instance : Sample_Class string Message; [EmbeddedObject] + string Eobj; + + [EmbeddedInstance] string Einst; }; diff --git a/test/schema/root/interop/Test_Indication.mof b/test/schema/root/interop/Test_Indication.mof index 01e4480..71288bb 100644 --- a/test/schema/root/interop/Test_Indication.mof +++ b/test/schema/root/interop/Test_Indication.mof @@ -2,5 +2,6 @@ class Test_Indication : CIM_ProcessIndication { string MethodName; + [EmbeddedObject] string Einst; [Static] uint32 SendTestIndication(); }; hooks/post-receive -- sfcb - Small Footprint CIM Broker |