[C-MPI-commits] SF.net SVN: c-mpi:[148] tools
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-05-24 00:34:08
|
Revision: 148
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=148&view=rev
Author: jmwozniak
Date: 2010-05-24 00:34:01 +0000 (Mon, 24 May 2010)
Log Message:
-----------
Probable bug fix to driver
Modified Paths:
--------------
src/cmpi/accessor.c
src/cmpi/driver.c
test/cmpi-db/test-cp1.zsh
test/cmpi-db/test-loop.zsh
tools/test-helpers.zsh
Modified: src/cmpi/accessor.c
===================================================================
--- src/cmpi/accessor.c 2010-05-23 23:18:14 UTC (rev 147)
+++ src/cmpi/accessor.c 2010-05-24 00:34:01 UTC (rev 148)
@@ -1,5 +1,6 @@
#include <assert.h>
+#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -42,12 +43,16 @@
if (to_cmpi == NULL)
{
printf("Could not open: %s \n", fifo_in);
+ printf("errno: %s\n", strerror(errno));
+ fflush(stdout);
return false;
}
from_cmpi = fopen(fifo_out, "r");
if (from_cmpi == NULL)
{
printf("Could not open: %s \n", fifo_out);
+ printf("errno: %s\n", strerror(errno));
+ fflush(stdout);
return false;
}
return true;
Modified: src/cmpi/driver.c
===================================================================
--- src/cmpi/driver.c 2010-05-23 23:18:14 UTC (rev 147)
+++ src/cmpi/driver.c 2010-05-24 00:34:01 UTC (rev 148)
@@ -82,8 +82,9 @@
if (!fifo_in)
driver_setup_fifo_names();
- unlink(fifo_in);
- unlink(fifo_out);
+ // This was a bad idea:
+ // unlink(fifo_in);
+ // unlink(fifo_out);
int error = mkfifo(fifo_in, S_IRUSR|S_IWUSR);
if (error != 0 &&
Modified: test/cmpi-db/test-cp1.zsh
===================================================================
--- test/cmpi-db/test-cp1.zsh 2010-05-23 23:18:14 UTC (rev 147)
+++ test/cmpi-db/test-cp1.zsh 2010-05-24 00:34:01 UTC (rev 148)
@@ -42,6 +42,7 @@
fi
bin/cmpi-db-quit >& /dev/null
+tool_error "cmpi-db-quit" ${?}
QUIT_PROCESS=$!
wait ${DB_PID}
Modified: test/cmpi-db/test-loop.zsh
===================================================================
--- test/cmpi-db/test-loop.zsh 2010-05-23 23:18:14 UTC (rev 147)
+++ test/cmpi-db/test-loop.zsh 2010-05-24 00:34:01 UTC (rev 148)
@@ -1,44 +1,28 @@
#!/bin/zsh
# Be sure to make tests with D=1
+# Produces output in test-loop.out and tool.out
-set -x
+# set -x
OUTPUT=$1
NODES=$2
CLIENTS=$3
-TOTAL=$(( NODES+CLIENTS ))
-
-LOOPS=10
-
TOOL_OUT=tool.out
INPUT_DATA=input.data
OUTPUT_DATA=output.data
-tool_error()
-{
- TOOL=$1
- ERR=$2
- if [[ ${ERR} != 0 ]]
- then
- cat ${TOOL_OUT}
- rm -v ${TOOL_OUT}
- print "${TOOL}: error: ${ERR}"
- kill ${DB_PID}
- kill ${BOMB_PID}
- crash "failed"
- else
- print "success"
- fi
-}
+TOTAL=$(( NODES+CLIENTS ))
+LOOPS=10
+
source tools/test-helpers.zsh
mpiexec -n ${TOTAL} bin/cmpi-db -n ${NODES} >& ${OUTPUT} &
DB_PID=${!}
-tools/timebomb.zsh ${DB_PID} $(( TOTAL*6 + LOOPS*4 )) ${OUTPUT} $0 &
+tools/timebomb.zsh ${DB_PID} $(( TOTAL*10 + LOOPS*4 )) ${OUTPUT} $0 &
BOMB_PID=${!}
sleep ${TOTAL}
Modified: tools/test-helpers.zsh
===================================================================
--- tools/test-helpers.zsh 2010-05-23 23:18:14 UTC (rev 147)
+++ tools/test-helpers.zsh 2010-05-24 00:34:01 UTC (rev 148)
@@ -27,6 +27,19 @@
exit 1
}
+tool_error()
+{
+ TOOL=$1
+ ERR=$2
+ if [[ ${ERR} != 0 ]]
+ then
+ print "${TOOL}: error: ${ERR}"
+ kill ${DB_PID}
+ kill ${BOMB_PID}
+ crash "failed"
+ fi
+}
+
check_exits()
# Should be TOTAL "Normal exit."s
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|