summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkonrad.r <konrad.r>2005-07-29 18:54:01 +0000
committerkonrad.r <konrad.r>2005-07-29 18:54:01 +0000
commitcdfad9ab461acd7d375be56fce73700d4fefe25a (patch)
tree85988fb2b5eb7d1072733ca925f58c36ef6230e0 /src
parent85f7031aba00cbfe7cb14cac48c50a2ab93e1f69 (diff)
downloadtog-pegasus-cdfad9ab461acd7d375be56fce73700d4fefe25a.zip
tog-pegasus-cdfad9ab461acd7d375be56fce73700d4fefe25a.tar.gz
tog-pegasus-cdfad9ab461acd7d375be56fce73700d4fefe25a.tar.xz
BUG#: 3975
TITLE: cimserver provides truncated reply with utf-8 chars on failing invokeMethod request DESCRIPTION:
Diffstat (limited to 'src')
-rw-r--r--src/Pegasus/Common/HTTPConnection.cpp2
-rw-r--r--src/Providers/TestProviders/CMPI/TestFail_4/Makefile51
-rw-r--r--src/Providers/TestProviders/CMPI/TestFail_4/cmpiTestFail_4Provider.c142
-rw-r--r--src/Providers/TestProviders/CMPI/TestFail_4/tests/EnumerateInstance_Fail_4.xml16
-rw-r--r--src/Providers/TestProviders/CMPI/TestFail_4/tests/EnumerateInstance_Fail_4rspgood.xml10
-rw-r--r--src/Providers/TestProviders/CMPI/TestFail_4/tests/Makefile36
-rw-r--r--src/Providers/TestProviders/Load/Makefile1
-rw-r--r--src/Providers/TestProviders/Load/TestCMPI_ProviderRegistration.mof36
-rw-r--r--src/Providers/TestProviders/Load/TestCMPI_ProviderSchema.mof4
-rw-r--r--src/Providers/TestProviders/Makefile5
10 files changed, 301 insertions, 2 deletions
diff --git a/src/Pegasus/Common/HTTPConnection.cpp b/src/Pegasus/Common/HTTPConnection.cpp
index 492bd3a..fe6618b 100644
--- a/src/Pegasus/Common/HTTPConnection.cpp
+++ b/src/Pegasus/Common/HTTPConnection.cpp
@@ -464,7 +464,7 @@ Boolean HTTPConnection::_handleWriteEvent(Message &message)
String messageS = cimException.getMessage();
CString messageC = messageS.getCString();
messageStart = (char *) (const char *) messageC;
- messageLength = messageS.size();
+ messageLength = strlen(messageStart);
buffer.reserveCapacity(messageLength+1);
buffer.append(messageStart, messageLength);
// null terminate
diff --git a/src/Providers/TestProviders/CMPI/TestFail_4/Makefile b/src/Providers/TestProviders/CMPI/TestFail_4/Makefile
new file mode 100644
index 0000000..53a9843
--- /dev/null
+++ b/src/Providers/TestProviders/CMPI/TestFail_4/Makefile
@@ -0,0 +1,51 @@
+#//%2005////////////////////////////////////////////////////////////////////////
+#//
+#// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+#// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+#// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+#// IBM Corp.; EMC Corporation, The Open Group.
+#// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+#// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+#// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+#// EMC Corporation; VERITAS Software Corporation; The Open Group.
+#//
+#// Permission is hereby granted, free of charge, to any person obtaining a copy
+#// of this software and associated documentation files (the "Software"), to
+#// deal in the Software without restriction, including without limitation the
+#// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+#// sell copies of the Software, and to permit persons to whom the Software is
+#// furnished to do so, subject to the following conditions:
+#//
+#// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+#// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+#// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+#// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+#// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+#// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+#// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+#// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#//
+#//==============================================================================
+ROOT = ../../../../..
+
+DIR = Providers/TestProviders/CMPI/TestFail_4
+
+LOCAL_DEFINES = -DPEGASUS_USE_EXPERIMENTAL
+
+include $(ROOT)/mak/config.mak
+
+ifeq ($(PEGASUS_PLATFORM),ZOS_ZSERIES_IBM)
+ CXX = cc
+ FLAGS += -W"c,SSCOMM"
+endif
+
+VMS_HAS_CC = yes
+
+LIBRARY = cmpiTestFail_4Provider
+
+SOURCES = \
+ cmpiTestFail_4Provider.c
+
+include $(ROOT)/mak/library.mak
+
+tests:
diff --git a/src/Providers/TestProviders/CMPI/TestFail_4/cmpiTestFail_4Provider.c b/src/Providers/TestProviders/CMPI/TestFail_4/cmpiTestFail_4Provider.c
new file mode 100644
index 0000000..e6d8d0d
--- /dev/null
+++ b/src/Providers/TestProviders/CMPI/TestFail_4/cmpiTestFail_4Provider.c
@@ -0,0 +1,142 @@
+//%2005////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//==============================================================================
+//
+// Author: Konrad Rzeszutek <konradr@us.ibm.com>
+//
+//
+//%/////////////////////////////////////////////////////////////////////////////
+
+
+#include <Pegasus/Provider/CMPI/cmpidt.h>
+#include <Pegasus/Provider/CMPI/cmpift.h>
+#include <Pegasus/Provider/CMPI/cmpimacs.h>
+#include <Pegasus/Provider/CMPI/cmpi_cql.h>
+
+/* ---------------------------------------------------------------------------*/
+/* Provider Factory */
+/* ---------------------------------------------------------------------------*/
+static const CMPIBroker *_broker;
+
+const char *_msg = "&quot;&lt;MSGS&gt;&lt;MSG COMP=&quot;CIMVM&quot; RC=&quot;400&quot; RS=&quot;65&quot;" \
+ " MSGID=&quot;DNZZMC465E&quot; COMM AND=&quot;Transaction: CimVm::CbCProvisioningService::createUser; Subtask:" \
+ " Process disk settings&quot;&gt;Fehler beim Erstellen eines virtuellen Computersystems "\
+ " (Aktion wurde rückgängig gemacht).&#13;&lt;/MSG&gt;&lt;MSG COMP=&quot;CIMVM&quot; "\
+ " RC=&quot;200&quot; RS=&quot;5&quot; MSGID=&quot;DNZZMC205E&quot; "\
+ " ROOTCAUSE=&quot;true&quot;&gt;&amp;quot;22500&amp;quot; ist keine gültige "\
+ " Einheitennummer.&#13;&lt;/MSG&gt;&lt;/MSGS&gt;&quot;";
+
+CMPIStatus
+TestCMPIFail_4ProviderCleanup (CMPIInstanceMI * mi, const CMPIContext * ctx,
+ CMPIBoolean term)
+{
+
+ CMReturn (CMPI_RC_OK);
+}
+
+CMPIStatus
+TestCMPIFail_4ProviderEnumInstanceNames (CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref)
+{
+ CMReturnWithChars(_broker, CMPI_RC_ERR_NOT_FOUND, _msg);
+}
+
+CMPIStatus
+TestCMPIFail_4ProviderEnumInstances (CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char **properties)
+{
+ CMReturnWithChars(_broker, CMPI_RC_ERR_NOT_FOUND, _msg);
+}
+
+CMPIStatus
+TestCMPIFail_4ProviderGetInstance (CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char **properties)
+{
+ CMReturnWithChars(_broker, CMPI_RC_ERR_NOT_FOUND, _msg);
+}
+
+CMPIStatus
+TestCMPIFail_4ProviderCreateInstance (CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci)
+{
+ CMReturnWithChars(_broker, CMPI_RC_ERR_NOT_FOUND, _msg);
+}
+
+CMPIStatus
+TestCMPIFail_4ProviderModifyInstance (CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci,
+ const char **properties)
+{
+ CMReturnWithChars(_broker, CMPI_RC_ERR_NOT_FOUND, _msg);
+}
+
+CMPIStatus
+TestCMPIFail_4ProviderDeleteInstance (CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop)
+{
+ CMReturnWithChars(_broker, CMPI_RC_ERR_NOT_FOUND, _msg);
+}
+
+CMPIStatus
+TestCMPIFail_4ProviderExecQuery (CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char *lang, const char *query)
+{
+ CMReturnWithChars(_broker, CMPI_RC_ERR_NOT_FOUND, _msg);
+}
+
+/* ---------------------------------------------------------------------------*/
+/* Provider Factory */
+/* ---------------------------------------------------------------------------*/
+
+CMInstanceMIStub (TestCMPIFail_4Provider,
+ TestCMPIFail_4Provider, _broker, CMNoHook);
+
+
+/* ---------------------------------------------------------------------------*/
+/* end of TestCMPIProvider */
+/* ---------------------------------------------------------------------------*/
+
diff --git a/src/Providers/TestProviders/CMPI/TestFail_4/tests/EnumerateInstance_Fail_4.xml b/src/Providers/TestProviders/CMPI/TestFail_4/tests/EnumerateInstance_Fail_4.xml
new file mode 100644
index 0000000..99f8873
--- /dev/null
+++ b/src/Providers/TestProviders/CMPI/TestFail_4/tests/EnumerateInstance_Fail_4.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<CIM CIMVERSION="2.0" DTDVERSION="2.0">
+<MESSAGE ID="1001" PROTOCOLVERSION="1.0">
+<SIMPLEREQ>
+<IMETHODCALL NAME="EnumerateInstances">
+<LOCALNAMESPACEPATH>
+<NAMESPACE NAME="test"/>
+<NAMESPACE NAME="TestProvider"/>
+</LOCALNAMESPACEPATH>
+<IPARAMVALUE NAME="ClassName">
+<CLASSNAME NAME="TestCMPI_Fail_4"/>
+</IPARAMVALUE>
+</IMETHODCALL>
+</SIMPLEREQ>
+</MESSAGE>
+</CIM>
diff --git a/src/Providers/TestProviders/CMPI/TestFail_4/tests/EnumerateInstance_Fail_4rspgood.xml b/src/Providers/TestProviders/CMPI/TestFail_4/tests/EnumerateInstance_Fail_4rspgood.xml
new file mode 100644
index 0000000..b34bb89
--- /dev/null
+++ b/src/Providers/TestProviders/CMPI/TestFail_4/tests/EnumerateInstance_Fail_4rspgood.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<CIM CIMVERSION="2.0" DTDVERSION="2.0">
+<MESSAGE ID="1001" PROTOCOLVERSION="1.0">
+<SIMPLERSP>
+<IMETHODRESPONSE NAME="EnumerateInstances">
+<ERROR CODE="6" DESCRIPTION="CIM_ERR_NOT_FOUND: The requested object could not be found: &quot;&amp;quot;&amp;lt;MSGS&amp;gt;&amp;lt;MSG COMP=&amp;quot;CIMVM&amp;quot; RC=&amp;quot;400&amp;quot; RS=&amp;quot;65&amp;quot; MSGID=&amp;quot;DNZZMC465E&amp;quot; COMM AND=&amp;quot;Transaction: CimVm::CbCProvisioningService::createUser; Subtask: Process disk settings&amp;quot;&amp;gt;Fehler beim Erstellen eines virtuellen Computersystems (Aktion wurde rückgängig gemacht).&amp;#13;&amp;lt;/MSG&amp;gt;&amp;lt;MSG COMP=&amp;quot;CIMVM&amp;quot; RC=&amp;quot;200&amp;quot; RS=&amp;quot;5&amp;quot; MSGID=&amp;quot;DNZZMC205E&amp;quot; ROOTCAUSE=&amp;quot;true&amp;quot;&amp;gt;&amp;amp;quot;22500&amp;amp;quot; ist keine gültige Einheitennummer.&amp;#13;&amp;lt;/MSG&amp;gt;&amp;lt;/MSGS&amp;gt;&amp;quot;&quot;"/>
+</IMETHODRESPONSE>
+</SIMPLERSP>
+</MESSAGE>
+</CIM>
diff --git a/src/Providers/TestProviders/CMPI/TestFail_4/tests/Makefile b/src/Providers/TestProviders/CMPI/TestFail_4/tests/Makefile
new file mode 100644
index 0000000..617126a
--- /dev/null
+++ b/src/Providers/TestProviders/CMPI/TestFail_4/tests/Makefile
@@ -0,0 +1,36 @@
+#//%2005////////////////////////////////////////////////////////////////////////
+#//
+#// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+#// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+#// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+#// IBM Corp.; EMC Corporation, The Open Group.
+#// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+#// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+#// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+#// EMC Corporation; VERITAS Software Corporation; The Open Group.
+#//
+#// Permission is hereby granted, free of charge, to any person obtaining a copy
+#// of this software and associated documentation files (the "Software"), to
+#// deal in the Software without restriction, including without limitation the
+#// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+#// sell copies of the Software, and to permit persons to whom the Software is
+#// furnished to do so, subject to the following conditions:
+#//
+#// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+#// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+#// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+#// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+#// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+#// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+#// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+#// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#//
+#//==============================================================================
+
+ROOT = ../../../../../../
+include $(ROOT)/mak/config.mak
+include $(ROOT)/test/config.mak
+
+XMLSCRIPTS = EnumerateInstance_Fail_4
+
+include $(ROOT)/test/configend.mak
diff --git a/src/Providers/TestProviders/Load/Makefile b/src/Providers/TestProviders/Load/Makefile
index ae869ee..12a288e 100644
--- a/src/Providers/TestProviders/Load/Makefile
+++ b/src/Providers/TestProviders/Load/Makefile
@@ -195,6 +195,7 @@ ifdef PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER
cimprovider -r -m TestCMPIFail_1ProviderModule
cimprovider -r -m TestCMPIFail_2ProviderModule
cimprovider -r -m TestCMPIFail_3ProviderModule
+ cimprovider -r -m TestCMPIFail_4ProviderModule
ifdef PEGASUS_ENABLE_EXECQUERY
cimprovider -r -m TestCMPIInstanceProviderModule
endif
diff --git a/src/Providers/TestProviders/Load/TestCMPI_ProviderRegistration.mof b/src/Providers/TestProviders/Load/TestCMPI_ProviderRegistration.mof
index 3ddfc0c..c461e77 100644
--- a/src/Providers/TestProviders/Load/TestCMPI_ProviderRegistration.mof
+++ b/src/Providers/TestProviders/Load/TestCMPI_ProviderRegistration.mof
@@ -179,3 +179,39 @@ instance of PG_ProviderCapabilities
SupportedProperties = NULL; // All properties
SupportedMethods = NULL; // All methods
};
+// ===================================================================
+// Instance provider that returns an error for every Instance API
+// class.
+// ===================================================================
+instance of PG_ProviderModule
+{
+ Description = "CMPI Test Fail_4 provider";
+ Name = "TestCMPIFail_4ProviderModule";
+ // The library name on disk
+ Location = "cmpiTestFail_4Provider";
+ Vendor = "SBLIM";
+ Version = "2.0.0";
+ InterfaceType = "CMPI";
+ InterfaceVersion = "2.0.0";
+};
+
+instance of PG_Provider
+{
+ ProviderModuleName = "TestCMPIFail_4ProviderModule";
+ // The provider name as referenced in the code!
+ Name = "TestCMPIFail_4Provider";
+};
+
+instance of PG_ProviderCapabilities
+{
+ ProviderModuleName = "TestCMPIFail_4ProviderModule";
+ ProviderName = "TestCMPIFail_4Provider";
+ CapabilityID = "CMPI Test Instance Fail 1 Provider";
+ // Name of the CIM Class as defined in the mof.
+
+ ClassName = "TestCMPI_Fail_4";
+ Namespaces = { "test/TestProvider" };
+ ProviderType = { 2 }; //Instance
+ SupportedProperties = NULL; // All properties
+ SupportedMethods = NULL; // All methods
+};
diff --git a/src/Providers/TestProviders/Load/TestCMPI_ProviderSchema.mof b/src/Providers/TestProviders/Load/TestCMPI_ProviderSchema.mof
index 8bcf827..290cb8d 100644
--- a/src/Providers/TestProviders/Load/TestCMPI_ProviderSchema.mof
+++ b/src/Providers/TestProviders/Load/TestCMPI_ProviderSchema.mof
@@ -60,3 +60,7 @@ class TestCMPI_Fail_2: TestCMPI_Parent
class TestCMPI_Fail_3: TestCMPI_Parent
{
};
+
+class TestCMPI_Fail_4: TestCMPI_Parent
+{
+};
diff --git a/src/Providers/TestProviders/Makefile b/src/Providers/TestProviders/Makefile
index adc925a..14c22ba 100644
--- a/src/Providers/TestProviders/Makefile
+++ b/src/Providers/TestProviders/Makefile
@@ -64,7 +64,10 @@ DIRS += \
CMPI/TestFail_2 \
CMPI/TestFail_2/tests\
CMPI/TestFail_3 \
- CMPI/TestFail_3/tests
+ CMPI/TestFail_3/tests \
+ CMPI/TestFail_4 \
+ CMPI/TestFail_4/tests
+
ifdef PEGASUS_ENABLE_EXECQUERY