You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(26) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(5) |
Feb
(16) |
Mar
(5) |
Apr
(5) |
May
(13) |
Jun
(12) |
Jul
(1) |
Aug
(2) |
Sep
(13) |
Oct
(6) |
Nov
(1) |
Dec
(29) |
| 2008 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
(57) |
May
(35) |
Jun
(45) |
Jul
(132) |
Aug
(87) |
Sep
(141) |
Oct
(86) |
Nov
(17) |
Dec
(2) |
| 2009 |
Jan
(3) |
Feb
(2) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ba...@us...> - 2008-10-24 04:32:48
|
Revision: 1128
http://omc.svn.sourceforge.net/omc/?rev=1128&view=rev
Author: bartw
Date: 2008-10-24 04:32:43 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
fix install to create .pyc files with no artifacts of DESTDIR
Modified Paths:
--------------
cmpi-bindings/trunk/swig/python/CMakeLists.txt
Modified: cmpi-bindings/trunk/swig/python/CMakeLists.txt
===================================================================
--- cmpi-bindings/trunk/swig/python/CMakeLists.txt 2008-10-23 19:45:24 UTC (rev 1127)
+++ cmpi-bindings/trunk/swig/python/CMakeLists.txt 2008-10-24 04:32:43 UTC (rev 1128)
@@ -65,4 +65,11 @@
INSTALL(FILES cmpi_pywbem_bindings.py DESTINATION ${PYTHON_SITE_DIR} )
#INSTALL(FILES Py_UnixProcessProvider.py DESTINATION /usr/lib/pycim )
-INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -m py_compile \$ENV{DESTDIR}${PYTHON_SITE_DIR}/cmpi.py \$ENV{DESTDIR}${PYTHON_SITE_DIR}/cmpi_pywbem_bindings.py)")
+INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c \"from py_compile import compile; compile('\$ENV{DESTDIR}${PYTHON_SITE_DIR}/cmpi.py', dfile='${PYTHON_SITE_DIR}/cmpi.py')\")")
+
+INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c \"from py_compile import compile; compile('\$ENV{DESTDIR}${PYTHON_SITE_DIR}/cmpi_pywbem_bindings.py', dfile='${PYTHON_SITE_DIR}/cmpi_pywbem_bindings.py')\")")
+
+
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <np...@us...> - 2008-10-23 19:45:29
|
Revision: 1127
http://omc.svn.sourceforge.net/omc/?rev=1127&view=rev
Author: npaxton
Date: 2008-10-23 19:45:24 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Update test README to more accurately reflect current state
Modified Paths:
--------------
cmpi-bindings/trunk/test/python/README
Modified: cmpi-bindings/trunk/test/python/README
===================================================================
--- cmpi-bindings/trunk/test/python/README 2008-10-23 19:41:36 UTC (rev 1126)
+++ cmpi-bindings/trunk/test/python/README 2008-10-23 19:45:24 UTC (rev 1127)
@@ -22,28 +22,30 @@
- Create symlinks for cmpi-bindings
+ (If appropriate, substitute python2.5 with python2.4)
cd build/swig/python
sudo ln -s `pwd`/libpyCmpiProvider.so /usr/lib/cmpi
sudo ln -s `pwd`/cmpi.py /usr/lib/python2.5/site-packages
cd ../../..
cd swig/python
- sudo ln -s `pwd`/pycmpi_provider.py /usr/lib/python2.5/site-packages
+ sudo ln -s `pwd`/cmpi_pywbem_bindings.py /usr/lib/python2.5/site-packages
- Create symlinks for sfcb mof/reg
- sudo ./setup.sh
+ sudo ./install.sh
+ This also runs "sfcbrepos -f"
- This also runs "sfcbrepos -f"
+ if you are installing to test on Pegasus, use the '--op' option
-- Restart sfcbd
+- Restart sfcbd or tog-pegasus (cimserver)
-- now run TestMethod_Test.py, TestAtomProvider_Test.py as root.
+- now run TestMethod_Test.py, TestAtomProvider_Test.py, test_assoc.py, UpcallAtomTest.py, and TestIndications.py as root.
(they only need to run as root because they use the passwordless local unix connection).
- those two tests should all pass.
- test_assoc.py should partially pass.
+ (To run against Pegasus, run with option: '-u /var/run/tog-pegasus/cimxml.socket' to use the local unix connection)
+ They should all pass.
- ["Property Not Found in PropertyList: uint64" is an expected error]
\ No newline at end of file
+ ["Property Not Found in PropertyList: uint64" is an expected error]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <np...@us...> - 2008-10-23 19:41:40
|
Revision: 1126
http://omc.svn.sourceforge.net/omc/?rev=1126&view=rev
Author: npaxton
Date: 2008-10-23 19:41:36 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
fix a few logging issues
Modified Paths:
--------------
cmpi-bindings/trunk/test/python/UpcallAtomProvider.py
Modified: cmpi-bindings/trunk/test/python/UpcallAtomProvider.py
===================================================================
--- cmpi-bindings/trunk/test/python/UpcallAtomProvider.py 2008-10-23 16:08:37 UTC (rev 1125)
+++ cmpi-bindings/trunk/test/python/UpcallAtomProvider.py 2008-10-23 19:41:36 UTC (rev 1126)
@@ -344,7 +344,7 @@
"""
logger = env.get_logger()
- logger.log_debug('Entering enable_indications()' )
+ logger.log_debug('Entering enable_indications()')
#just fall through for success
@@ -485,15 +485,15 @@
#TestAssoc_User has an association through TestAssoc_MemberOfGroup
# to TestAssoc_Group
if assocs:
- log_debug("#*)$*%)# Got assocs ")
+ log_debug("#*)$*%)# Got assocs ", logger)
for assoc in assocs:
- log_debug("Got an assoc")
+ log_debug("Got an assoc", logger)
log_debug(" ", logger)
log_debug(" >>> assoc: %s"%str(assoc), logger)
log_debug(" ", logger)
name = assoc.path
log_debug(" ", logger)
- log_debug(" >>> name: "%str(name), logger)
+ log_debug(" >>> name: %s"%str(name), logger)
log_debug(" ", logger)
if assoc.classname.lower() != 'testassoc_group':
raise "Associator Error: %s" %str(assoc)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2008-10-23 16:08:42
|
Revision: 1125
http://omc.svn.sourceforge.net/omc/?rev=1125&view=rev
Author: bartw
Date: 2008-10-23 16:08:37 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
crank up the level of abuse.
Modified Paths:
--------------
cmpi-bindings/trunk/test/python/abuse.sh
Modified: cmpi-bindings/trunk/test/python/abuse.sh
===================================================================
--- cmpi-bindings/trunk/test/python/abuse.sh 2008-10-23 15:36:36 UTC (rev 1124)
+++ cmpi-bindings/trunk/test/python/abuse.sh 2008-10-23 16:08:37 UTC (rev 1125)
@@ -10,6 +10,8 @@
python TestMethod_Test.py $@ &
python TestAtomProvider_Test.py $@ &
python TestMethod_Test.py $@ &
+python UpcallAtomTest.py $@ &
+python TestIndications.py $@ &
python TestAtomProvider_Test.py $@ &
python TestMethod_Test.py $@ &
@@ -17,6 +19,8 @@
python TestMethod_Test.py $@ &
python TestAtomProvider_Test.py $@ &
python TestMethod_Test.py $@ &
+python UpcallAtomTest.py $@ &
+python TestIndications.py $@ &
python TestAtomProvider_Test.py $@ &
python TestMethod_Test.py $@ &
@@ -24,10 +28,12 @@
python TestMethod_Test.py $@ &
python TestAtomProvider_Test.py $@ &
python TestMethod_Test.py $@ &
+python UpcallAtomTest.py $@ &
+python TestIndications.py $@ &
-sleep 15
+#sleep 15
-python test_assoc.py $@ &
+#python test_assoc.py $@ &
python TestAtomProvider_Test.py $@ &
python TestMethod_Test.py $@ &
@@ -35,4 +41,6 @@
python TestMethod_Test.py $@ &
python TestAtomProvider_Test.py $@ &
python TestMethod_Test.py $@ &
+python UpcallAtomTest.py $@ &
+python TestIndications.py $@ &
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2008-10-23 15:36:43
|
Revision: 1124
http://omc.svn.sourceforge.net/omc/?rev=1124&view=rev
Author: bartw
Date: 2008-10-23 15:36:36 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
tailor test depending on broker
Modified Paths:
--------------
cmpi-bindings/trunk/test/python/TestMethod.mof
cmpi-bindings/trunk/test/python/TestMethod.py
cmpi-bindings/trunk/test/python/TestMethod_Test.py
Modified: cmpi-bindings/trunk/test/python/TestMethod.mof
===================================================================
--- cmpi-bindings/trunk/test/python/TestMethod.mof 2008-10-23 15:34:41 UTC (rev 1123)
+++ cmpi-bindings/trunk/test/python/TestMethod.mof 2008-10-23 15:36:36 UTC (rev 1124)
@@ -270,5 +270,8 @@
sint32 getObjects(
[in(false), out, required, EmbeddedInstance("Test_Method")] string insts[]
);
+
+ [ Description("Get the name of the broker"), Static ]
+ string getBrokerName();
};
Modified: cmpi-bindings/trunk/test/python/TestMethod.py
===================================================================
--- cmpi-bindings/trunk/test/python/TestMethod.py 2008-10-23 15:34:41 UTC (rev 1123)
+++ cmpi-bindings/trunk/test/python/TestMethod.py 2008-10-23 15:36:36 UTC (rev 1124)
@@ -754,6 +754,15 @@
out_params = [pywbem.CIMParameter('insts', 'instance', value=insts)]
rval = pywbem.Sint32(0)
return (rval, out_params)
+
+ def cim_method_getbrokername(self, env, object_name):
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.cim_method_getbrokername()' \
+ % self.__class__.__name__)
+
+ out_params = []
+ rval = env.get_cimom_handle().broker.name()
+ return (rval, out_params)
## end of class TestMethodProvider
Modified: cmpi-bindings/trunk/test/python/TestMethod_Test.py
===================================================================
--- cmpi-bindings/trunk/test/python/TestMethod_Test.py 2008-10-23 15:34:41 UTC (rev 1123)
+++ cmpi-bindings/trunk/test/python/TestMethod_Test.py 2008-10-23 15:36:36 UTC (rev 1124)
@@ -520,6 +520,11 @@
def test_xembeddedinst_output_params(self):
+ rv,outs = self.conn.InvokeMethod('getBrokerName', 'Test_Method')
+ if rv == 'RequestHandler':
+ print '\n*** Broker detected as SFCB. Skipping embedded out param test.'
+ print 'Re-enable when SFCB is fixed.'
+ return
iname = pywbem.CIMInstanceName('Test_Method', namespace='root/cimv2',
keybindings = {'id':'one'})
inst = pywbem.CIMInstance('Test_Method', path=None,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2008-10-23 15:34:50
|
Revision: 1123
http://omc.svn.sourceforge.net/omc/?rev=1123&view=rev
Author: bartw
Date: 2008-10-23 15:34:41 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
tailor test depending on broker
Modified Paths:
--------------
cmpi-bindings/trunk/test/python/UpcallAtom.mof
cmpi-bindings/trunk/test/python/UpcallAtomProvider.py
cmpi-bindings/trunk/test/python/UpcallAtomTest.py
Modified: cmpi-bindings/trunk/test/python/UpcallAtom.mof
===================================================================
--- cmpi-bindings/trunk/test/python/UpcallAtom.mof 2008-10-23 15:32:54 UTC (rev 1122)
+++ cmpi-bindings/trunk/test/python/UpcallAtom.mof 2008-10-23 15:34:41 UTC (rev 1123)
@@ -20,6 +20,9 @@
uint16 get_indication_send_count(
// return number of indications sent since last reset
);
+
+ [ Description("Get the name of the broker"), Static ]
+ string getBrokerName();
};
Modified: cmpi-bindings/trunk/test/python/UpcallAtomProvider.py
===================================================================
--- cmpi-bindings/trunk/test/python/UpcallAtomProvider.py 2008-10-23 15:32:54 UTC (rev 1122)
+++ cmpi-bindings/trunk/test/python/UpcallAtomProvider.py 2008-10-23 15:34:41 UTC (rev 1123)
@@ -853,7 +853,16 @@
rval = pywbem.Uint16(cur_ind_count)
return (rval, out_params)
+################################################################################
+ def cim_method_getbrokername(self, env, object_name):
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.cim_method_getbrokername()' \
+ % self.__class__.__name__)
+ out_params = []
+ rval = env.get_cimom_handle().broker.name()
+ return (rval, out_params)
+
## end of class UpcallAtomProvider
Modified: cmpi-bindings/trunk/test/python/UpcallAtomTest.py
===================================================================
--- cmpi-bindings/trunk/test/python/UpcallAtomTest.py 2008-10-23 15:32:54 UTC (rev 1122)
+++ cmpi-bindings/trunk/test/python/UpcallAtomTest.py 2008-10-23 15:34:41 UTC (rev 1123)
@@ -49,6 +49,11 @@
print('')
def test_a_upcalls_all(self):
+ rv,outs = self.conn.InvokeMethod('getBrokerName', 'Test_UpcallAtom')
+ if rv == 'Pegasus':
+ print '\n*** Broker detected as Pegasus. Skipping upcall test.'
+ print 'Re-enable when Pegasus is fixed.'
+ return
rv,outs = self.conn.InvokeMethod('test_all_upcalls', 'Test_UpcallAtom')
self.assertEquals(rv, 'Success!')
self.assertFalse(outs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2008-10-23 15:33:03
|
Revision: 1122
http://omc.svn.sourceforge.net/omc/?rev=1122&view=rev
Author: bartw
Date: 2008-10-23 15:32:54 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
added script to run all tests
Added Paths:
-----------
cmpi-bindings/trunk/test/python/runtests.sh
Added: cmpi-bindings/trunk/test/python/runtests.sh
===================================================================
--- cmpi-bindings/trunk/test/python/runtests.sh (rev 0)
+++ cmpi-bindings/trunk/test/python/runtests.sh 2008-10-23 15:32:54 UTC (rev 1122)
@@ -0,0 +1,6 @@
+#!/bin/sh
+python TestAtomProvider_Test.py $@
+python TestIndications.py $@
+python UpcallAtomTest.py $@
+python test_assoc.py $@
+python TestMethod_Test.py $@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mik...@us...> - 2008-10-23 00:50:36
|
Revision: 1121
http://omc.svn.sourceforge.net/omc/?rev=1121&view=rev
Author: mike-brasher
Date: 2008-10-23 00:50:26 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Proivders to reproduce upcall hang in pegasus.
Added Paths:
-----------
cmpi-bindings/trunk/test/konkret/
cmpi-bindings/trunk/test/konkret/Gadget.h
cmpi-bindings/trunk/test/konkret/GadgetProvider.c
cmpi-bindings/trunk/test/konkret/Makefile
cmpi-bindings/trunk/test/konkret/README
cmpi-bindings/trunk/test/konkret/Upcall.h
cmpi-bindings/trunk/test/konkret/UpcallProvider.c
cmpi-bindings/trunk/test/konkret/Widget.h
cmpi-bindings/trunk/test/konkret/Widget.mof
cmpi-bindings/trunk/test/konkret/Widget.reg
cmpi-bindings/trunk/test/konkret/WidgetProvider.c
cmpi-bindings/trunk/test/konkret/register.mof
Added: cmpi-bindings/trunk/test/konkret/Gadget.h
===================================================================
--- cmpi-bindings/trunk/test/konkret/Gadget.h (rev 0)
+++ cmpi-bindings/trunk/test/konkret/Gadget.h 2008-10-23 00:50:26 UTC (rev 1121)
@@ -0,0 +1,379 @@
+/*
+**==============================================================================
+**
+** CAUTION: This file generated by KonkretCMPI. Please do not edit.
+**
+**==============================================================================
+*/
+
+#ifndef _konkrete_Gadget_h
+#define _konkrete_Gadget_h
+
+#include <konkret/konkret.h>
+#include "Widget.h"
+
+/*
+**==============================================================================
+**
+** struct GadgetRef
+**
+**==============================================================================
+*/
+
+/* classname=KC_Gadget */
+typedef struct _GadgetRef
+{
+ KBase __base;
+ /* KC_Gadget features */
+ const KRef Left; /* Widget */
+ const KRef Right; /* Widget */
+}
+GadgetRef;
+
+static const unsigned char __GadgetRef_sig[] =
+{
+ 0x09,0x4b,0x43,0x5f,0x47,0x61,0x64,0x67,0x65,0x74,0x00,0x02,0x4e,0x04,0x4c,
+ 0x65,0x66,0x74,0x00,0x4e,0x05,0x52,0x69,0x67,0x68,0x74,0x00,
+};
+
+KINLINE void GadgetRef_Init(
+ GadgetRef* self,
+ const CMPIBroker* cb,
+ const char* ns)
+{
+ const unsigned char* sig = __GadgetRef_sig;
+ KBase_Init(&self->__base, cb, sizeof(*self), sig, ns);
+ ((KRef*)&self->Left)->__sig = __Widget_sig;
+ ((KRef*)&self->Right)->__sig = __Widget_sig;
+}
+
+KINLINE CMPIStatus GadgetRef_InitFromInstance(
+ GadgetRef* self,
+ const CMPIBroker* cb,
+ const CMPIInstance* x)
+{
+ GadgetRef_Init(self, cb, NULL);
+ return KBase_FromInstance(&self->__base, x);
+}
+
+KINLINE CMPIStatus GadgetRef_InitFromObjectPath(
+ GadgetRef* self,
+ const CMPIBroker* cb,
+ const CMPIObjectPath* x)
+{
+ GadgetRef_Init(self, cb, NULL);
+ return KBase_FromObjectPath(&self->__base, x);
+}
+
+KINLINE void GadgetRef_Print(
+ const GadgetRef* self,
+ FILE* os)
+{
+ KBase_Print(os, &self->__base, 'r');
+}
+
+KINLINE CMPIInstance* GadgetRef_ToInstance(
+ const GadgetRef* self,
+ CMPIStatus* status)
+{
+ return KBase_ToInstance(&self->__base, status);
+}
+
+KINLINE CMPIObjectPath* GadgetRef_ToObjectPath(
+ const GadgetRef* self,
+ CMPIStatus* status)
+{
+ return KBase_ToObjectPath(&self->__base, status);
+}
+
+KINLINE const char* GadgetRef_NameSpace(
+ GadgetRef* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ return self->__base.ns ? KChars(self->__base.ns) : NULL;
+ return NULL;
+}
+
+KINLINE void GadgetRef_SetObjectPath_Left(
+ GadgetRef* self,
+ const CMPIObjectPath* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Left;
+ KRef_SetObjectPath(field, x);
+ }
+}
+
+KINLINE CMPIStatus GadgetRef_Set_Left(
+ GadgetRef* self,
+ const WidgetRef* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Left;
+ return KRef_Set(field, &x->__base);
+ }
+ CMReturn(CMPI_RC_ERR_FAILED);
+}
+
+KINLINE void GadgetRef_Null_Left(
+ GadgetRef* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Left;
+ KRef_Null(field);
+ }
+}
+
+KINLINE void GadgetRef_Clr_Left(
+ GadgetRef* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Left;
+ KRef_Clr(field);
+ }
+}
+
+KINLINE void GadgetRef_SetObjectPath_Right(
+ GadgetRef* self,
+ const CMPIObjectPath* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Right;
+ KRef_SetObjectPath(field, x);
+ }
+}
+
+KINLINE CMPIStatus GadgetRef_Set_Right(
+ GadgetRef* self,
+ const WidgetRef* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Right;
+ return KRef_Set(field, &x->__base);
+ }
+ CMReturn(CMPI_RC_ERR_FAILED);
+}
+
+KINLINE void GadgetRef_Null_Right(
+ GadgetRef* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Right;
+ KRef_Null(field);
+ }
+}
+
+KINLINE void GadgetRef_Clr_Right(
+ GadgetRef* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Right;
+ KRef_Clr(field);
+ }
+}
+
+/*
+**==============================================================================
+**
+** struct Gadget
+**
+**==============================================================================
+*/
+
+/* classname=KC_Gadget */
+typedef struct _Gadget
+{
+ KBase __base;
+ /* KC_Gadget features */
+ const KRef Left; /* Widget */
+ const KRef Right; /* Widget */
+}
+Gadget;
+
+static const unsigned char __Gadget_sig[] =
+{
+ 0x09,0x4b,0x43,0x5f,0x47,0x61,0x64,0x67,0x65,0x74,0x00,0x02,0x4e,0x04,0x4c,
+ 0x65,0x66,0x74,0x00,0x4e,0x05,0x52,0x69,0x67,0x68,0x74,0x00,
+};
+
+KINLINE void Gadget_Init(
+ Gadget* self,
+ const CMPIBroker* cb,
+ const char* ns)
+{
+ const unsigned char* sig = __Gadget_sig;
+ KBase_Init(&self->__base, cb, sizeof(*self), sig, ns);
+ ((KRef*)&self->Left)->__sig = __Widget_sig;
+ ((KRef*)&self->Right)->__sig = __Widget_sig;
+}
+
+KINLINE CMPIStatus Gadget_InitFromInstance(
+ Gadget* self,
+ const CMPIBroker* cb,
+ const CMPIInstance* x)
+{
+ Gadget_Init(self, cb, NULL);
+ return KBase_FromInstance(&self->__base, x);
+}
+
+KINLINE CMPIStatus Gadget_InitFromObjectPath(
+ Gadget* self,
+ const CMPIBroker* cb,
+ const CMPIObjectPath* x)
+{
+ Gadget_Init(self, cb, NULL);
+ return KBase_FromObjectPath(&self->__base, x);
+}
+
+KINLINE void Gadget_Print(
+ const Gadget* self,
+ FILE* os)
+{
+ KBase_Print(os, &self->__base, 'i');
+}
+
+KINLINE CMPIInstance* Gadget_ToInstance(
+ const Gadget* self,
+ CMPIStatus* status)
+{
+ return KBase_ToInstance(&self->__base, status);
+}
+
+KINLINE CMPIObjectPath* Gadget_ToObjectPath(
+ const Gadget* self,
+ CMPIStatus* status)
+{
+ return KBase_ToObjectPath(&self->__base, status);
+}
+
+KINLINE const char* Gadget_NameSpace(
+ Gadget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ return self->__base.ns ? KChars(self->__base.ns) : NULL;
+ return NULL;
+}
+
+KINLINE void Gadget_SetObjectPath_Left(
+ Gadget* self,
+ const CMPIObjectPath* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Left;
+ KRef_SetObjectPath(field, x);
+ }
+}
+
+KINLINE CMPIStatus Gadget_Set_Left(
+ Gadget* self,
+ const WidgetRef* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Left;
+ return KRef_Set(field, &x->__base);
+ }
+ CMReturn(CMPI_RC_ERR_FAILED);
+}
+
+KINLINE void Gadget_Null_Left(
+ Gadget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Left;
+ KRef_Null(field);
+ }
+}
+
+KINLINE void Gadget_Clr_Left(
+ Gadget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Left;
+ KRef_Clr(field);
+ }
+}
+
+KINLINE void Gadget_SetObjectPath_Right(
+ Gadget* self,
+ const CMPIObjectPath* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Right;
+ KRef_SetObjectPath(field, x);
+ }
+}
+
+KINLINE CMPIStatus Gadget_Set_Right(
+ Gadget* self,
+ const WidgetRef* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Right;
+ return KRef_Set(field, &x->__base);
+ }
+ CMReturn(CMPI_RC_ERR_FAILED);
+}
+
+KINLINE void Gadget_Null_Right(
+ Gadget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Right;
+ KRef_Null(field);
+ }
+}
+
+KINLINE void Gadget_Clr_Right(
+ Gadget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KRef* field = (KRef*)&self->Right;
+ KRef_Clr(field);
+ }
+}
+
+/*
+**==============================================================================
+**
+** Gadget methods
+**
+**==============================================================================
+*/
+
+KINLINE CMPIStatus Gadget_DispatchMethod(
+ const CMPIBroker* cb,
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ GadgetRef self;
+
+ KReturnIf(GadgetRef_InitFromObjectPath(&self, cb, cop));
+
+
+ KReturn(ERR_METHOD_NOT_FOUND);
+}
+
+#define Gadget_ClassName "KC_Gadget"
+
+#endif /* _konkrete_Gadget_h */
Added: cmpi-bindings/trunk/test/konkret/GadgetProvider.c
===================================================================
--- cmpi-bindings/trunk/test/konkret/GadgetProvider.c (rev 0)
+++ cmpi-bindings/trunk/test/konkret/GadgetProvider.c 2008-10-23 00:50:26 UTC (rev 1121)
@@ -0,0 +1,314 @@
+#include <konkret/konkret.h>
+#include "Gadget.h"
+
+static const CMPIBroker* _cb;
+
+static void GadgetInitialize()
+{
+}
+
+static CMPIStatus GadgetCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus GadgetEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ const char* ns = KNameSpace(cop);
+ WidgetRef left;
+ WidgetRef right;
+ GadgetRef g;
+
+ /* First Gadget */
+ {
+ WidgetRef_Init(&left, _cb, ns);
+ WidgetRef_Set_Id(&left, "1001");
+
+ WidgetRef_Init(&right, _cb, ns);
+ WidgetRef_Set_Id(&right, "1002");
+
+ GadgetRef_Init(&g, _cb, ns);
+ GadgetRef_Set_Left(&g, &left);
+ GadgetRef_Set_Right(&g, &right);
+ // GadgetRef_Print(&g, stdout);
+ KReturnObjectPath(cr, g);
+ }
+
+ /* Second Gadget */
+ {
+ WidgetRef_Init(&left, _cb, ns);
+ WidgetRef_Set_Id(&left, "1001");
+
+ WidgetRef_Init(&right, _cb, ns);
+ WidgetRef_Set_Id(&right, "1003");
+
+ GadgetRef_Init(&g, _cb, ns);
+ GadgetRef_Set_Left(&g, &left);
+ GadgetRef_Set_Right(&g, &right);
+ // GadgetRef_Print(&g, stdout);
+ KReturnObjectPath(cr, g);
+ }
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus GadgetEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ const char* ns = KNameSpace(cop);
+ WidgetRef left;
+ WidgetRef right;
+ Gadget g;
+
+ /* First Gadget */
+ {
+ WidgetRef_Init(&left, _cb, ns);
+ WidgetRef_Set_Id(&left, "1001");
+
+ WidgetRef_Init(&right, _cb, ns);
+ WidgetRef_Set_Id(&right, "1002");
+
+ Gadget_Init(&g, _cb, ns);
+ Gadget_Set_Left(&g, &left);
+ Gadget_Set_Right(&g, &right);
+ KReturnInstance(cr, g);
+ }
+
+ /* Second Gadget */
+ {
+ WidgetRef_Init(&left, _cb, ns);
+ WidgetRef_Set_Id(&left, "1001");
+
+ WidgetRef_Init(&right, _cb, ns);
+ WidgetRef_Set_Id(&right, "1003");
+
+ Gadget_Init(&g, _cb, ns);
+ Gadget_Set_Left(&g, &left);
+ Gadget_Set_Right(&g, &right);
+ KReturnInstance(cr, g);
+ }
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus GadgetGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ const char* ns = KNameSpace(cop);
+ GadgetRef gr;
+ Gadget g;
+ WidgetRef left;
+ WidgetRef right;
+
+ if (GadgetRef_InitFromObjectPath(&gr, _cb, cop).rc)
+ KReturn(ERR_FAILED);
+
+ if (WidgetRef_InitFromObjectPath(&left, _cb, gr.Left.value).rc)
+ KReturn(ERR_FAILED);
+
+ if (WidgetRef_InitFromObjectPath(&right, _cb, gr.Right.value).rc)
+ KReturn(ERR_FAILED);
+
+ /* First Gadget */
+
+ if (!strcmp(left.Id.chars, "1001") && !strcmp(right.Id.chars, "1002"))
+ {
+ WidgetRef_Init(&left, _cb, ns);
+ WidgetRef_Set_Id(&left, "1001");
+
+ WidgetRef_Init(&right, _cb, ns);
+ WidgetRef_Set_Id(&right, "1002");
+
+ Gadget_Init(&g, _cb, ns);
+ Gadget_Set_Left(&g, &left);
+ Gadget_Set_Right(&g, &right);
+ KReturnInstance(cr, g);
+ KReturn(OK);
+ }
+ else if (!strcmp(left.Id.chars, "1001") && !strcmp(right.Id.chars, "1003"))
+ {
+ WidgetRef_Init(&left, _cb, ns);
+ WidgetRef_Set_Id(&left, "1001");
+
+ WidgetRef_Init(&right, _cb, ns);
+ WidgetRef_Set_Id(&right, "1003");
+
+ Gadget_Init(&g, _cb, ns);
+ Gadget_Set_Left(&g, &left);
+ Gadget_Set_Right(&g, &right);
+ KReturnInstance(cr, g);
+ KReturn(OK);
+ }
+
+ KReturn(ERR_NOT_FOUND);
+}
+
+static CMPIStatus GadgetCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus GadgetModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char**properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus GadgetDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus GadgetExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus GadgetAssociationCleanup(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus GadgetAssociators(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole,
+ const char** properties)
+{
+ return KDefaultAssociators(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Gadget_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole,
+ properties);
+}
+
+static CMPIStatus GadgetAssociatorNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* resultClass,
+ const char* role,
+ const char* resultRole)
+{
+ return KDefaultAssociatorNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Gadget_ClassName,
+ assocClass,
+ resultClass,
+ role,
+ resultRole);
+}
+
+static CMPIStatus GadgetReferences(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role,
+ const char** properties)
+{
+ return KDefaultReferences(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Gadget_ClassName,
+ assocClass,
+ role,
+ properties);
+}
+
+static CMPIStatus GadgetReferenceNames(
+ CMPIAssociationMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* assocClass,
+ const char* role)
+{
+ return KDefaultReferenceNames(
+ _cb,
+ mi,
+ cc,
+ cr,
+ cop,
+ Gadget_ClassName,
+ assocClass,
+ role);
+}
+
+CMInstanceMIStub(
+ Gadget,
+ KC_Gadget,
+ _cb,
+ GadgetInitialize())
+
+CMAssociationMIStub(
+ Gadget,
+ KC_Gadget,
+ _cb,
+ GadgetInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "KC_Gadget",
+ "KC_Gadget",
+ "instance association");
Added: cmpi-bindings/trunk/test/konkret/Makefile
===================================================================
--- cmpi-bindings/trunk/test/konkret/Makefile (rev 0)
+++ cmpi-bindings/trunk/test/konkret/Makefile 2008-10-23 00:50:26 UTC (rev 1121)
@@ -0,0 +1,41 @@
+TARGET = libWidgetProvider.so
+
+SOURCES = WidgetProvider.c GadgetProvider.c UpcallProvider.c
+
+OBJECTS = $(SOURCES:.c=.o)
+
+INCLUDES += -I/usr/include/cmpi
+
+LIBRARIES += -lkonkret
+
+FLAGS = -g -Wall -O2 -fPIC
+
+all:
+ echo $(OBJECTS)
+ gcc $(FLAGS) -c $(INCLUDES) WidgetProvider.c
+ gcc $(FLAGS) -c $(INCLUDES) GadgetProvider.c
+ gcc $(FLAGS) -c $(INCLUDES) UpcallProvider.c
+ gcc $(FLAGS) -shared -o $(TARGET) $(INCLUDES) $(OBJECTS) $(LIBRARIES)
+
+clean:
+ rm -rf $(TARGET)
+
+gen:
+ konkret -s KC_Upcall -s KC_Widget -s KC_Gadget -m Widget.mof KC_Widget=Widget KC_Gadget=Gadget KC_Upcall=Upcall
+
+install:
+ konkretreg $(TARGET) > Widget.reg
+ su -c "make install-su"
+
+install-su:
+ cp $(TARGET) /usr/lib64
+ cp Widget.mof /var/lib/sfcb/stage/mofs/root/cimv2
+ cp Widget.mof /var/lib/sfcb/stage/mofs/root/interop
+ cp Widget.reg /var/lib/sfcb/stage/regs
+ sfcbrepos -f
+
+reg:
+ cp $(TARGET) $(PEGASUS_HOME)/lib
+ cimmof Widget.mof
+ cimmof -n root/PG_InterOp register.mof
+
Added: cmpi-bindings/trunk/test/konkret/README
===================================================================
--- cmpi-bindings/trunk/test/konkret/README (rev 0)
+++ cmpi-bindings/trunk/test/konkret/README 2008-10-23 00:50:26 UTC (rev 1121)
@@ -0,0 +1,8 @@
+This directory contains test to reproduce an upcall hang in Pegasus. To
+try, install KonkretCMPI 0.8.7. Build this provider with "make". Use the
+.reg files to register with pegasus. Copy library into place. Then run the
+upcall provider as follows:
+
+ $ cimcli ei KC_Upcall
+
+This hangs in the _references() test.
Added: cmpi-bindings/trunk/test/konkret/Upcall.h
===================================================================
--- cmpi-bindings/trunk/test/konkret/Upcall.h (rev 0)
+++ cmpi-bindings/trunk/test/konkret/Upcall.h 2008-10-23 00:50:26 UTC (rev 1121)
@@ -0,0 +1,284 @@
+/*
+**==============================================================================
+**
+** CAUTION: This file generated by KonkretCMPI. Please do not edit.
+**
+**==============================================================================
+*/
+
+#ifndef _konkrete_Upcall_h
+#define _konkrete_Upcall_h
+
+#include <konkret/konkret.h>
+
+/*
+**==============================================================================
+**
+** struct UpcallRef
+**
+**==============================================================================
+*/
+
+/* classname=KC_Upcall */
+typedef struct _UpcallRef
+{
+ KBase __base;
+ /* KC_Upcall features */
+ const KString Id;
+}
+UpcallRef;
+
+static const unsigned char __UpcallRef_sig[] =
+{
+ 0x09,0x4b,0x43,0x5f,0x55,0x70,0x63,0x61,0x6c,0x6c,0x00,0x01,0x4c,0x02,0x49,
+ 0x64,0x00,
+};
+
+KINLINE void UpcallRef_Init(
+ UpcallRef* self,
+ const CMPIBroker* cb,
+ const char* ns)
+{
+ const unsigned char* sig = __UpcallRef_sig;
+ KBase_Init(&self->__base, cb, sizeof(*self), sig, ns);
+}
+
+KINLINE CMPIStatus UpcallRef_InitFromInstance(
+ UpcallRef* self,
+ const CMPIBroker* cb,
+ const CMPIInstance* x)
+{
+ UpcallRef_Init(self, cb, NULL);
+ return KBase_FromInstance(&self->__base, x);
+}
+
+KINLINE CMPIStatus UpcallRef_InitFromObjectPath(
+ UpcallRef* self,
+ const CMPIBroker* cb,
+ const CMPIObjectPath* x)
+{
+ UpcallRef_Init(self, cb, NULL);
+ return KBase_FromObjectPath(&self->__base, x);
+}
+
+KINLINE void UpcallRef_Print(
+ const UpcallRef* self,
+ FILE* os)
+{
+ KBase_Print(os, &self->__base, 'r');
+}
+
+KINLINE CMPIInstance* UpcallRef_ToInstance(
+ const UpcallRef* self,
+ CMPIStatus* status)
+{
+ return KBase_ToInstance(&self->__base, status);
+}
+
+KINLINE CMPIObjectPath* UpcallRef_ToObjectPath(
+ const UpcallRef* self,
+ CMPIStatus* status)
+{
+ return KBase_ToObjectPath(&self->__base, status);
+}
+
+KINLINE const char* UpcallRef_NameSpace(
+ UpcallRef* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ return self->__base.ns ? KChars(self->__base.ns) : NULL;
+ return NULL;
+}
+
+KINLINE void UpcallRef_SetString_Id(
+ UpcallRef* self,
+ CMPIString* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_SetString(field, x);
+ }
+}
+
+KINLINE void UpcallRef_Set_Id(
+ UpcallRef* self,
+ const char* s)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Set(field, self->__base.cb, s);
+ }
+}
+
+KINLINE void UpcallRef_Null_Id(
+ UpcallRef* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Null(field);
+ }
+}
+
+KINLINE void UpcallRef_Clr_Id(
+ UpcallRef* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Clr(field);
+ }
+}
+
+/*
+**==============================================================================
+**
+** struct Upcall
+**
+**==============================================================================
+*/
+
+/* classname=KC_Upcall */
+typedef struct _Upcall
+{
+ KBase __base;
+ /* KC_Upcall features */
+ const KString Id;
+}
+Upcall;
+
+static const unsigned char __Upcall_sig[] =
+{
+ 0x09,0x4b,0x43,0x5f,0x55,0x70,0x63,0x61,0x6c,0x6c,0x00,0x01,0x4c,0x02,0x49,
+ 0x64,0x00,
+};
+
+KINLINE void Upcall_Init(
+ Upcall* self,
+ const CMPIBroker* cb,
+ const char* ns)
+{
+ const unsigned char* sig = __Upcall_sig;
+ KBase_Init(&self->__base, cb, sizeof(*self), sig, ns);
+}
+
+KINLINE CMPIStatus Upcall_InitFromInstance(
+ Upcall* self,
+ const CMPIBroker* cb,
+ const CMPIInstance* x)
+{
+ Upcall_Init(self, cb, NULL);
+ return KBase_FromInstance(&self->__base, x);
+}
+
+KINLINE CMPIStatus Upcall_InitFromObjectPath(
+ Upcall* self,
+ const CMPIBroker* cb,
+ const CMPIObjectPath* x)
+{
+ Upcall_Init(self, cb, NULL);
+ return KBase_FromObjectPath(&self->__base, x);
+}
+
+KINLINE void Upcall_Print(
+ const Upcall* self,
+ FILE* os)
+{
+ KBase_Print(os, &self->__base, 'i');
+}
+
+KINLINE CMPIInstance* Upcall_ToInstance(
+ const Upcall* self,
+ CMPIStatus* status)
+{
+ return KBase_ToInstance(&self->__base, status);
+}
+
+KINLINE CMPIObjectPath* Upcall_ToObjectPath(
+ const Upcall* self,
+ CMPIStatus* status)
+{
+ return KBase_ToObjectPath(&self->__base, status);
+}
+
+KINLINE const char* Upcall_NameSpace(
+ Upcall* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ return self->__base.ns ? KChars(self->__base.ns) : NULL;
+ return NULL;
+}
+
+KINLINE void Upcall_SetString_Id(
+ Upcall* self,
+ CMPIString* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_SetString(field, x);
+ }
+}
+
+KINLINE void Upcall_Set_Id(
+ Upcall* self,
+ const char* s)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Set(field, self->__base.cb, s);
+ }
+}
+
+KINLINE void Upcall_Null_Id(
+ Upcall* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Null(field);
+ }
+}
+
+KINLINE void Upcall_Clr_Id(
+ Upcall* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Clr(field);
+ }
+}
+
+/*
+**==============================================================================
+**
+** Upcall methods
+**
+**==============================================================================
+*/
+
+KINLINE CMPIStatus Upcall_DispatchMethod(
+ const CMPIBroker* cb,
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ UpcallRef self;
+
+ KReturnIf(UpcallRef_InitFromObjectPath(&self, cb, cop));
+
+
+ KReturn(ERR_METHOD_NOT_FOUND);
+}
+
+#define Upcall_ClassName "KC_Upcall"
+
+#endif /* _konkrete_Upcall_h */
Added: cmpi-bindings/trunk/test/konkret/UpcallProvider.c
===================================================================
--- cmpi-bindings/trunk/test/konkret/UpcallProvider.c (rev 0)
+++ cmpi-bindings/trunk/test/konkret/UpcallProvider.c 2008-10-23 00:50:26 UTC (rev 1121)
@@ -0,0 +1,301 @@
+#include <konkret/konkret.h>
+#include "Upcall.h"
+
+static const CMPIBroker* _cb = NULL;
+
+static void UpcallInitialize()
+{
+}
+
+static CMPIStatus UpcallCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus UpcallEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ return KDefaultEnumerateInstanceNames(
+ _cb, mi, cc, cr, cop);
+}
+
+static CMPIStatus _associators(const CMPIContext* cc)
+{
+ CMPIObjectPath* op;
+ CMPIEnumeration* e;
+ CMPIStatus st;
+ size_t count = 0;
+
+ if (!(op = CMNewObjectPath(_cb, "root/cimv2", "KC_Widget", NULL)))
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ st = CMAddKey(op, "Id", "1001", CMPI_chars);
+
+ if (st.rc)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ if (!(e = CBAssociators(_cb, cc, op, NULL, NULL, NULL, NULL, NULL, NULL)))
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ while (CMHasNext(e, NULL))
+ {
+ CMPIData cd = CMGetNext(e, NULL);
+
+ if (cd.type != CMPI_instance)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ count++;
+ }
+
+ if (count == 0)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus _associatorNames(const CMPIContext* cc)
+{
+ CMPIObjectPath* op;
+ CMPIEnumeration* e;
+ CMPIStatus st;
+ size_t count = 0;
+
+ if (!(op = CMNewObjectPath(_cb, "root/cimv2", "KC_Widget", NULL)))
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ st = CMAddKey(op, "Id", "1001", CMPI_chars);
+
+ if (st.rc)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ if (!(e = CBAssociatorNames(_cb, cc, op, NULL, NULL, NULL, NULL, NULL)))
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ while (CMHasNext(e, NULL))
+ {
+ CMPIData cd = CMGetNext(e, NULL);
+
+ if (cd.type != CMPI_ref)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ count++;
+ }
+
+ if (count == 0)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus _references(const CMPIContext* cc)
+{
+ CMPIObjectPath* op;
+ CMPIEnumeration* e;
+ CMPIStatus st;
+ size_t count = 0;
+
+ if (!(op = CMNewObjectPath(_cb, "root/cimv2", "KC_Widget", NULL)))
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ st = CMAddKey(op, "Id", "1001", CMPI_chars);
+
+ if (st.rc)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ if (!(e = CBReferences(_cb, cc, op, NULL, NULL, NULL, NULL)))
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ while (CMHasNext(e, NULL))
+ {
+ CMPIData cd = CMGetNext(e, NULL);
+
+ if (cd.type != CMPI_instance)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ count++;
+ }
+
+ if (count == 0)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus _referenceNames(const CMPIContext* cc)
+{
+ CMPIObjectPath* op;
+ CMPIEnumeration* e;
+ CMPIStatus st;
+ size_t count = 0;
+
+ if (!(op = CMNewObjectPath(_cb, "root/cimv2", "KC_Widget", NULL)))
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ st = CMAddKey(op, "Id", "1001", CMPI_chars);
+
+ if (st.rc)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ if (!(e = CBReferenceNames(_cb, cc, op, NULL, NULL, NULL)))
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ printf("BEFORE\n");
+
+ while (CMHasNext(e, NULL))
+ {
+ CMPIData cd = CMGetNext(e, NULL);
+
+ printf("INSIDE\n");
+
+ if (cd.type != CMPI_ref)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ count++;
+ }
+
+ printf("AFTER\n");
+
+ if (count == 0)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus UpcallEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ printf("UpcallEnumInstances\n");
+
+ KTRACE;
+
+ if (_associators(cc).rc != CMPI_RC_OK)
+ {
+ printf("UpcallEnumInstances: _associators() failed\n");
+ }
+
+ KTRACE;
+
+ if (_associatorNames(cc).rc != CMPI_RC_OK)
+ {
+ printf("UpcallEnumInstances: _associatorNames() failed\n");
+ }
+
+ KTRACE;
+
+ if (_references(cc).rc != CMPI_RC_OK)
+ {
+ printf("UpcallEnumInstances: _references() failed\n");
+ }
+
+ KTRACE;
+
+ if (_referenceNames(cc).rc != CMPI_RC_OK)
+ {
+ printf("UpcallEnumInstances: _referenceNames() failed\n");
+ }
+
+ KTRACE;
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus UpcallGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ return KDefaultGetInstance(
+ _cb, mi, cc, cr, cop, properties);
+}
+
+static CMPIStatus UpcallCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus UpcallModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus UpcallDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus UpcallExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+CMInstanceMIStub(
+ Upcall,
+ KC_Upcall,
+ _cb,
+ UpcallInitialize())
+
+static CMPIStatus UpcallMethodCleanup(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus UpcallInvokeMethod(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ return Upcall_DispatchMethod(
+ _cb, mi, cc, cr, cop, meth, in, out);
+}
+
+CMMethodMIStub(
+ Upcall,
+ KC_Upcall,
+ _cb,
+ UpcallInitialize())
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "KC_Upcall",
+ "KC_Upcall",
+ "instance method");
Added: cmpi-bindings/trunk/test/konkret/Widget.h
===================================================================
--- cmpi-bindings/trunk/test/konkret/Widget.h (rev 0)
+++ cmpi-bindings/trunk/test/konkret/Widget.h 2008-10-23 00:50:26 UTC (rev 1121)
@@ -0,0 +1,458 @@
+/*
+**==============================================================================
+**
+** CAUTION: This file generated by KonkretCMPI. Please do not edit.
+**
+**==============================================================================
+*/
+
+#ifndef _konkrete_Widget_h
+#define _konkrete_Widget_h
+
+#include <konkret/konkret.h>
+
+/*
+**==============================================================================
+**
+** struct WidgetRef
+**
+**==============================================================================
+*/
+
+/* classname=KC_Widget */
+typedef struct _WidgetRef
+{
+ KBase __base;
+ /* KC_Widget features */
+ const KString Id;
+}
+WidgetRef;
+
+static const unsigned char __WidgetRef_sig[] =
+{
+ 0x09,0x4b,0x43,0x5f,0x57,0x69,0x64,0x67,0x65,0x74,0x00,0x01,0x4c,0x02,0x49,
+ 0x64,0x00,
+};
+
+KINLINE void WidgetRef_Init(
+ WidgetRef* self,
+ const CMPIBroker* cb,
+ const char* ns)
+{
+ const unsigned char* sig = __WidgetRef_sig;
+ KBase_Init(&self->__base, cb, sizeof(*self), sig, ns);
+}
+
+KINLINE CMPIStatus WidgetRef_InitFromInstance(
+ WidgetRef* self,
+ const CMPIBroker* cb,
+ const CMPIInstance* x)
+{
+ WidgetRef_Init(self, cb, NULL);
+ return KBase_FromInstance(&self->__base, x);
+}
+
+KINLINE CMPIStatus WidgetRef_InitFromObjectPath(
+ WidgetRef* self,
+ const CMPIBroker* cb,
+ const CMPIObjectPath* x)
+{
+ WidgetRef_Init(self, cb, NULL);
+ return KBase_FromObjectPath(&self->__base, x);
+}
+
+KINLINE void WidgetRef_Print(
+ const WidgetRef* self,
+ FILE* os)
+{
+ KBase_Print(os, &self->__base, 'r');
+}
+
+KINLINE CMPIInstance* WidgetRef_ToInstance(
+ const WidgetRef* self,
+ CMPIStatus* status)
+{
+ return KBase_ToInstance(&self->__base, status);
+}
+
+KINLINE CMPIObjectPath* WidgetRef_ToObjectPath(
+ const WidgetRef* self,
+ CMPIStatus* status)
+{
+ return KBase_ToObjectPath(&self->__base, status);
+}
+
+KINLINE const char* WidgetRef_NameSpace(
+ WidgetRef* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ return self->__base.ns ? KChars(self->__base.ns) : NULL;
+ return NULL;
+}
+
+KINLINE void WidgetRef_SetString_Id(
+ WidgetRef* self,
+ CMPIString* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_SetString(field, x);
+ }
+}
+
+KINLINE void WidgetRef_Set_Id(
+ WidgetRef* self,
+ const char* s)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Set(field, self->__base.cb, s);
+ }
+}
+
+KINLINE void WidgetRef_Null_Id(
+ WidgetRef* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Null(field);
+ }
+}
+
+KINLINE void WidgetRef_Clr_Id(
+ WidgetRef* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Clr(field);
+ }
+}
+
+/*
+**==============================================================================
+**
+** struct Widget
+**
+**==============================================================================
+*/
+
+/* classname=KC_Widget */
+typedef struct _Widget
+{
+ KBase __base;
+ /* KC_Widget features */
+ const KString Id;
+ const KString Color;
+ const KUint32 Size;
+}
+Widget;
+
+static const unsigned char __Widget_sig[] =
+{
+ 0x09,0x4b,0x43,0x5f,0x57,0x69,0x64,0x67,0x65,0x74,0x00,0x03,0x4c,0x02,0x49,
+ 0x64,0x00,0x0c,0x05,0x43,0x6f,0x6c,0x6f,0x72,0x00,0x05,0x04,0x53,0x69,0x7a,
+ 0x65,0x00,
+};
+
+KINLINE void Widget_Init(
+ Widget* self,
+ const CMPIBroker* cb,
+ const char* ns)
+{
+ const unsigned char* sig = __Widget_sig;
+ KBase_Init(&self->__base, cb, sizeof(*self), sig, ns);
+}
+
+KINLINE CMPIStatus Widget_InitFromInstance(
+ Widget* self,
+ const CMPIBroker* cb,
+ const CMPIInstance* x)
+{
+ Widget_Init(self, cb, NULL);
+ return KBase_FromInstance(&self->__base, x);
+}
+
+KINLINE CMPIStatus Widget_InitFromObjectPath(
+ Widget* self,
+ const CMPIBroker* cb,
+ const CMPIObjectPath* x)
+{
+ Widget_Init(self, cb, NULL);
+ return KBase_FromObjectPath(&self->__base, x);
+}
+
+KINLINE void Widget_Print(
+ const Widget* self,
+ FILE* os)
+{
+ KBase_Print(os, &self->__base, 'i');
+}
+
+KINLINE CMPIInstance* Widget_ToInstance(
+ const Widget* self,
+ CMPIStatus* status)
+{
+ return KBase_ToInstance(&self->__base, status);
+}
+
+KINLINE CMPIObjectPath* Widget_ToObjectPath(
+ const Widget* self,
+ CMPIStatus* status)
+{
+ return KBase_ToObjectPath(&self->__base, status);
+}
+
+KINLINE const char* Widget_NameSpace(
+ Widget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ return self->__base.ns ? KChars(self->__base.ns) : NULL;
+ return NULL;
+}
+
+KINLINE void Widget_SetString_Id(
+ Widget* self,
+ CMPIString* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_SetString(field, x);
+ }
+}
+
+KINLINE void Widget_Set_Id(
+ Widget* self,
+ const char* s)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Set(field, self->__base.cb, s);
+ }
+}
+
+KINLINE void Widget_Null_Id(
+ Widget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Null(field);
+ }
+}
+
+KINLINE void Widget_Clr_Id(
+ Widget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Id;
+ KString_Clr(field);
+ }
+}
+
+KINLINE void Widget_SetString_Color(
+ Widget* self,
+ CMPIString* x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Color;
+ KString_SetString(field, x);
+ }
+}
+
+KINLINE void Widget_Set_Color(
+ Widget* self,
+ const char* s)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Color;
+ KString_Set(field, self->__base.cb, s);
+ }
+}
+
+KINLINE void Widget_Null_Color(
+ Widget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Color;
+ KString_Null(field);
+ }
+}
+
+KINLINE void Widget_Clr_Color(
+ Widget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KString* field = (KString*)&self->Color;
+ KString_Clr(field);
+ }
+}
+
+KINLINE void Widget_Set_Size(
+ Widget* self,
+ CMPIUint32 x)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KUint32* field = (KUint32*)&self->Size;
+ KUint32_Set(field, x);
+ }
+}
+
+KINLINE void Widget_Null_Size(
+ Widget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KUint32* field = (KUint32*)&self->Size;
+ KUint32_Null(field);
+ }
+}
+
+KINLINE void Widget_Clr_Size(
+ Widget* self)
+{
+ if (self && self->__base.magic == KMAGIC)
+ {
+ KUint32* field = (KUint32*)&self->Size;
+ KUint32_Clr(field);
+ }
+}
+
+/* classname=KC_Widget */
+typedef struct _Widget_Add_Args
+{
+ KBase __base;
+ /* IN */
+ KUint32 X;
+ /* IN */
+ KUint32 Y;
+}
+Widget_Add_Args;
+
+static const unsigned char __Widget_Add_Args_sig[] =
+{
+ 0x03,0x41,0x64,0x64,0x00,0x02,0x25,0x01,0x58,0x00,0x25,0x01,0x59,0x00,
+};
+
+KINLINE void Widget_Add_Args_Init(
+ Widget_Add_Args* self,
+ const CMPIBroker* cb)
+{
+ const unsigned char* sig = __Widget_Add_Args_sig;
+ KBase_Init(&self->__base, cb, sizeof(*self), sig, NULL);
+}
+
+KINLINE CMPIStatus Widget_Add_Args_InitFromArgs(
+ Widget_Add_Args* self,
+ const CMPIBroker* cb,
+ const CMPIArgs* x,
+ CMPIBoolean in,
+ CMPIBoolean out)
+{
+ Widget_Add_Args_Init(self, cb);
+ return KBase_FromArgs(&self->__base, x, in, out);
+}
+
+KINLINE CMPIArgs* Widget_Add_Args_ToArgs(
+ const Widget_Add_Args* self,
+ CMPIBoolean in,
+ CMPIBoolean out,
+ CMPIStatus* status)
+{
+ return KBase_ToArgs(&self->__base, in, out, status);
+}
+
+KINLINE CMPIStatus Widget_Add_Args_SetArgs(
+ const Widget_Add_Args* self,
+ CMPIBoolean in,
+ CMPIBoolean out,
+ CMPIArgs* ca)
+{
+ return KBase_SetToArgs(&self->__base, in, out, ca);
+}
+
+KINLINE void Widget_Add_Args_Print(
+ const Widget_Add_Args* self,
+ FILE* os)
+{
+ KBase_Print(os, &self->__base, 'a');
+}
+
+/*
+**==============================================================================
+**
+** Widget methods
+**
+**==============================================================================
+*/
+
+KEXTERN KUint32 Widget_Add(
+ const CMPIBroker* cb,
+ CMPIMethodMI* mi,
+ const CMPIContext* context,
+ const KUint32* X,
+ const KUint32* Y,
+ CMPIStatus* status);
+
+KINLINE CMPIStatus Widget_DispatchMethod(
+ const CMPIBroker* cb,
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ WidgetRef self;
+
+ KReturnIf(WidgetRef_InitFromObjectPath(&self, cb, cop));
+
+ if (strcasecmp(meth, "Add") == 0)
+ {
+ CMPIStatus st = KSTATUS_INIT;
+ Widget_Add_Args args;
+ KUint32 r;
+
+ KReturnIf(Widget_Add_Args_InitFromArgs(
+ &args, cb, in, 1, 0));
+
+ r = Widget_Add(
+ cb,
+ mi,
+ cc,
+ &args.X,
+ &args.Y,
+ &st);
+
+ if (!KOkay(st))
+ return st;
+
+ if (!r.exists)
+ KReturn(ERR_FAILED);
+
+ KReturnIf(Widget_Add_Args_SetArgs(
+ &args, 0, 1, out));
+ KReturnUint32Data(cr, &r);
+ CMReturnDone(cr);
+
+ KReturn(OK);
+ }
+
+ KReturn(ERR_METHOD_NOT_FOUND);
+}
+
+#define Widget_ClassName "KC_Widget"
+
+#endif /* _konkrete_Widget_h */
Added: cmpi-bindings/trunk/test/konkret/Widget.mof
===================================================================
--- cmpi-bindings/trunk/test/konkret/Widget.mof (rev 0)
+++ cmpi-bindings/trunk/test/konkret/Widget.mof 2008-10-23 00:50:26 UTC (rev 1121)
@@ -0,0 +1,21 @@
+class KC_Widget
+{
+ [Key] String Id;
+ string Color;
+ uint32 Size;
+
+ [Static]
+ uint32 Add([In] uint32 X, [In] uint32 Y);
+};
+
+[Association]
+class KC_Gadget
+{
+ [Key] KC_Widget REF Left;
+ [Key] KC_Widget REF Right;
+};
+
+class KC_Upcall
+{
+ [Key] String Id;
+};
Added: cmpi-bindings/trunk/test/konkret/Widget.reg
===================================================================
--- cmpi-bindings/trunk/test/konkret/Widget.reg (rev 0)
+++ cmpi-bindings/trunk/test/konkret/Widget.reg 2008-10-23 00:50:26 UTC (rev 1121)
@@ -0,0 +1,18 @@
+[KC_Widget]
+ provider: KC_Widget
+ location: WidgetProvider
+ type: instance method
+ namespace: root/cimv2
+#
+[KC_Gadget]
+ provider: KC_Gadget
+ location: WidgetProvider
+ type: instance association
+ namespace: root/cimv2
+#
+[KC_Upcall]
+ provider: KC_Upcall
+ location: WidgetProvider
+ type: instance method
+ namespace: root/cimv2
+#
Added: cmpi-bindings/trunk/test/konkret/WidgetProvider.c
===================================================================
--- cmpi-bindings/trunk/test/konkret/WidgetProvider.c (rev 0)
+++ cmpi-bindings/trunk/test/konkret/WidgetProvider.c 2008-10-23 00:50:26 UTC (rev 1121)
@@ -0,0 +1,215 @@
+#include <konkret/konkret.h>
+#include "Widget.h"
+
+static const CMPIBroker* _broker = NULL;
+
+static void WidgetInitialize()
+{
+}
+
+static CMPIStatus WidgetCleanup(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus WidgetEnumInstanceNames(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ WidgetRef w;
+
+ /* Widget.Id="1001" */
+ WidgetRef_Init(&w, _broker, KNameSpace(cop));
+ WidgetRef_Set_Id(&w, "1001");
+ KReturnObjectPath(cr, w);
+
+ /* Widget.Id="1002" */
+ WidgetRef_Init(&w, _broker, KNameSpace(cop));
+ WidgetRef_Set_Id(&w, "1002");
+ KReturnObjectPath(cr, w);
+
+ /* Widget.Id=1003 */
+ WidgetRef_Init(&w, _broker, KNameSpace(cop));
+ WidgetRef_Set_Id(&w, "1003");
+ KReturnObjectPath(cr, w);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus WidgetEnumInstances(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ Widget w;
+
+ /* Widget.Id="1001" */
+ Widget_Init(&w, _broker, KNameSpace(cop));
+ Widget_Set_Id(&w, "1001");
+ Widget_Set_Color(&w, "Red");
+ Widget_Set_Size(&w, 1);
+ KReturnInstance(cr, w);
+
+ /* Widget.Id="1002" */
+ Widget_Init(&w, _broker, KNameSpace(cop));
+ Widget_Set_Id(&w, "1002");
+ Widget_Set_Color(&w, "Green");
+ Widget_Set_Size(&w, 2);
+ KReturnInstance(cr, w);
+
+ /* Widget.Id=1003 */
+ Widget_Init(&w, _broker, KNameSpace(cop));
+ Widget_Set_Id(&w, "1003");
+ Widget_Set_Color(&w, "Blue");
+ Widget_Set_Size(&w, 3);
+ KReturnInstance(cr, w);
+
+ CMReturn(CMPI_RC_OK);
+}
+
+CMPIStatus WidgetGetInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* result,
+ const CMPIObjectPath* cop,
+ const char** properties)
+{
+ WidgetRef wr;
+ Widget w;
+
+ WidgetRef_InitFromObjectPath(&wr, _broker, cop);
+
+ if (!wr.Id.exists || wr.Id.null)
+ CMReturn(CMPI_RC_ERR_FAILED);
+
+ if (strcmp(wr.Id.chars, "1001") == 0)
+ {
+ Widget_Init(&w, _broker, KNameSpace(cop));
+ Widget_Set_Id(&w, "1001");
+ Widget_Set_Color(&w, "Red");
+ Widget_Set_Size(&w, 1);
+ KReturnInstance(result, w);
+ CMReturn(CMPI_RC_OK);
+ }
+ else if (strcmp(wr.Id.chars, "1002") == 0)
+ {
+ Widget_Init(&w, _broker, KNameSpace(cop));
+ Widget_Set_Id(&w, "1002");
+ Widget_Set_Color(&w, "Green");
+ Widget_Set_Size(&w, 2);
+ KReturnInstance(result, w);
+ CMReturn(CMPI_RC_OK);
+ }
+ else if (strcmp(wr.Id.chars, "1003") == 0)
+ {
+ Widget_Init(&w, _broker, KNameSpace(cop));
+ Widget_Set_Id(&w, "1003");
+ Widget_Set_Color(&w, "Blue");
+ Widget_Set_Size(&w, 3);
+ KReturnInstance(result, w);
+ CMReturn(CMPI_RC_OK);
+ }
+
+ CMReturn(CMPI_RC_ERR_NOT_FOUND);
+}
+
+static CMPIStatus WidgetCreateInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus WidgetModifyInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const CMPIInstance* ci,
+ const char** properties)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus WidgetDeleteInstance(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+static CMPIStatus WidgetExecQuery(
+ CMPIInstanceMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* lang,
+ const char* query)
+{
+ CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
+}
+
+CMInstanceMIStub(
+ Widget,
+ KC_Widget,
+ _broker,
+ WidgetInitialize())
+
+static CMPIStatus WidgetMethodCleanup(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ CMPIBoolean term)
+{
+ CMReturn(CMPI_RC_OK);
+}
+
+static CMPIStatus WidgetInvokeMethod(
+ CMPIMethodMI* mi,
+ const CMPIContext* cc,
+ const CMPIResult* cr,
+ const CMPIObjectPath* cop,
+ const char* meth,
+ const CMPIArgs* in,
+ CMPIArgs* out)
+{
+ return Widget_DispatchMethod(
+ _broker, mi, cc, cr, cop, meth, in, out);
+}
+
+CMMethodMIStub(
+ Widget,
+ KC_Widget,
+ _broker,
+ WidgetInitialize())
+
+KUint32 Widget_Add(
+ const CMPIBroker* cb,
+ CMPIMethodMI* mi,
+ const CMPIContext* context,
+ const KUint32* X,
+ const KUint32* Y,
+ CMPIStatus* status)
+{
+ KUint32 result = KUINT32_INIT;
+
+ KSetStatus(status, ERR_NOT_SUPPORTED);
+ return result;
+}
+
+KONKRET_REGISTRATION(
+ "root/cimv2",
+ "KC_Widget",
+ "KC_Widget",
+ "instance method");
Added: cmpi-bindings/trunk/test/konkret/register.mof
===================================================================
--- cmpi-bindings/trunk/test/konkret/register.mof (rev 0)
+++ cmpi-bindings/trunk/test/konkret/register.mof 2008-10-23 00:50:26 UTC (rev 1121)
@@ -0,0 +1,96 @@
+/*
+**==============================================================================
+**
+** Widget Module
+**
+**==============================================================================
+*/
+
+instance of PG_ProviderModule
+{
+ Name = "KC_WidgetModule";
+ Vendor = "Pegasus";
+ Version = "2.0.0";
+ InterfaceType = "CMPI";
+ InterfaceVersion = "2.0.0";
+ Location = "WidgetProvider";
+};
+
+/*
+**==============================================================================
+**
+** Widget Provider
+**
+**==============================================================================
+*/
+
+instance of PG_Provider
+{
+ Name = "KC_Widget";
+ ProviderModuleName = "KC_WidgetModule";
+};
+
+instance of PG_ProviderCapabilities
+{
+ CapabilityID = "KC_Widget";
+ ProviderModuleName = "KC_WidgetModule";
+ ProviderName = "KC_Widget";
+ ClassName = "KC_Widget";
+ Namespaces = {"root/cimv2"};
+ ProviderType = { 2 /*instance*/, 5 /*method*/ };
+ supportedProperties = NULL;
+ supportedMethods = NULL;
+};
+
+/*
+**==============================================================================
+**
+** Gadget Provider
+**
+**==============================================================================
+*/
+
+instance of PG_Provider
+{
+ Name = "KC_Gadget";
+ ProviderModuleName = "KC_WidgetModule";
+};
+
+instance of PG_ProviderCapabilities
+{
+ CapabilityID = "KC_Gadget";
+ ProviderModuleName = "KC_WidgetModule";
+ ProviderName = "KC_Gadget";
+ ClassName = "KC_Gadget";
+ Namespaces = {"root/cimv2"};
+ ProviderType = { 2 /*instance*/, 3, /*association*/ 5 /*method*/ };
+ supportedProperties = NULL;
+ supportedMethods = NULL;
+};
+
+/*
+**==============================================================================
+**
+** Upcall Provider
+**
+**==============================================================================
+*/
+
+instance of PG_Provider
+{
+ Name = "KC_Upcall";
+ ProviderModuleName = "KC_WidgetModule";
+};
+
+instance of PG_ProviderCapabilities
+{
+ CapabilityID = "KC_Upcall";
+ ProviderModuleName = "KC_WidgetModule";
+ ProviderName = "KC_Upcall";
+ ClassName = "KC_Upcall";
+ Namespaces = {"root/cimv2"};
+ ProviderType = { 2 /*instance*/, 5 /*method*/ };
+ supportedProperties = NULL;
+ supportedMethods = NULL;
+};
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2008-10-21 23:29:54
|
Revision: 1120
http://omc.svn.sourceforge.net/omc/?rev=1120&view=rev
Author: bartw
Date: 2008-10-21 23:29:48 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
allow some instances to be created without a namespace, if the broker allows this. This is a workaround for sblim-sfcb bug 2185410
Modified Paths:
--------------
cmpi-bindings/trunk/swig/cmpi_callbacks.i
cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
Modified: cmpi-bindings/trunk/swig/cmpi_callbacks.i
===================================================================
--- cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-10-21 23:04:10 UTC (rev 1119)
+++ cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-10-21 23:29:48 UTC (rev 1120)
@@ -250,7 +250,7 @@
return result;
}
- CMPIInstance* new_instance(const CMPIObjectPath* path)
+ CMPIInstance* new_instance(const CMPIObjectPath* path, int allow_null_ns)
{
CMPIStatus st = { CMPI_RC_OK, NULL };
CMPIInstance* result;
@@ -259,13 +259,16 @@
/* Raise exception if no namespace */
- if (!(ns = CMGetNameSpace(path, &st)) || st.rc ||
- !(str = CMGetCharsPtr(ns, NULL)) || *str == '\0')
+ if (!allow_null_ns)
{
- CMSetStatusWithChars($self, &st, CMPI_RC_ERR_FAILED,
- "object path has no namespace");
- _raise_ex(&st);
- return NULL;
+ if (!(ns = CMGetNameSpace(path, &st)) || st.rc ||
+ !(str = CMGetCharsPtr(ns, NULL)) || *str == '\0')
+ {
+ CMSetStatusWithChars($self, &st, CMPI_RC_ERR_FAILED,
+ "object path has no namespace");
+ _raise_ex(&st);
+ return NULL;
+ }
}
result = CMNewInstance($self, path, &st);
Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
===================================================================
--- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-21 23:04:10 UTC (rev 1119)
+++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-21 23:29:48 UTC (rev 1120)
@@ -346,8 +346,17 @@
return self.broker.modifyInstance(self.ctx, cop, inst)
def DeliverIndication(self, ns, instance):
- inst = self.proxy.pywbem2cmpi_inst(instance)
- return self.broker.deliverIndication(self.ctx, ns, inst)
+ if self.broker.name() == 'Pegasus':
+ allow_null_ns = False
+ else:
+ allow_null_ns = True
+ if self.broker.name() == 'RequestHandler':
+ # Check sblim bug #2185410.
+ if instance.path is not None:
+ instance.path.namespace = None
+ inst = self.proxy.pywbem2cmpi_inst(instance, allow_null_ns)
+ rv = self.broker.deliverIndication(self.ctx, ns, inst)
+ return rv
def is_subclass(self, ns, super, sub):
subObjPath=self.broker.new_object_path(ns, sub)
@@ -696,12 +705,17 @@
return cargs
- def pywbem2cmpi_inst(self, pinst):
+ def pywbem2cmpi_inst(self, pinst, allow_null_ns=False):
pcop = pinst.path
- if pcop is None:
- pcop = pywbem.CIMInstanceName(pinst.classname)
+ if not allow_null_ns:
+ if pcop is None or pcop.namespace is None:
+ raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_NAMESPACE,
+ "Instance must have a namespace")
+ else:
+ if pcop is None:
+ pcop = pywbem.CIMInstanceName(pinst.classname)
cop = self.pywbem2cmpi_instname(pcop)
- cinst = self.broker.new_instance(cop)
+ cinst = self.broker.new_instance(cop, allow_null_ns)
if pinst.property_list is not None:
cinst.set_property_filter(pinst.property_list)
for prop in pinst.properties.values():
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2008-10-21 23:04:17
|
Revision: 1119
http://omc.svn.sourceforge.net/omc/?rev=1119&view=rev
Author: bartw
Date: 2008-10-21 23:04:10 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
minor change
Modified Paths:
--------------
cmpi-bindings/trunk/test/python/UpcallAtomProvider.py
Modified: cmpi-bindings/trunk/test/python/UpcallAtomProvider.py
===================================================================
--- cmpi-bindings/trunk/test/python/UpcallAtomProvider.py 2008-10-21 23:03:37 UTC (rev 1118)
+++ cmpi-bindings/trunk/test/python/UpcallAtomProvider.py 2008-10-21 23:04:10 UTC (rev 1119)
@@ -824,8 +824,7 @@
cur_ind_count = 0
try:
-
- alert_ind = pywbem.CIMInstance("UpcallAtom_Indication",
+ alert_ind = pywbem.CIMInstance('UpcallAtom_Indication',
path=pywbem.CIMInstanceName('UpcallAtom_Indication',
namespace=object_name.namespace))
alert_ind['AlertType'] = pywbem.Uint16(2)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2008-10-21 23:03:44
|
Revision: 1118
http://omc.svn.sourceforge.net/omc/?rev=1118&view=rev
Author: bartw
Date: 2008-10-21 23:03:37 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
delete stale subscriptions before starting the test
Modified Paths:
--------------
cmpi-bindings/trunk/test/python/TestIndications.py
Modified: cmpi-bindings/trunk/test/python/TestIndications.py
===================================================================
--- cmpi-bindings/trunk/test/python/TestIndications.py 2008-10-21 20:09:08 UTC (rev 1117)
+++ cmpi-bindings/trunk/test/python/TestIndications.py 2008-10-21 23:03:37 UTC (rev 1118)
@@ -75,6 +75,26 @@
filtercop = ch.CreateInstance(filterinst)
return filtercop
+def deleteAllSubs(ch, destination='http://localhost:%s' % _port,
+ ns=_interop_ns):
+ subs = ch.EnumerateInstanceNames('CIM_IndicationSubscription',
+ namespace=ns)
+ num = 0
+ for sub in subs:
+ handler_name = sub['Handler']
+ try:
+ handler = ch.GetInstance(handler_name, PropertyList=['Destination'])
+ except pywbem.CIMError, args:
+ print "** Error fetching handler instance: %s %s" % \
+ (handler_name, args)
+ continue
+ if handler['Destination'] == destination:
+ deleteSubscription(ch, sub)
+ num+= 1
+ if num > 0:
+ print '** deleted %d subscriptions' % num
+
+
def createDest( ch, destination='http://localhost:%s' % _port,
ns=_interop_ns,
in_name=None):
@@ -173,6 +193,8 @@
cl = CIMListener(callback=cb, http_port=5309)
+ deleteAllSubs(conn, ns=_interop_ns)
+
def threadfunc():
try:
time.sleep(1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <np...@us...> - 2008-10-21 20:09:15
|
Revision: 1117
http://omc.svn.sourceforge.net/omc/?rev=1117&view=rev
Author: npaxton
Date: 2008-10-21 20:09:08 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
remove props from AssociatorNames upcall
Modified Paths:
--------------
cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
===================================================================
--- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-21 16:56:09 UTC (rev 1116)
+++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-21 20:09:08 UTC (rev 1117)
@@ -272,7 +272,7 @@
yield pinst
def AssociatorNames(self, path, assocClass = None, resultClass = None,
- role = None, resultRole = None, props = None):
+ role = None, resultRole = None):
cop = self.proxy.pywbem2cmpi_instname(path)
e = self.broker.associatorNames(self.ctx, cop, assocClass, resultClass,
role, resultRole)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2008-10-21 16:56:16
|
Revision: 1116
http://omc.svn.sourceforge.net/omc/?rev=1116&view=rev
Author: bartw
Date: 2008-10-21 16:56:09 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
preserve original cmpi error in description
Modified Paths:
--------------
cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
===================================================================
--- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-21 16:36:45 UTC (rev 1115)
+++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-21 16:56:09 UTC (rev 1116)
@@ -54,6 +54,10 @@
desc = ex.get_description()
if code < 0 or code > 17:
+ if desc is None:
+ desc = str(code)
+ else:
+ desc = str(code) + ':' + desc
code = pywbem.CIM_ERR_FAILED
return pywbem.CIMError(code, desc)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <np...@us...> - 2008-10-21 16:36:53
|
Revision: 1115
http://omc.svn.sourceforge.net/omc/?rev=1115&view=rev
Author: npaxton
Date: 2008-10-21 16:36:45 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
add ModifyInstance, refactor CreateInstance(remove path parameter), yank obsolete calls (from v1 that cmpi doesn't support) that were no-ops
Modified Paths:
--------------
cmpi-bindings/trunk/swig/cmpi_callbacks.i
cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
cmpi-bindings/trunk/test/python/UpcallAtomProvider.py
Modified: cmpi-bindings/trunk/swig/cmpi_callbacks.i
===================================================================
--- cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-10-20 16:41:46 UTC (rev 1114)
+++ cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-10-21 16:36:45 UTC (rev 1115)
@@ -101,11 +101,13 @@
return result;
}
- /*
- CMPIStatus setInstance(const CMPIContext* ctx, const CMPIObjectPath* op, const CMPIInstance* inst, const char** properties) {
- return CBSetInstance($self, ctx, op, inst, properties);
+ void modifyInstance(
+ const CMPIContext *ctx,
+ const CMPIObjectPath *op,
+ const CMPIInstance *inst)
+ {
+ RAISE_IF(CBModifyInstance($self, ctx, op, inst));
}
- */
void deleteInstance(
const CMPIContext * ctx,
Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
===================================================================
--- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-20 16:41:46 UTC (rev 1114)
+++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-21 16:36:45 UTC (rev 1115)
@@ -314,23 +314,13 @@
rslt = (outrc,outargs)
return rslt
- def GetClass(self, *args, **kwargs):
- raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED)
-
- def EnumerateClassNames(self, *args, **kwargs):
- raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED)
-
- def EnumerateClasses(self, *args, **kwargs):
- raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED)
-
- def CreateClass(self, *args, **kwargs):
- raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED)
-
- def DeleteClass(self, *args, **kwargs):
- raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED)
-
- def CreateInstance(self, path, instance):
- cop = self.proxy.pywbem2cmpi_instname(path)
+ def CreateInstance(self, instance):
+ if instance.path is None or not instance.path:
+ # no INVALID_PATH error... INVALID_NAMESPACE is best option
+ raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_NAMESPACE)
+ if instance.path.namespace is None or not instance.path.namespace:
+ raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_NAMESPACE)
+ cop = self.proxy.pywbem2cmpi_instname(instance.path)
inst = self.proxy.pywbem2cmpi_inst(instance)
ciname = self.broker.createInstance(self.ctx, cop, inst)
if ciname is None:
@@ -341,13 +331,20 @@
cop = self.proxy.pywbem2cmpi_instname(path)
return self.broker.deleteInstance(self.ctx, cop)
+ def ModifyInstance(self, instance):
+ if instance.path is None or not instance.path:
+ # no INVALID_PATH error... INVALID_NAMESPACE is best option
+ raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_NAMESPACE)
+ if instance.path.namespace is None or not instance.path.namespace:
+ raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_NAMESPACE)
+ cop = self.proxy.pywbem2cmpi_instname(instance.path)
+ inst = self.proxy.pywbem2cmpi_inst(instance)
+ return self.broker.modifyInstance(self.ctx, cop, inst)
+
def DeliverIndication(self, ns, instance):
inst = self.proxy.pywbem2cmpi_inst(instance)
return self.broker.deliverIndication(self.ctx, ns, inst)
- ### Not sure whether this should be on BrokerCIMOMHandle or
- ### on ProviderEnvironment
- ### We may want to move it ?
def is_subclass(self, ns, super, sub):
subObjPath=self.broker.new_object_path(ns, sub)
return bool(self.broker.classPathIsA(subObjPath,super))
@@ -391,12 +388,6 @@
return Logger(self.proxy.broker, self.proxy.miname)
def get_cimom_handle(self):
return BrokerCIMOMHandle(self.proxy, self.ctx.cmpicontext)
- def get_user_name(self):
- pass
- def get_context_value(self, key):
- pass
- def set_context_value(self, key, value):
- pass
g_proxies = {}
Modified: cmpi-bindings/trunk/test/python/UpcallAtomProvider.py
===================================================================
--- cmpi-bindings/trunk/test/python/UpcallAtomProvider.py 2008-10-20 16:41:46 UTC (rev 1114)
+++ cmpi-bindings/trunk/test/python/UpcallAtomProvider.py 2008-10-21 16:36:45 UTC (rev 1115)
@@ -238,7 +238,7 @@
try:
msg = ''
- cipath = ch.CreateInstance(cop, new_instance)
+ cipath = ch.CreateInstance(new_instance)
new_instance.path = cipath
_inst_paths.append(cipath)
@@ -513,7 +513,7 @@
cop['id'] = 'One'
new_instance.path = cop
try:
- cipath=ch.CreateInstance(cop, new_instance)
+ cipath=ch.CreateInstance(new_instance)
new_instance.path = cipath
gotinst = ch.GetInstance(cipath)
@@ -589,6 +589,27 @@
except pywbem.CIMError, arg:
raise "**** CreateInstance Failed ****"
+
+ # now make sure throws appropriate exception if path not set
+ try:
+ new_instance = pywbem.CIMInstance('Test_Atom')
+ new_instance['Name'] = 'Failure'
+ # DO NOT set new_instance.path for this test... expect a failure
+ new_instance['boolProp'] = True
+
+ try:
+ cipath = ch.CreateInstance(new_instance)
+ #if I got here, then it's a failure
+ raise "Expected INVALID_NAMESPACE error but didn't get it"
+
+ except pywbem.CIMError, args:
+ if args[0] != pywbem.CIM_ERR_INVALID_NAMESPACE:
+ #not what we were looking for
+ raise
+ #else success
+ except:
+ raise
+
################################################################################
#test_3_enum_instances
#Test enumeration of instances and then compare them with the local
@@ -679,7 +700,6 @@
################################################################################
#test_6_modify_instance
- '''
print "####### test_6_modify_instance ########"
#Create an instance of "Boron" and then modify it to Helium
# Once modified, get_instance returns it and then check the values of it
@@ -712,7 +732,7 @@
mod_instance['Name'] = 'Boron'
try:
- ch.ModifyInstance(ch.default_namespace, mod_instance)
+ ch.ModifyInstance(mod_instance)
except pywbem.CIMError, arg:
raise
@@ -742,8 +762,8 @@
else:
raise "ModifyInstance Failed!!"
_cleanup(ch)
- '''
+
################################################################################
#test_7_delete
log_debug("######## test_7_delete #######", logger)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jc...@us...> - 2008-10-20 16:41:55
|
Revision: 1114
http://omc.svn.sourceforge.net/omc/?rev=1114&view=rev
Author: jcarey
Date: 2008-10-20 16:41:46 +0000 (Mon, 20 Oct 2008)
Log Message:
-----------
Switch some printfs over to debug out so they could be handled by the VM_BUILDER_DEBUG env variable mechanism
Modified Paths:
--------------
contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-service.c
contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.c
contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.h
contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmcreation-data.c
Modified: contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-service.c
===================================================================
--- contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-service.c 2008-10-19 20:57:27 UTC (rev 1113)
+++ contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-service.c 2008-10-20 16:41:46 UTC (rev 1114)
@@ -934,13 +934,11 @@
cmpiutilStrArray_destroy(vm_settings);
/* Execute vm-install with the constructed command line */
-#ifdef XEN_VMBUILDER_DEBUG
- printf("Executing:\n");
+ DEBUGOUT("Executing:\n");
for(i = 0; pstra->strs[i]; i++) {
- printf("%s ", pstra->strs[i]);
+ DEBUGOUT("%s ", pstra->strs[i]);
}
- printf("\n");
-#endif
+ DEBUGOUT("\n");
output = NULL;
DEBUGOUT("Calling vm-install...\n");
@@ -959,11 +957,9 @@
} else {
prv->uint32 = (CMPIUint32)WEXITSTATUS(cc);
DEBUGOUT("vm-install failed status: %u\n", prv->uint32);
-#ifdef XEN_VMBUILDER_DEBUG
if(output) {
- printf("vm-install output: %s\n", output);
+ DEBUGOUT("vm-install output: %s\n", output);
}
-#endif
}
} else {
strerror_r(errno, wkbfr, sizeof(wkbfr));
Modified: contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.c
===================================================================
--- contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.c 2008-10-19 20:57:27 UTC (rev 1113)
+++ contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.c 2008-10-20 16:41:46 UTC (rev 1114)
@@ -19,6 +19,13 @@
#endif
/******************************************************************************/
+int
+is_debug()
+{
+ return _is_debug;
+}
+
+/******************************************************************************/
void
set_debug_for_env()
{
Modified: contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.h
===================================================================
--- contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.h 2008-10-19 20:57:27 UTC (rev 1113)
+++ contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.h 2008-10-20 16:41:46 UTC (rev 1114)
@@ -24,6 +24,7 @@
void set_dt_prop(const CMPIBroker* broker, VMBDBCtx dbctx, int col_ndx,
CMPIInstance* instance, const char* prop_name, CMPIBoolean isInterval);
char** get_job_names();
+int is_debug();
void set_debug_for_env();
void vmbuilder_debug_out(const char* fmt, ...);
Modified: contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmcreation-data.c
===================================================================
--- contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmcreation-data.c 2008-10-19 20:57:27 UTC (rev 1113)
+++ contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmcreation-data.c 2008-10-20 16:41:46 UTC (rev 1114)
@@ -1226,7 +1226,7 @@
}
cmpiutilStrBuf_cat(pstrbuf, ");", 0);
- printf("SQL: %s\n", pstrbuf->bfr);
+ DEBUGOUT("SQL: %s\n", pstrbuf->bfr);
if (db_exec(pstrbuf->bfr, wkbfr, sizeof(wkbfr)) < 0LL) {
DEBUGOUT("CreateInstance(): failed inserting record into "
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jc...@us...> - 2008-10-19 20:57:37
|
Revision: 1113
http://omc.svn.sourceforge.net/omc/?rev=1113&view=rev
Author: jcarey
Date: 2008-10-19 20:57:27 +0000 (Sun, 19 Oct 2008)
Log Message:
-----------
Added code to print debug trace message if the VM_BUILDER_DEBUG environment variable is set. Even if not built for debug
Modified Paths:
--------------
contrib/xen-vm-builder/trunk/configure.ac
contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-job.c
contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-service.c
contrib/xen-vm-builder/trunk/src/providers/vm-builder/owning-job.c
contrib/xen-vm-builder/trunk/src/providers/vm-builder/setting-define-build.c
contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.c
contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.h
contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmcreation-data.c
Modified: contrib/xen-vm-builder/trunk/configure.ac
===================================================================
--- contrib/xen-vm-builder/trunk/configure.ac 2008-10-17 08:36:30 UTC (rev 1112)
+++ contrib/xen-vm-builder/trunk/configure.ac 2008-10-19 20:57:27 UTC (rev 1113)
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
-AC_INIT(sblim-cmpi-xenvm-builder, 1.0.2)
+AC_INIT(sblim-cmpi-xenvm-builder, 1.0.3)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADER([config.h])
Modified: contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-job.c
===================================================================
--- contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-job.c 2008-10-17 08:36:30 UTC (rev 1112)
+++ contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-job.c 2008-10-19 20:57:27 UTC (rev 1113)
@@ -157,7 +157,7 @@
memset(pinfo, 0, sizeof(*pinfo));
if (cmpiutilExecuteProcessAndGatherOutputAndError((char* const*)cmd, NULL, &output,
&output_size, -1, NULL, NULL, -1, NULL, &status, -1) == 0) {
- //DEBUGOUT("vm-install-jobs -s returned %d - %s\n", status, output);
+ DEBUGOUT("vm-install-jobs -s returned %d - %s\n", status, output);
unsigned int num_elements;
lines = cmpiutilStrTokenize(output, "\r\n", &num_elements);
if (lines) {
@@ -739,11 +739,10 @@
Init(
CMPIInstanceMI* self)
{
+ set_debug_for_env();
DEBUGOUT("Initialize() called\n");
-
DEBUGOUT("Deleting job xref recs that no longer exist\n");
db_delete_dead_job_recs(NULL);
-
DEBUGOUT("Leaving Initialize()\n");
}
@@ -775,6 +774,7 @@
MethodInit(
CMPIMethodMI * self)
{
+ set_debug_for_env();
DEBUGOUT("MethodInitialize() called\n");
// do work here if necessary
@@ -916,6 +916,7 @@
AssocInit(
CMPIAssociationMI* self)
{
+ set_debug_for_env();
DEBUGOUT("AssocInit() called");
DEBUGOUT("Leaving AssocInit()\n");
Modified: contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-service.c
===================================================================
--- contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-service.c 2008-10-17 08:36:30 UTC (rev 1112)
+++ contrib/xen-vm-builder/trunk/src/providers/vm-builder/builder-service.c 2008-10-19 20:57:27 UTC (rev 1113)
@@ -527,6 +527,7 @@
Init(
CMPIInstanceMI* self)
{
+ set_debug_for_env();
DEBUGOUT("Initialize() called\n");
DEBUGOUT("Leaving Initialize()\n");
@@ -560,6 +561,7 @@
MethodInit(
CMPIMethodMI * self)
{
+ set_debug_for_env();
DEBUGOUT("MethodInitialize() called\n");
// do work here if necessary
@@ -1168,6 +1170,7 @@
AssocInit(
CMPIAssociationMI* self)
{
+ set_debug_for_env();
DEBUGOUT("AssocInit() called");
DEBUGOUT("Leaving AssocInit()\n");
Modified: contrib/xen-vm-builder/trunk/src/providers/vm-builder/owning-job.c
===================================================================
--- contrib/xen-vm-builder/trunk/src/providers/vm-builder/owning-job.c 2008-10-17 08:36:30 UTC (rev 1112)
+++ contrib/xen-vm-builder/trunk/src/providers/vm-builder/owning-job.c 2008-10-19 20:57:27 UTC (rev 1113)
@@ -414,6 +414,7 @@
Init(
CMPIInstanceMI* self)
{
+ set_debug_for_env();
DEBUGOUT("Initialize() called\n");
db_delete_dead_job_recs(NULL);
@@ -453,6 +454,7 @@
AssocInit(
CMPIAssociationMI* self)
{
+ set_debug_for_env();
DEBUGOUT("AssocInit() called");
DEBUGOUT("Leaving AssocInit()\n");
Modified: contrib/xen-vm-builder/trunk/src/providers/vm-builder/setting-define-build.c
===================================================================
--- contrib/xen-vm-builder/trunk/src/providers/vm-builder/setting-define-build.c 2008-10-17 08:36:30 UTC (rev 1112)
+++ contrib/xen-vm-builder/trunk/src/providers/vm-builder/setting-define-build.c 2008-10-19 20:57:27 UTC (rev 1113)
@@ -436,6 +436,7 @@
Init(
CMPIInstanceMI* self)
{
+ set_debug_for_env();
DEBUGOUT("Initialize() called\n");
db_delete_dead_job_recs(NULL);
@@ -475,6 +476,7 @@
AssocInit(
CMPIAssociationMI* self)
{
+ set_debug_for_env();
DEBUGOUT("AssocInit() called");
DEBUGOUT("Leaving AssocInit()\n");
Modified: contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.c
===================================================================
--- contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.c 2008-10-17 08:36:30 UTC (rev 1112)
+++ contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.c 2008-10-19 20:57:27 UTC (rev 1113)
@@ -1,6 +1,9 @@
#include "vmbuilder-util.h"
#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
#include <errno.h>
#include <cmpidt.h>
#include <cmpift.h>
@@ -8,7 +11,48 @@
#include <cmpiutil/string.h>
#include <cmpiutil/exec.h>
+
+#ifdef XEN_VMBUILDER_DEBUG
+static int _is_debug = 1;
+#else
+static int _is_debug = 0;
+#endif
+
/******************************************************************************/
+void
+set_debug_for_env()
+{
+ const char* penv = getenv("VM_BUILDER_DEBUG");
+ if (NULL != penv)
+ {
+ if (strncmp(penv, "0", 1)
+ && strncasecmp(penv, "false", 5))
+ _is_debug = 1;
+ else
+ _is_debug = 0;
+ }
+#ifndef XEN_VMBUILDER_DEBUG
+ else
+ {
+ _is_debug = 0;
+ }
+#endif
+}
+
+/******************************************************************************/
+void
+vmbuilder_debug_out(const char* fmt, ...)
+{
+ if (_is_debug)
+ {
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(stdout, fmt, ap);
+ va_end(ap);
+ }
+}
+
+/******************************************************************************/
CMPIArray*
str2UInt16Array(const CMPIBroker* broker, const char* str)
{
Modified: contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.h
===================================================================
--- contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.h 2008-10-17 08:36:30 UTC (rev 1112)
+++ contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmbuilder-util.h 2008-10-19 20:57:27 UTC (rev 1113)
@@ -24,12 +24,9 @@
void set_dt_prop(const CMPIBroker* broker, VMBDBCtx dbctx, int col_ndx,
CMPIInstance* instance, const char* prop_name, CMPIBoolean isInterval);
char** get_job_names();
+void set_debug_for_env();
+void vmbuilder_debug_out(const char* fmt, ...);
-/* If built for debug, enable tracing */
-#ifdef XEN_VMBUILDER_DEBUG
-#define DEBUGOUT(fmt, args...) printf(fmt,## args)
-#else
-#define DEBUGOUT(fmt, args...)
-#endif
+#define DEBUGOUT(fmt, args...) vmbuilder_debug_out(fmt,## args)
#endif /* VMBUILDER_UTIL_H_GUARD */
Modified: contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmcreation-data.c
===================================================================
--- contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmcreation-data.c 2008-10-17 08:36:30 UTC (rev 1112)
+++ contrib/xen-vm-builder/trunk/src/providers/vm-builder/vmcreation-data.c 2008-10-19 20:57:27 UTC (rev 1113)
@@ -1335,6 +1335,7 @@
Init(
CMPIInstanceMI* self)
{
+ set_debug_for_env();
DEBUGOUT("Initialize() called\n");
/* Delete jobs xref recs for jobs that no longer exist */
@@ -1371,6 +1372,7 @@
MethodInit(
CMPIMethodMI * self)
{
+ set_debug_for_env();
DEBUGOUT("MethodInitialize() called\n");
// do work here if necessary
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kk...@us...> - 2008-10-17 09:26:17
|
Revision: 1110
http://omc.svn.sourceforge.net/omc/?rev=1110&view=rev
Author: kkaempf
Date: 2008-10-17 08:32:52 +0000 (Fri, 17 Oct 2008)
Log Message:
-----------
move thread locking outside of call_provider, so we have just a single
lock/unlock for each MI call
Modified Paths:
--------------
cmpi-bindings/trunk/src/cmpi_provider.c
cmpi-bindings/trunk/src/target_python.c
Modified: cmpi-bindings/trunk/src/cmpi_provider.c
===================================================================
--- cmpi-bindings/trunk/src/cmpi_provider.c 2008-10-16 17:24:00 UTC (rev 1109)
+++ cmpi-bindings/trunk/src/cmpi_provider.c 2008-10-17 08:32:52 UTC (rev 1110)
@@ -329,15 +329,14 @@
_context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0);
_result = SWIG_NewPointerObj((void*) result, SWIGTYPE_p__CMPIResult, 0);
_reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "enum_instance_names", 3,
_context,
_result,
_reference);
-
- _SBLIM_TRACE(1,("EnumInstanceNames() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("EnumInstanceNames() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -372,15 +371,14 @@
_reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0);
_properties = proplist2target(properties);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "enum_instances", 4,
_context,
_result,
_reference,
_properties);
-
- _SBLIM_TRACE(1,("EnumInstances() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("EnumInstances() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -414,15 +412,14 @@
_reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0);
_properties = proplist2target(properties);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "get_instance", 4,
_context,
_result,
_reference,
_properties);
-
- _SBLIM_TRACE(1,("GetInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("GetInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -444,7 +441,7 @@
Target_Type _reference;
Target_Type _newinst;
- CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; /* Return status of CIM operations. */
+ CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; /* Return status of CIM operations. */
/* Creating new instances is not supported for this class. */
@@ -458,16 +455,15 @@
_result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0);
_reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0);
_newinst = SWIG_NewPointerObj((void*) newinstance, SWIGTYPE_p__CMPIInstance, 0);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "create_instance", 4,
_context,
_result,
_reference,
_newinst);
-
- _SBLIM_TRACE(1,("CreateInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("CreateInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -509,16 +505,15 @@
_newinst = SWIG_NewPointerObj((void*) newinstance, SWIGTYPE_p__CMPIInstance, 0);
plist = proplist2target(properties);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "set_instance", 5,
_context,
_result,
_reference,
_newinst,
plist);
-
- _SBLIM_TRACE(1,("SetInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("SetInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -547,15 +542,14 @@
_context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0);
_result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0);
_reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "delete_instance", 3,
_context,
_result,
_reference);
-
- _SBLIM_TRACE(1,("DeleteInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("DeleteInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -590,7 +584,6 @@
_reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0);
_query = string2target(query);
_lang = string2target(language);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "exec_query", 5,
_context,
@@ -598,11 +591,12 @@
_reference,
_query,
_lang);
+ TARGET_THREAD_END_BLOCK;
- /* Query filtering is not supported for this class. */
+ /* Query filtering is not supported for this class. */
- _SBLIM_TRACE(1,("ExecQuery() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ _SBLIM_TRACE(1,("ExecQuery() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -663,7 +657,6 @@
{
_resultRole = string2target(resultRole);
}
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "associator_names", 7,
_ctx,
@@ -673,10 +666,9 @@
_resultClass,
_role,
_resultRole);
-
-
- _SBLIM_TRACE(1,("associatorNames() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("associatorNames() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
/*
@@ -735,7 +727,6 @@
{
_resultRole = string2target(resultRole);
}
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "associators", 8,
_ctx,
@@ -745,11 +736,11 @@
_resultClass,
_role,
_resultRole,
- _props);
+ _props);
-
- _SBLIM_TRACE(1,("associators() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("associators() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
/*
@@ -791,7 +782,6 @@
{
_resultClass = string2target(resultClass);
}
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "reference_names", 5,
_ctx,
@@ -800,9 +790,9 @@
_resultClass,
_role);
-
- _SBLIM_TRACE(1,("referenceNames() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("referenceNames() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -848,7 +838,6 @@
_resultClass = string2target(resultClass);
}
_props = proplist2target(properties);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "references", 6,
_ctx,
@@ -857,9 +846,9 @@
_resultClass,
_role,
_props);
-
- _SBLIM_TRACE(1,("references() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("references() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
/*
@@ -896,17 +885,16 @@
_out = SWIG_NewPointerObj((void*) out, SWIGTYPE_p__CMPIArgs, 0);
_method = string2target(method);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "invoke_method", 6,
_ctx,
_rslt,
_objName,
_method,
_in,
- _out);
-
- _SBLIM_TRACE(1,("invokeMethod() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ _out);
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("invokeMethod() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -941,16 +929,15 @@
_className = string2target(className);
_owner = string2target(owner);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "authorize_filter", 5,
_ctx,
_filter,
_className,
_classPath,
_owner);
-
- _SBLIM_TRACE(1,("authorizeFilter() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("authorizeFilter() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -984,16 +971,15 @@
_firstActivation = Target_Bool(firstActivation);
_className = string2target(className);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "activate_filter", 5,
_ctx,
_filter,
_className,
_classPath,
_firstActivation);
-
- _SBLIM_TRACE(1,("activateFilter() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("activateFilter() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -1027,16 +1013,15 @@
_lastActivation = Target_Bool(lastActivation);
_className = string2target(className);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "deactivate_filter", 5,
_ctx,
_filter,
_className,
_classPath,
_lastActivation);
-
- _SBLIM_TRACE(1,("deActivateFilter() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("deActivateFilter() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -1072,16 +1057,15 @@
_classPath = SWIG_NewPointerObj((void*) classPath, SWIGTYPE_p__CMPIObjectPath, 0);
_className = string2target(className);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "must_poll", 4,
_ctx,
//_rslt,
_filter,
_className,
_classPath);
-
- _SBLIM_TRACE(1,("mustPoll() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("mustPoll() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -1103,13 +1087,12 @@
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "enable_indications", 1, _ctx);
- _SBLIM_TRACE(1,("enableIndications() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
-
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("enableIndications() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
@@ -1131,12 +1114,12 @@
TARGET_THREAD_BEGIN_BLOCK;
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
- TARGET_THREAD_END_BLOCK;
call_provider((ProviderMIHandle*)self->hdl, &status, "disable_indications", 1, _ctx);
- _SBLIM_TRACE(1,("disableIndications() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
- return status;
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("disableIndications() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed"));
+ return status;
}
Modified: cmpi-bindings/trunk/src/target_python.c
===================================================================
--- cmpi-bindings/trunk/src/target_python.c 2008-10-16 17:24:00 UTC (rev 1109)
+++ cmpi-bindings/trunk/src/target_python.c 2008-10-17 08:32:52 UTC (rev 1110)
@@ -174,6 +174,7 @@
/*
* call_provider
*
+ * ** must be called while holding the threads lock **
*/
static int
@@ -185,7 +186,6 @@
PyObject *pyargs = NULL;
PyObject *pyfunc = NULL;
PyObject *prv = NULL;
- TARGET_THREAD_BEGIN_BLOCK;
pyargs = PyTuple_New(nargs);
pyfunc = PyObject_GetAttrString(hdl->instance, opname);
@@ -279,15 +279,17 @@
}
else
{
+ char *msg = PyString_AsString(prstr);
+ TARGET_THREAD_BEGIN_ALLOW;
st->msg = hdl->broker->eft->newString(hdl->broker,
- PyString_AsString(prstr), NULL);
+ msg, NULL);
+ TARGET_THREAD_END_ALLOW;
}
rc = pi != 0;
cleanup:
Py_DecRef(pyargs);
Py_DecRef(pyfunc);
Py_DecRef(prv);
- TARGET_THREAD_END_BLOCK;
return rc;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kk...@us...> - 2008-10-17 08:37:31
|
Revision: 1112
http://omc.svn.sourceforge.net/omc/?rev=1112&view=rev
Author: kkaempf
Date: 2008-10-17 08:36:30 +0000 (Fri, 17 Oct 2008)
Log Message:
-----------
install UpcallAtomProvider.py
Modified Paths:
--------------
cmpi-bindings/trunk/test/python/install.sh
Modified: cmpi-bindings/trunk/test/python/install.sh
===================================================================
--- cmpi-bindings/trunk/test/python/install.sh 2008-10-17 08:36:05 UTC (rev 1111)
+++ cmpi-bindings/trunk/test/python/install.sh 2008-10-17 08:36:30 UTC (rev 1112)
@@ -42,6 +42,7 @@
__install TestMethod.py /usr/lib/pycim
__install TestAssocProvider.py /usr/lib/pycim
__install TestAtomProvider.py /usr/lib/pycim
+__install UpcallAtomProvider.py /usr/lib/pycim
if [ "$1" = "op" ]; then
cimmof TestMethodPegasus.mof
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kk...@us...> - 2008-10-17 08:37:05
|
Revision: 1111
http://omc.svn.sourceforge.net/omc/?rev=1111&view=rev
Author: kkaempf
Date: 2008-10-17 08:36:05 +0000 (Fri, 17 Oct 2008)
Log Message:
-----------
reduce trace output
Modified Paths:
--------------
cmpi-bindings/trunk/src/target_python.c
Modified: cmpi-bindings/trunk/src/target_python.c
===================================================================
--- cmpi-bindings/trunk/src/target_python.c 2008-10-17 08:32:52 UTC (rev 1110)
+++ cmpi-bindings/trunk/src/target_python.c 2008-10-17 08:36:05 UTC (rev 1111)
@@ -125,11 +125,11 @@
static int
PyGlobalInitialize(const CMPIBroker* broker, CMPIStatus* st)
{
- _SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() called", getpid(), pthread_self()));
+/* _SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() called", getpid(), pthread_self())); */
if (_TARGET_INIT)
{
- _SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() returning: already initialized", getpid(), pthread_self()));
+/* _SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() returning: already initialized", getpid(), pthread_self())); */
return 0;
}
_TARGET_INIT=1;//true
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mik...@us...> - 2008-10-16 17:24:13
|
Revision: 1109
http://omc.svn.sourceforge.net/omc/?rev=1109&view=rev
Author: mike-brasher
Date: 2008-10-16 17:24:00 +0000 (Thu, 16 Oct 2008)
Log Message:
-----------
Implemented scheme to work around CIMSetPropertyFilter() bug in pegasus
by always injecting key names into property list (obtained from object path)
prior to calling CIMSetPropertyFilter().
Modified Paths:
--------------
cmpi-bindings/trunk/swig/cmpi.i
cmpi-bindings/trunk/swig/cmpi_callbacks.i
cmpi-bindings/trunk/swig/cmpi_types.i
cmpi-bindings/trunk/test/python/test_assoc.py
Added Paths:
-----------
cmpi-bindings/trunk/swig/string_array.h
Modified: cmpi-bindings/trunk/swig/cmpi.i
===================================================================
--- cmpi-bindings/trunk/swig/cmpi.i 2008-10-16 16:00:23 UTC (rev 1108)
+++ cmpi-bindings/trunk/swig/cmpi.i 2008-10-16 17:24:00 UTC (rev 1109)
@@ -357,6 +357,16 @@
} \
while (0)
+/*
+**==============================================================================
+**
+** String array implementation functions.
+**
+**==============================================================================
+*/
+
+#include "string_array.h"
+
%}
%exceptionclass CMPIException;
Modified: cmpi-bindings/trunk/swig/cmpi_callbacks.i
===================================================================
--- cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-10-16 16:00:23 UTC (rev 1108)
+++ cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-10-16 17:24:00 UTC (rev 1109)
@@ -263,12 +263,9 @@
CMSetStatusWithChars($self, &st, CMPI_RC_ERR_FAILED,
"object path has no namespace");
_raise_ex(&st);
-printf("EXCEPTION..................................................\n");
return NULL;
}
-printf("NAMESPACE[%s]\n", str);
-
result = CMNewInstance($self, path, &st);
RAISE_IF(st);
Modified: cmpi-bindings/trunk/swig/cmpi_types.i
===================================================================
--- cmpi-bindings/trunk/swig/cmpi_types.i 2008-10-16 16:00:23 UTC (rev 1108)
+++ cmpi-bindings/trunk/swig/cmpi_types.i 2008-10-16 17:24:00 UTC (rev 1109)
@@ -869,7 +869,77 @@
*/
void set_property_filter(const char **properties)
{
- RAISE_IF(CMSetPropertyFilter($self, properties, NULL));
+ CMPIStatus st = { CMPI_RC_OK, NULL };
+ CMPIObjectPath* cop;
+ CMPICount n;
+ CMPICount i;
+ CMPIData cd;
+ char** props;
+
+ /* Make copy of property list (we may modify it) */
+
+ props = string_array_clone((char**)properties);
+
+#if 0
+ string_array_print(props);
+#endif
+
+ /* Pegasus requires that the keys be in the property list, else it
+ * throws an exception. To work around, add key properties to property
+ * list.
+ */
+
+ if (!(cop = CMGetObjectPath($self, &st)) || st.rc)
+ {
+ st.rc = CMPI_RC_ERR_FAILED;
+ RAISE_IF(st);
+ string_array_free(props);
+ return;
+ }
+
+ n = CMGetKeyCount(cop, &st);
+
+ if (st.rc)
+ {
+ RAISE_IF(st);
+ string_array_free(props);
+ return;
+ }
+
+ for (i = 0; i < n; i++)
+ {
+ CMPIString* pn = NULL;
+ char* str;
+
+ cd = CMGetKeyAt(cop, i, &pn, &st);
+
+ if (st.rc)
+ {
+ RAISE_IF(st);
+ string_array_free(props);
+ return;
+ }
+
+ str = CMGetCharsPtr(pn, &st);
+
+ if (st.rc)
+ {
+ RAISE_IF(st);
+ string_array_free(props);
+ return;
+ }
+
+ if (string_array_find_ignore_case(props, str) == NULL)
+ props = string_array_append(props, str);
+ }
+
+#if 0
+ string_array_print(props);
+#endif
+
+ RAISE_IF(CMSetPropertyFilter($self, (const char**)props, NULL));
+
+ string_array_free(props);
}
/* Add/replace a named Property value and origin
Added: cmpi-bindings/trunk/swig/string_array.h
===================================================================
--- cmpi-bindings/trunk/swig/string_array.h (rev 0)
+++ cmpi-bindings/trunk/swig/string_array.h 2008-10-16 17:24:00 UTC (rev 1109)
@@ -0,0 +1,121 @@
+/*
+ * This file defines functions for manipulating null-terminated arrays of
+ * pointers to strings (string arrays).
+ */
+#ifndef string_array_h
+#define string_array_h
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static size_t string_array_size(char** array)
+{
+ char** p;
+
+ if (!array)
+ return 0;
+
+ for (p = array; *p; p++)
+ ;
+
+ return p - array;
+}
+
+static char** string_array_clone(char** array)
+{
+ char** p;
+ size_t n;
+ size_t i;
+
+ if (!array)
+ {
+ p = (char**)malloc(sizeof(char*));
+ *p = NULL;
+ return p;
+ }
+
+ n = string_array_size(array);
+
+ if (!(p = (char**)malloc((n + 1) * sizeof(char*))))
+ return NULL;
+
+ for (i = 0; i < n; i++)
+ p[i] = strdup(array[i]);
+
+ p[i] = NULL;
+
+ return p;
+}
+
+static char** string_array_append(char** array, const char* str)
+{
+ size_t n;
+
+ n = string_array_size(array);
+
+ if (!(array = (char**)realloc(array, (n + 2) * sizeof(char*))))
+ return NULL;
+
+ array[n] = strdup(str);
+ array[n+1] = NULL;
+
+ return array;
+}
+
+static void string_array_free(char** array)
+{
+ char** p;
+
+ if (!array)
+ return;
+
+ for (p = array; *p; p++)
+ free(*p);
+
+ free(array);
+}
+
+static const char* string_array_find(char** array, const char* str)
+{
+ char** p;
+
+ for (p = array; *p; p++)
+ {
+ if (strcmp(*p, str) == 0)
+ return *p;
+ }
+
+ /* Not found! */
+ return NULL;
+}
+
+static const char* string_array_find_ignore_case(char** array, const char* str)
+{
+ char** p;
+
+ for (p = array; *p; p++)
+ {
+ if (strcasecmp(*p, str) == 0)
+ return *p;
+ }
+
+ /* Not found! */
+ return NULL;
+}
+
+static void string_array_print(char** array)
+{
+ char** p;
+
+ printf("string_array\n");
+ printf("{\n");
+
+ for (p = array; *p; p++)
+ {
+ printf(" {%s}\n", *p);
+ }
+
+ printf("}\n");
+}
+
+#endif /* string_array_h */
Modified: cmpi-bindings/trunk/test/python/test_assoc.py
===================================================================
--- cmpi-bindings/trunk/test/python/test_assoc.py 2008-10-16 16:00:23 UTC (rev 1108)
+++ cmpi-bindings/trunk/test/python/test_assoc.py 2008-10-16 17:24:00 UTC (rev 1109)
@@ -1007,10 +1007,11 @@
self.fail('KeyError caught trying to read "Dependent" property that should exist.')
isValid=False
try:
- if ref['Antecedent'] is not None and len(ref['Antecedent']) > 0:
- self.fail('Reference antecedent is set when it should not be (%s).' % ref['Antecedent'])
- if ref['isPrimaryGroup'] is not None:
- self.fail('Reference property "isPrimaryGroup" is set when it should not be (%s).' % ref['isPrimaryGroup'])
+ # ATTN: This fails since we always include keys.
+ #if ref['Antecedent'] is not None and len(ref['Antecedent']) > 0:
+ # self.fail('Reference antecedent is set when it should not be (%s).' % ref['Antecedent'])
+ #if ref['isPrimaryGroup'] is not None:
+ # self.fail('Reference property "isPrimaryGroup" is set when it should not be (%s).' % ref['isPrimaryGroup'])
isValid=True
except KeyError:
# not an error
@@ -1043,8 +1044,9 @@
self.fail('KeyError caught trying to read properties that should exist.')
isValid=False
try:
- if ref['Dependent'] is not None and len(ref['Dependent']) > 0:
- self.fail('Reference dependent is set when it should not be (%s).' % ref['Dependent'])
+ # This fails since we always include the keys.
+ #if ref['Dependent'] is not None and len(ref['Dependent']) > 0:
+ # self.fail('Reference dependent is set when it should not be (%s).' % ref['Dependent'])
isValid=True
except KeyError:
# not an error
@@ -1063,8 +1065,8 @@
self.fail('KeyError caught trying to read antecedent property that should exist.')
isValid=False
try:
- if ref['Dependent'] is not None and len(ref['Dependent']) > 0:
- self.fail('Reference dependent is set when it should not be (%s).' % ref['Dependent'])
+ #if ref['Dependent'] is not None and len(ref['Dependent']) > 0:
+ # self.fail('Reference dependent is set when it should not be (%s).' % ref['Dependent'])
isValid=True
except KeyError:
# not an error
@@ -1093,8 +1095,8 @@
self.fail('KeyError caught trying to read properties that should exist.')
isValid=False
try:
- if ref['Antecedent'] is not None and len(ref['Antecedent']) > 0:
- self.fail('Reference antecedent is set when it should not be (%s).' % ref['Antecedent'])
+ #if ref['Antecedent'] is not None and len(ref['Antecedent']) > 0:
+ # self.fail('Reference antecedent is set when it should not be (%s).' % ref['Antecedent'])
isValid=True
except KeyError:
# not an error
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2008-10-16 16:00:30
|
Revision: 1108
http://omc.svn.sourceforge.net/omc/?rev=1108&view=rev
Author: bartw
Date: 2008-10-16 16:00:23 +0000 (Thu, 16 Oct 2008)
Log Message:
-----------
indications test now working on Pegasus
Modified Paths:
--------------
cmpi-bindings/trunk/test/python/TestIndications.py
cmpi-bindings/trunk/test/python/UpcallAtomProvider.py
Modified: cmpi-bindings/trunk/test/python/TestIndications.py
===================================================================
--- cmpi-bindings/trunk/test/python/TestIndications.py 2008-10-16 15:06:51 UTC (rev 1107)
+++ cmpi-bindings/trunk/test/python/TestIndications.py 2008-10-16 16:00:23 UTC (rev 1108)
@@ -18,6 +18,7 @@
import time
from lib import wbem_connection
+_interop_ns = None
_port = 5309
_num_to_send = pywbem.Uint16(42)
@@ -51,7 +52,7 @@
return ''
def createFilter( ch, query='select * from CIM_ProcessIndication',
- ns='root/interop',
+ ns=_interop_ns,
querylang='WQL',
src_ns='root/cimv2',
in_name=None):
@@ -75,7 +76,7 @@
return filtercop
def createDest( ch, destination='http://localhost:%s' % _port,
- ns='root/interop',
+ ns=_interop_ns,
in_name=None):
name = in_name or 'cimlistener%s'%time.time()
destinst=pywbem.CIMInstance('CIM_ListenerDestinationCIMXML')
@@ -94,11 +95,11 @@
destcop = ch.CreateInstance(destinst)
return destcop
-def createSubscription(ch, ns='root/interop'):
+def createSubscription(ch, ns=_interop_ns):
replace_ns = ch.default_namespace
ch.default_namespace=ns
- indfilter=createFilter(ch)
- indhandler=createDest(ch)
+ indfilter=createFilter(ch, ns=ns)
+ indhandler=createDest(ch, ns=ns)
subinst=pywbem.CIMInstance('CIM_IndicationSubscription')
subinst['Filter']=indfilter
subinst['Handler']=indhandler
@@ -141,6 +142,22 @@
default=2)
_g_opts, _g_args = parser.parse_args()
conn = wbem_connection.WBEMConnFromOptions(parser)
+
+ nss = ['root/interop', 'root/cimv2']
+ for ns in nss:
+ try:
+ conn.GetClass('CIM_IndicationSubscription', namespace=ns)
+ _interop_ns = ns
+ break
+ except pywbem.CIMError, arg:
+ if arg[0] in [pywbem.CIM_ERR_INVALID_CLASS,
+ pywbem.CIM_ERR_INVALID_NAMESPACE]:
+ continue
+ raise
+ else:
+ print 'Unable to find class CIM_IndicationSubscription in namespaces',\
+ nss
+ sys.exit(1)
def cb(inst):
global _lock
@@ -157,30 +174,35 @@
cl = CIMListener(callback=cb, http_port=5309)
def threadfunc():
- time.sleep(1)
- numrcv = 0
- subcop = createSubscription(conn)
- time.sleep(1)
- conn.InvokeMethod('reset_indication_count', 'Test_UpcallAtom')
- print 'Waiting for %s indications...' % _num_to_send
- countsent,outs = conn.InvokeMethod('send_indications',
- 'Test_UpcallAtom', num_to_send=_num_to_send)
- numsent,outs = conn.InvokeMethod('get_indication_send_count',
- 'Test_UpcallAtom')
- deleteSubscription(conn, subcop)
- if (countsent != numsent):
- print("\nsend_indications NumSent(%d) doesn't match get_indication_send_count NumSent(%d)\n"%(countsent, numsent));
- sys.exit(1)
- for i in xrange(20):
- _lock.acquire()
- if _shutdown:
+ try:
+ time.sleep(1)
+ numrcv = 0
+ subcop = createSubscription(conn, ns=_interop_ns)
+ time.sleep(1)
+ conn.InvokeMethod('reset_indication_count', 'Test_UpcallAtom')
+ print 'Waiting for %s indications...' % _num_to_send
+ countsent,outs = conn.InvokeMethod('send_indications',
+ 'Test_UpcallAtom', num_to_send=_num_to_send)
+ numsent,outs = conn.InvokeMethod('get_indication_send_count',
+ 'Test_UpcallAtom')
+ deleteSubscription(conn, subcop)
+ if (countsent != numsent):
+ print("\nsend_indications NumSent(%d) doesn't match get_indication_send_count NumSent(%d)\n"%(countsent, numsent));
+ sys.exit(1)
+ for i in xrange(20):
+ _lock.acquire()
+ if _shutdown:
+ reactor.stop()
+ _lock.release()
+ if not reactor.running:
+ break
+ time.sleep(.5)
+ if reactor.running:
reactor.stop()
- _lock.release()
- if not reactor.running:
- break
- time.sleep(.5)
- if reactor.running:
- reactor.stop()
+ except:
+ if reactor.running:
+ reactor.stop()
+ raise
thread = threading.Thread(target=threadfunc)
thread.start()
@@ -188,7 +210,8 @@
print ''
if _num_to_send != _insts_received:
print 'Expected %s exceptions, got %s' % (_num_to_send, _insts_received)
+ print 'Indication Tests failed!'
sys.exit(1)
else:
- print 'Tests passed'
+ print 'Indication Tests passed.'
Modified: cmpi-bindings/trunk/test/python/UpcallAtomProvider.py
===================================================================
--- cmpi-bindings/trunk/test/python/UpcallAtomProvider.py 2008-10-16 15:06:51 UTC (rev 1107)
+++ cmpi-bindings/trunk/test/python/UpcallAtomProvider.py 2008-10-16 16:00:23 UTC (rev 1108)
@@ -805,7 +805,9 @@
try:
- alert_ind = pywbem.CIMInstance("UpcallAtom_Indication")
+ alert_ind = pywbem.CIMInstance("UpcallAtom_Indication",
+ path=pywbem.CIMInstanceName('UpcallAtom_Indication',
+ namespace=object_name.namespace))
alert_ind['AlertType'] = pywbem.Uint16(2)
alert_ind['PerceivedSeverity'] = pywbem.Uint16(1)
alert_ind['ProbableCause'] = pywbem.Uint16(1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kk...@us...> - 2008-10-16 15:06:57
|
Revision: 1107
http://omc.svn.sourceforge.net/omc/?rev=1107&view=rev
Author: kkaempf
Date: 2008-10-16 15:06:51 +0000 (Thu, 16 Oct 2008)
Log Message:
-----------
sync with package
Modified Paths:
--------------
cmpi-bindings/trunk/package/cmpi-bindings.changes
Modified: cmpi-bindings/trunk/package/cmpi-bindings.changes
===================================================================
--- cmpi-bindings/trunk/package/cmpi-bindings.changes 2008-10-16 12:51:50 UTC (rev 1106)
+++ cmpi-bindings/trunk/package/cmpi-bindings.changes 2008-10-16 15:06:51 UTC (rev 1107)
@@ -13,6 +13,12 @@
specific lines (25%) to target_{python,ruby}.c
-------------------------------------------------------------------
+Sat Sep 27 11:09:00 MDT 2008 - bwh...@su...
+
+- Update to latest code.
+- Better error handling.
+
+-------------------------------------------------------------------
Fri Sep 19 13:57:43 CEST 2008 - kk...@su...
- rename .py filename to reflect 'pywbem' dependency.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kk...@us...> - 2008-10-16 12:52:00
|
Revision: 1106
http://omc.svn.sourceforge.net/omc/?rev=1106&view=rev
Author: kkaempf
Date: 2008-10-16 12:51:50 +0000 (Thu, 16 Oct 2008)
Log Message:
-----------
fix packaging
- don't install Python compilations as they contain buildroot traces
instead, compile in %post after install, remove in %preun
- give Python and Perl packages proper dependencies
Modified Paths:
--------------
cmpi-bindings/trunk/package/cmpi-bindings.spec.in
Modified: cmpi-bindings/trunk/package/cmpi-bindings.spec.in
===================================================================
--- cmpi-bindings/trunk/package/cmpi-bindings.spec.in 2008-10-16 12:29:58 UTC (rev 1105)
+++ cmpi-bindings/trunk/package/cmpi-bindings.spec.in 2008-10-16 12:51:50 UTC (rev 1106)
@@ -25,7 +25,7 @@
Group: Development/Libraries/Other
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# We need swig threads support.
-BuildRequires: cmake gcc-c++ python-devel ruby-devel swig >= 1.3.34
+BuildRequires: cmake gcc-c++ python-devel ruby-devel swig >= 1.3.34 perl
BuildRequires: sblim-sfcb
Source: %{name}-%{version}.tar.bz2
Prefix: /usr
@@ -52,6 +52,7 @@
%install
cd build
make install DESTDIR=$RPM_BUILD_ROOT
+%{__rm} -f $RPM_BUILD_ROOT%{py_sitedir}/cmpi_pywbem_bindings.pyc $RPM_BUILD_ROOT%{py_sitedir}/cmpi.pyc
%clean
%{__rm} -rf %{buildroot}
@@ -69,9 +70,9 @@
%defattr(-,root,root,-)
%{_libdir}/cmpi/librbCmpiProvider.so
%if 0%{?sles_version} == 10
-%{_libdir}/ruby/site_ruby/%{rb_ver}/rcmpi_instance.rb
+%{_libdir}/ruby/site_ruby/%{rb_ver}/cmpi_rbwbem_bindings.rb
%else
-%{_libdir}/ruby/vendor_ruby/%{rb_ver}/rcmpi_instance.rb
+%{_libdir}/ruby/vendor_ruby/%{rb_ver}/cmpi_rbwbem_bindings.rb
%endif
%package -n cmpi-bindings-pywbem
@@ -79,14 +80,37 @@
Group: Development/Languages/Python
# for the debug package. we dont use debug_package_requires here as it would enforce to install both packages.
Provides: %{name} = %{version}-%{release}
+%{py_requires}
%description -n cmpi-bindings-pywbem
-
+%post -n cmpi-bindings-pywbem
+python%{py_ver} -m py_compile %{py_sitedir}/cmpi_pywbem_bindings.py %{py_sitedir}/cmpi.py
+
+%preun -n cmpi-bindings-pywbem
+%{__rm} -f %{py_sitedir}/cmpi_pywbem_bindings.pyc %{py_sitedir}/cmpi.pyc
+
%files -n cmpi-bindings-pywbem
%defattr(-,root,root,-)
%{_libdir}/cmpi/libpyCmpiProvider.so
%{py_sitedir}/cmpi_pywbem_bindings.py
%{py_sitedir}/cmpi.py
+%package -n cmpi-bindings-perl
+Requires: perl = %{perl_version}
+Summary: Adapter to write and run CMPI-type CIM providers in Perl
+Group: Development/Languages/Perl
+# for the debug package. we dont use debug_package_requires here as it would enforce to install both packages.
+Provides: %{name} = %{version}-%{release}
+
+%description -n cmpi-bindings-perl
+-
+
+%files -n cmpi-bindings-perl
+%defattr(-,root,root,-)
+%{_libdir}/cmpi/libplCmpiProvider.so
+%{perl_vendorlib}/cmpi_plwbem_bindings.pl
+%{perl_vendorlib}/cmpi.pm
+
%changelog
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kk...@us...> - 2008-10-16 12:30:43
|
Revision: 1105
http://omc.svn.sourceforge.net/omc/?rev=1105&view=rev
Author: kkaempf
Date: 2008-10-16 12:29:58 +0000 (Thu, 16 Oct 2008)
Log Message:
-----------
remove shebang, its being loaded
Modified Paths:
--------------
cmpi-bindings/trunk/swig/perl/cmpi_plwbem_bindings.pl
Modified: cmpi-bindings/trunk/swig/perl/cmpi_plwbem_bindings.pl
===================================================================
--- cmpi-bindings/trunk/swig/perl/cmpi_plwbem_bindings.pl 2008-10-16 12:06:23 UTC (rev 1104)
+++ cmpi-bindings/trunk/swig/perl/cmpi_plwbem_bindings.pl 2008-10-16 12:29:58 UTC (rev 1105)
@@ -1,4 +1,3 @@
-#!/usr/bin/perl
#
# cmpi_plwbem_bindings.pl
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kk...@us...> - 2008-10-16 12:06:25
|
Revision: 1104
http://omc.svn.sourceforge.net/omc/?rev=1104&view=rev
Author: kkaempf
Date: 2008-10-16 12:06:23 +0000 (Thu, 16 Oct 2008)
Log Message:
-----------
prep for package submission, bump version to 0.3.0
Modified Paths:
--------------
cmpi-bindings/trunk/VERSION.cmake
cmpi-bindings/trunk/package/cmpi-bindings.changes
Modified: cmpi-bindings/trunk/VERSION.cmake
===================================================================
--- cmpi-bindings/trunk/VERSION.cmake 2008-10-16 12:01:07 UTC (rev 1103)
+++ cmpi-bindings/trunk/VERSION.cmake 2008-10-16 12:06:23 UTC (rev 1104)
@@ -1,3 +1,3 @@
SET(VERSION_MAJOR "0")
-SET(VERSION_MINOR "2")
+SET(VERSION_MINOR "3")
SET(VERSION_PATCH "0")
Modified: cmpi-bindings/trunk/package/cmpi-bindings.changes
===================================================================
--- cmpi-bindings/trunk/package/cmpi-bindings.changes 2008-10-16 12:01:07 UTC (rev 1103)
+++ cmpi-bindings/trunk/package/cmpi-bindings.changes 2008-10-16 12:06:23 UTC (rev 1104)
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Oct 16 14:04:32 CEST 2008 - kk...@su...
+
+- Complete Ruby bindings.
+- Small runtime improvement for Python.
+- Bump version to 0.3.0
+
+-------------------------------------------------------------------
Mon Sep 29 22:52:31 CEST 2008 - kk...@su...
- refactor cmpi_provider_{python,ruby}.c,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|