[C-MPI-commits] SF.net SVN: c-mpi:[99] test/driver
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-05-12 02:59:24
|
Revision: 99
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=99&view=rev
Author: jmwozniak
Date: 2010-05-12 02:59:18 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Minor test fixes
Modified Paths:
--------------
Makefile.in
src/cmpi/driver.c
src/cmpi-cp/cmpi-cp.c
src/cmpi-cp/module.mk.in
test/cmpi-db/test-cp1.zsh
test/cmpi-db/test-quit.zsh
test/driver/test-cmd-get.c
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-05-12 02:03:12 UTC (rev 98)
+++ Makefile.in 2010-05-12 02:59:18 UTC (rev 99)
@@ -438,7 +438,7 @@
# $(E)$(MPICC) src/cmpi/cmpi-io-test.o $(CMPI) $(LIBS) -o cmpi-io-test
# override default rule for building objects
-%.o : %.c
+%.o: %.c
$(Q) " MPICC $@"
$(E)$(MPICC) $(LIBCFLAGS) $(CFLAGS) $(TEST_OPTIONS) \
$(call modcflags,$(<)) $(<) -c -o $(@)
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-12 02:03:12 UTC (rev 98)
+++ src/cmpi/driver.c 2010-05-12 02:59:18 UTC (rev 99)
@@ -133,6 +133,7 @@
buffer_to_stream(value, length, driver->sink);
}
fflush(driver->sink);
+ printf("driver: streamed\n");
DONE;
}
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-12 02:03:12 UTC (rev 98)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-12 02:59:18 UTC (rev 99)
@@ -117,17 +117,21 @@
fprintf(to_cmpi, "get %s\n", object);
fflush(to_cmpi);
- printf("issued get\n");
+ fscanf(from_cmpi, "%i\n", &length);
- fscanf(from_cmpi, "%i", &length);
- fgetc(from_cmpi);
if (length == -1)
return CMPI_DOESNT_EXIST;
- stream_to_buffer(data, length, from_cmpi);
- sscanf(data, "DHT: %i", &count);
- // printf("count: %i\n", count);
+ c = stream_to_buffer(data, length, from_cmpi);
+ c = sscanf(data, "DHT: %i\n", &count);
+ if (c != 1)
+ {
+ printf("bad response: %s\n", data);
+ exit(1);
+ }
+ printf("count: %i\n", count);
+
for (c = 0; c < count; c++)
{
fprintf(to_cmpi, "get %s[%i]\n", object, c);
@@ -205,6 +209,8 @@
int
main(int argc, char* argv[])
{
+ printf("\ncmpi-cp start\n\n");
+
CMPI_CP_TYPE target1_type;
CMPI_CP_TYPE target2_type;
Modified: src/cmpi-cp/module.mk.in
===================================================================
--- src/cmpi-cp/module.mk.in 2010-05-12 02:03:12 UTC (rev 98)
+++ src/cmpi-cp/module.mk.in 2010-05-12 02:59:18 UTC (rev 99)
@@ -12,7 +12,11 @@
CMPI_CP_LIBS += -L $(DMALLOC_LIB) -l dmalloc
endif
+src/cmpi-cp/cmpi-cp.o: src/cmpi-cp/cmpi-cp.c
+ $(Q) " CC $(@) "
+ $(E) $(CC) -c $(CFLAGS) $(<) -o $(@)
+
bin/cmpi-cp: $(CMPICP_OBJS)
- $(Q) " CC $(@) "
+ $(Q) " LINK $(@) "
$(E) install -d bin
$(E) $(CC) $(CMPICP_OBJS) -o $(@)
Modified: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh 2010-05-12 02:03:12 UTC (rev 98)
+++ test/cmpi-db/test-cp1.zsh 2010-05-12 02:59:18 UTC (rev 99)
@@ -13,7 +13,7 @@
mpiexec -n ${PROCS} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
DB_PID=${!}
-tools/timebomb.zsh ${DB_PID} $(( PROCS*3 )) ${OUTPUT} $0 &
+tools/timebomb.zsh ${DB_PID} $(( PROCS*4 )) ${OUTPUT} $0 &
BOMB_PID=${!}
sleep ${PROCS}
@@ -37,17 +37,19 @@
crash "cmpi-cp error!"
fi
-bin/cmpi-db-quit >& /dev/null &
+bin/cmpi-db-quit >& /dev/null
QUIT_PROCESS=$!
+wait ${DB_PID}
+
+kill ${BOMB_PID}
+
sleep ${PROCS}
# Should be ${PROCS} "Normal exit."s
N=$( grep -c "Normal exit." ${OUTPUT} )
(( N == PROCS )) || crash "N != ${PROCS}"
-kill ${BOMB_PID}
-
rm -f cmpi-cp.out test-cp1.*.data
exit 0
Modified: test/cmpi-db/test-quit.zsh
===================================================================
--- test/cmpi-db/test-quit.zsh 2010-05-12 02:03:12 UTC (rev 98)
+++ test/cmpi-db/test-quit.zsh 2010-05-12 02:59:18 UTC (rev 99)
@@ -2,7 +2,7 @@
# Be sure to make tests with D=1
-set -x
+# set -x
OUTPUT=$1
PROCS=$2
@@ -15,7 +15,7 @@
sleep ${PROCS}
-bin/cmpi-db-fifo-quit >& /dev/null &
+bin/cmpi-db-quit >& /dev/null &
QUIT_PROCESS=$!
sleep ${PROCS}
Modified: test/driver/test-cmd-get.c
===================================================================
--- test/driver/test-cmd-get.c 2010-05-12 02:03:12 UTC (rev 98)
+++ test/driver/test-cmd-get.c 2010-05-12 02:59:18 UTC (rev 99)
@@ -39,9 +39,10 @@
code = fscanf(from_cmpi, "%i\n", &length);
if (code != 1)
crash("No response from driver!");
+ // printf("length: %i code: %i \n", length, code);
if (length == -1)
- crash("key not found");
+ crash("Key not found!");
char* result = malloc(length*sizeof(char));
memset(result, 0, length);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|