From: Chris B. <buc...@us...> - 2012-07-06 22:05:39
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via 194139e9b866dbb5d74f5e2eef20c0864d19e238 (commit) via 98d51ce78c14f51328132866db188a4431338a41 (commit) from 7bba0e8f89428f68feff87567c616de2f8b102a8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 194139e9b866dbb5d74f5e2eef20c0864d19e238 Author: buccella <buc...@li...> Date: Fri Jul 6 18:05:43 2012 -0400 updated tests for 3532494 (Sourcenamespaces) commit 98d51ce78c14f51328132866db188a4431338a41 Author: buccella <buc...@li...> Date: Thu Jul 5 17:00:11 2012 -0400 added root/interop2 ns for tests ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 6987bcc..34ff16c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-07-06 Chris Buccella <buc...@li...> + + * test/TestProviders/cmpiTestIndicationProvider.c, + test/TestProviders/tests/IndRetryTest.sh, + test/TestProviders/tests/IndTest1CreateFilter.xml, + test/schema/root/interop/Test_Indication.reg, + schema/root/interop2/Test_Indication.mof, + test/stageschema.sh: + [ 3532494 ] interopProvider not honoring SourceNamespaces[] correctly + Test case for additional source namespace + 2012-07-02 Chris Buccella <buc...@li...> * interopProvider.c: diff --git a/test/TestProviders/cmpiTestIndicationProvider.c b/test/TestProviders/cmpiTestIndicationProvider.c index 0e9a7e5..629ba7f 100644 --- a/test/TestProviders/cmpiTestIndicationProvider.c +++ b/test/TestProviders/cmpiTestIndicationProvider.c @@ -14,7 +14,11 @@ unsigned char CMPI_true = 1; unsigned char CMPI_false = 0; static int enabled = 0; +static int activated = 0; +static int activated2 = 0; static int _nextUID = 0; +static int gen1 = 0; +static int gen2 = 0; static void generateIndication(const char *methodname, const CMPIContext *ctx) @@ -27,7 +31,7 @@ generateIndication(const char *methodname, const CMPIContext *ctx) CMPIStatus rc; char buffer[32]; - if (enabled) { + if (enabled && activated) { cop = CMNewObjectPath(broker, "root/interop", "Test_Indication", &rc); inst = CMNewInstance(broker, cop, &rc); @@ -46,10 +50,47 @@ generateIndication(const char *methodname, const CMPIContext *ctx) if (rc.rc != CMPI_RC_OK) { fprintf(stderr, "+++ Could not send the indication!\n"); } + gen1++; } - fprintf(stderr, "+++ generateIndication() done\n"); + fprintf(stderr, "+++ generateIndication() done %d\n", gen1); } +static void +generateIndication2(const char *methodname, const CMPIContext *ctx) +{ + + CMPIInstance *inst; + CMPIObjectPath *cop; + CMPIDateTime *dat; + CMPIArray *ar; + CMPIStatus rc; + char buffer[32]; + + if (enabled && activated2) { + cop = CMNewObjectPath(broker, "root/interop2", "Test_Indication", &rc); + inst = CMNewInstance(broker, cop, &rc); + + sprintf(buffer, "%d", _nextUID++); + CMSetProperty(inst, "IndicationIdentifier", buffer, CMPI_chars); + + dat = CMNewDateTime(broker, &rc); + CMSetProperty(inst, "IndicationTime", &dat, CMPI_dateTime); + + CMSetProperty(inst, "MethodName", methodname, CMPI_chars); + + ar = CMNewArray(broker, 0, CMPI_string, &rc); + CMSetProperty(inst, "CorrelatedIndications", &ar, CMPI_stringA); + + rc = CBDeliverIndication(broker, ctx, "root/interop", inst); + if (rc.rc != CMPI_RC_OK) { + fprintf(stderr, "+++ Could not send the indication!\n"); + } + gen2++; + } + fprintf(stderr, "+++ generateIndication2() done %d\n", gen2); +} + + // ---------------------------------------------------------- // --- // Method Provider @@ -74,6 +115,7 @@ CMPIStatus indProvInvokeMethod fprintf(stderr, "+++ PROVIDER NOT ENABLED\n"); } else { generateIndication(method, ctx); + generateIndication2(method, ctx); } value.uint32 = 0; @@ -115,7 +157,15 @@ CMPIStatus indProvActivateFilter (CMPIIndicationMI * cThis, const CMPIContext *ctx, const CMPISelectExp *exp, const char *clsName, const CMPIObjectPath * classPath, CMPIBoolean firstActivation) { - fprintf(stderr, "+++ indProvActivateFilter()\n"); + + char* op = CMGetCharPtr(CMObjectPathToString(classPath, NULL)); + fprintf (stderr, "+++ indProvActivateFilter() for %s\n", op); + + if (strcmp(op, "root/interop:Test_Indication") == 0) + activated = 1; + else if (strcmp(op, "root/interop2:Test_Indication") == 0) + activated2 = 1; + CMReturn(CMPI_RC_OK); } @@ -124,6 +174,15 @@ CMPIStatus indProvDeActivateFilter const CMPISelectExp *filter, const char *clsName, const CMPIObjectPath * classPath, CMPIBoolean lastActivation) { fprintf(stderr, "+++ indProvDeActivateFilter\n"); + + char* op = CMGetCharPtr(CMObjectPathToString(classPath, NULL)); + fprintf (stderr, "+++ indProvDeActivateFilter for %s\n", op); + + if (strcmp(op, "root/interop:Test_Indication") == 0) + activated = 0; + else if (strcmp(op, "root/interop2:Test_Indication") == 0) + activated2 = 0; + CMReturn(CMPI_RC_OK); } diff --git a/test/TestProviders/tests/IndRetryTest.sh b/test/TestProviders/tests/IndRetryTest.sh index aed9f3e..aa40b34 100755 --- a/test/TestProviders/tests/IndRetryTest.sh +++ b/test/TestProviders/tests/IndRetryTest.sh @@ -21,7 +21,7 @@ # =========================================================================== # Indication flood limit (don't set less than 101) -lim=1000 +lim=500 sendxml () { @@ -303,8 +303,11 @@ do j=$((j+1)) done sleep 20 # Let the retries catch up + count=$(grep IndicationTime $ODIR/SFCB_Listener.txt | wc -l) -if [ $count -eq $lim ] +halfcount=`expr $count / 2` # 2 indication messages are sent for each indication (interop, interop2) + +if [ $halfcount -eq $lim ] then echo " received $count of $lim: PASSED" else diff --git a/test/TestProviders/tests/IndTest1CreateFilter.xml b/test/TestProviders/tests/IndTest1CreateFilter.xml index d8273d9..362bfd5 100644 --- a/test/TestProviders/tests/IndTest1CreateFilter.xml +++ b/test/TestProviders/tests/IndTest1CreateFilter.xml @@ -32,6 +32,12 @@ <PROPERTY NAME="SourceNamespace" TYPE="string"> <VALUE>root/interop</VALUE> </PROPERTY> + <PROPERTY.ARRAY NAME="SourceNamespaces" TYPE="string"> + <VALUE.ARRAY> + <VALUE>root/interop</VALUE> + <VALUE>root/interop2</VALUE> + </VALUE.ARRAY> + </PROPERTY.ARRAY> </INSTANCE> </IPARAMVALUE> </IMETHODCALL> diff --git a/test/schema/root/interop/Test_Indication.reg b/test/schema/root/interop/Test_Indication.reg index bc8d15e..40bf076 100644 --- a/test/schema/root/interop/Test_Indication.reg +++ b/test/schema/root/interop/Test_Indication.reg @@ -2,5 +2,5 @@ provider: TestIndicationProvider location: TestIndicationProvider type: indication method - namespace: root/interop + namespace: root/interop root/interop2 # diff --git a/test/schema/root/interop/Test_Indication.mof b/test/schema/root/interop2/Test_Indication.mof similarity index 100% copy from test/schema/root/interop/Test_Indication.mof copy to test/schema/root/interop2/Test_Indication.mof diff --git a/test/schema/root/interop/Test_Indication.reg b/test/schema/root/interop2/Test_Indication.reg similarity index 100% copy from test/schema/root/interop/Test_Indication.reg copy to test/schema/root/interop2/Test_Indication.reg diff --git a/test/stageschema.sh b/test/stageschema.sh index f675ee7..cb669ce 100755 --- a/test/stageschema.sh +++ b/test/stageschema.sh @@ -21,7 +21,7 @@ usage() echo "usage: $0 [-p prefix] [ -d testschemadir] [ -u ] " 1>&2 } -NAMESPACE_DIRS="root/cimv2 root/interop" +NAMESPACE_DIRS="root/cimv2 root/interop root/interop2" unstage=0 args=`getopt p:d:u $*` hooks/post-receive -- SFCB - Small Footprint CIM Broker |