summaryrefslogtreecommitdiff
path: root/cpp/config/TestUtil.py
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2007-01-25 02:51:50 +0000
committerMatthew Newhook <matthew@zeroc.com>2007-01-25 02:51:50 +0000
commit5e18e3f185207d790520a40f2efbac2f72f80825 (patch)
treedd82fcbc75b7c6885b7bc67f7358b7447b240cef /cpp/config/TestUtil.py
parentReplacted "dump" with "show" (diff)
downloadice-5e18e3f185207d790520a40f2efbac2f72f80825.tar.bz2
ice-5e18e3f185207d790520a40f2efbac2f72f80825.tar.xz
ice-5e18e3f185207d790520a40f2efbac2f72f80825.zip
fix bug with test/IceStorm/federation2/run.py.
Diffstat (limited to 'cpp/config/TestUtil.py')
-rw-r--r--cpp/config/TestUtil.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/cpp/config/TestUtil.py b/cpp/config/TestUtil.py
index aa170d6e37e..f50b090a411 100644
--- a/cpp/config/TestUtil.py
+++ b/cpp/config/TestUtil.py
@@ -175,6 +175,9 @@ class ReaderThread(Thread):
self.status = closePipe(self.pipe)
+ def getPipe(self):
+ return self.pipe
+
def getStatus(self):
return self.status
@@ -190,6 +193,8 @@ def joinServers():
allServerThreads.append(t)
serverThreads = []
+# This joins with all servers and if any of them failed then
+# it returns the failure status.
def serverStatus():
global allServerThreads
joinServers()
@@ -199,6 +204,19 @@ def serverStatus():
return status
return 0
+# This joins with a specific server (the one started with the given pipe)
+# returns its exit status. If the server cannot be found an exception
+# is raised.
+def specificServerStatus(pipe):
+ global serverThreads
+ for t in serverThreads:
+ if t.getPipe() == pipe:
+ serverThreads.remove(t)
+ t.join()
+ status = t.getStatus()
+ return status
+ raise "can't find server with pipe: " + str(pipe)
+
def killServers():
global serverPids