From: Chris B. <buc...@us...> - 2011-03-30 22:02:16
|
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 "SFCC - Small Footprint CIM Client". The branch, master has been updated via 35df1bd7f91416bd45df12c5a7dd34b7c417d1a3 (commit) from f43b3f6e71bc969e91a11e905b06e46132e70245 (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 35df1bd7f91416bd45df12c5a7dd34b7c417d1a3 Author: buccella <buc...@li...> Date: Wed Mar 30 18:02:02 2011 -0400 added v2test_im ----------------------------------------------------------------------- Summary of changes: diff --git a/TEST/Makefile.am b/TEST/Makefile.am index cd2e705..adc9359 100644 --- a/TEST/Makefile.am +++ b/TEST/Makefile.am @@ -62,7 +62,8 @@ noinst_PROGRAMS = test \ v2test_ei \ v2test_ein \ v2test_gc \ - print-types + v2test_im \ + print-types test_SOURCES = test.c show.c test_LDADD = ../libcmpisfcc.la @@ -192,6 +193,9 @@ v2test_ein_LDADD = ../libcmpisfcc.la v2test_gc_SOURCES = v2test_gc.c show.c v2test_gc_LDADD = ../libcmpisfcc.la +v2test_im_SOURCES = v2test_im.c show.c +v2test_im_LDADD = ../libcmpisfcc.la + print_types_SOURCES = print-types.c #@INC_AMINCLUDE@ diff --git a/TEST/v2test_im.c b/TEST/v2test_im.c new file mode 100644 index 0000000..8592662 --- /dev/null +++ b/TEST/v2test_im.c @@ -0,0 +1,99 @@ +/* + * test_im1.c + * + * (C) Copyright IBM Corp. 2005 + * (C) Copyright Intel Corp. 2005 + * + * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE + * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE + * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. + * + * You can obtain a current copy of the Eclipse Public License from + * http://www.opensource.org/licenses/eclipse-1.0.php + * + * Author: Adrian Schuur <sc...@de...> + * + * Description: + * + * Testing method invocation over SfcbLocal using + * SFCB's cmpiTestMethodProvider + */ + +#include <cimc.h> +#include <cmci.h> +#include <native.h> +#include <unistd.h> +#include <stdlib.h> + +#include "show.h" + +int main() +{ + CIMCEnv* ce; + CIMCClient* client; + char* msg; + CIMCStatus cstatus; + int rc; + + CIMCObjectPath * objectpath; + CMPIStatus status; + CIMCArgs * args; + char *cim_host, *cim_host_passwd, *cim_host_userid, *cim_host_port; + CIMCData retval; + CIMCValue arg; + + /* Setup a connection to the CIMOM */ + cim_host = getenv("CIM_HOST"); + if (cim_host == NULL) cim_host = "localhost"; + cim_host_userid = getenv("CIM_HOST_USERID"); + if (cim_host_userid == NULL) cim_host_userid = "root"; + cim_host_passwd = getenv("CIM_HOST_PASSWD"); + if (cim_host_passwd == NULL) cim_host_passwd = "password"; + cim_host_port = getenv("CIM_HOST_PORT"); + if (cim_host_port == NULL) cim_host_port = "5988"; + + ce = NewCIMCEnv("SfcbLocal",0,&rc,&msg); + // ce = NewCIMCEnv("XML",0,&rc,&msg); + client = ce->ft->connect(ce, cim_host , "http", cim_host_port, cim_host_userid, cim_host_passwd , &cstatus); + + objectpath = ce->ft->newObjectPath(ce, "root/cimv2", "Sample_Method", NULL); + + printf("+++creating args\n"); + + args = ce->ft->newArgs(ce, NULL); + CIMCValue a; + const int ARR_SIZE = 1672; + a.array = ce->ft->newArray(ce, ARR_SIZE, CMPI_uint8, NULL); + + arg.uint8 = 123; + + int i; + for (i = 0; i < ARR_SIZE; i++) { + a.array->ft->setElementAt(a.array, i, &arg, CMPI_uint8); + } + + args->ft->addArg(args, "IntArray", &a, CMPI_uint8A); + + printf("+++calling invoke method\n"); + + retval = client->ft->invokeMethod(client, objectpath, "CheckArrayNoType", args, NULL, &cstatus); + + /* Print the results */ + printf( "invokeMethod() rc=%d, msg=%s\n", + status.rc, (status.msg)? (char *)status.msg->hdl : NULL); + + // if (args) CMRelease(args); + printf("release status\n"); + if (status.msg) CMRelease(status.msg); + + if (!status.rc) { + char *cv = value2Chars(retval.type,&(retval.value)); + printf("result(s):\n\treturn value: "%s"\n", cv); + } + + if (objectpath) CMRelease(objectpath); + if (ce) CMRelease(ce); + + return 0; +} + hooks/post-receive -- SFCC - Small Footprint CIM Client |