summaryrefslogtreecommitdiff
path: root/cpp/test/IceStorm/single/run.py
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2008-08-04 19:18:45 -0230
committerMatthew Newhook <matthew@zeroc.com>2008-08-04 19:18:45 -0230
commitd9c568300c2aed6ab736026ea116b3f1a72fbe43 (patch)
tree27191ba2b0d1ef43256561da01462b98c7bd696d /cpp/test/IceStorm/single/run.py
parentMerge branch 'R3_3_branch' of ssh://cvs.zeroc.com/home/git/ice into R3_3_branch (diff)
downloadice-d9c568300c2aed6ab736026ea116b3f1a72fbe43.tar.bz2
ice-d9c568300c2aed6ab736026ea116b3f1a72fbe43.tar.xz
ice-d9c568300c2aed6ab736026ea116b3f1a72fbe43.zip
Numerous cleanups to the test suite and expect scripts.
Conflicts: cpp/test/Glacier2/staticFiltering/run.py
Diffstat (limited to 'cpp/test/IceStorm/single/run.py')
-rwxr-xr-xcpp/test/IceStorm/single/run.py42
1 files changed, 15 insertions, 27 deletions
diff --git a/cpp/test/IceStorm/single/run.py b/cpp/test/IceStorm/single/run.py
index f0f585f44d8..6b0a07d4a1a 100755
--- a/cpp/test/IceStorm/single/run.py
+++ b/cpp/test/IceStorm/single/run.py
@@ -11,24 +11,18 @@
import os, sys
import time
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")):
- break
-else:
+path = [ ".", "..", "../..", "../../..", "../../../.." ]
+head = os.path.dirname(sys.argv[0])
+if len(head) > 0:
+ path = [os.path.join(head, p) for p in path]
+path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
+if len(path) == 0:
raise "can't find toplevel directory!"
-
-sys.path.append(os.path.join(toplevel, "config"))
-import TestUtil
-TestUtil.processCmdLine()
-
-name = os.path.join("IceStorm", "single")
-testdir = os.path.dirname(os.path.abspath(__file__))
-
-import IceStormUtil
+sys.path.append(os.path.join(path[0]))
+from scripts import *
def dotest(type):
- icestorm = IceStormUtil.init(toplevel, testdir, type)
+ icestorm = IceStormUtil.init(TestUtil.toplevel, os.getcwd(), type)
icestorm.start()
@@ -37,14 +31,12 @@ def dotest(type):
icestorm.admin("create single")
print "ok"
- publisher = os.path.join(testdir, "publisher")
- subscriber = os.path.join(testdir, "subscriber")
+ publisher = os.path.join(os.getcwd(), "publisher")
+ subscriber = os.path.join(os.getcwd(), "subscriber")
print "starting subscriber...",
sys.stdout.flush()
- subscriberPipe = TestUtil.startServer(subscriber, icestorm.reference())
- TestUtil.getServerPid(subscriberPipe)
- TestUtil.getAdapterReady(subscriberPipe, True, 5)
+ subscriberProc = TestUtil.startServer(subscriber, icestorm.reference(), count = 5)
print "ok"
#
@@ -53,11 +45,11 @@ def dotest(type):
#
print "starting publisher...",
sys.stdout.flush()
- publisherPipe = TestUtil.startClient(publisher, icestorm.reference())
+ publisherProc = TestUtil.startClient(publisher, icestorm.reference())
print "ok"
- subscriberStatus = TestUtil.specificServerStatus(subscriberPipe, 30)
- publisherStatus = TestUtil.closePipe(publisherPipe)
+ subscriberProc.waitTestSuccess()
+ publisherProc.waitTestSuccess()
#
# Destroy the topic.
@@ -72,10 +64,6 @@ def dotest(type):
#
icestorm.stop()
- if TestUtil.serverStatus() or subscriberStatus or publisherStatus:
- TestUtil.killServers()
- sys.exit(1)
-
dotest("persistent")
dotest("transient")
dotest("replicated")