diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-04-24 14:16:15 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-04-24 14:16:15 -0700 |
commit | 943a48fc5c0a59b892eb746073c71b8dd88815e7 (patch) | |
tree | 421cfedbc60603d02e0b314d9204e9f85dd781c5 /cpp/test/IceStorm/repstress/run.py | |
parent | minor fix to IcePHP getLogger (diff) | |
download | ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.bz2 ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.xz ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.zip |
python 3 support
Diffstat (limited to 'cpp/test/IceStorm/repstress/run.py')
-rwxr-xr-x | cpp/test/IceStorm/repstress/run.py | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/cpp/test/IceStorm/repstress/run.py b/cpp/test/IceStorm/repstress/run.py index 67096c750c6..08aa574ea6b 100755 --- a/cpp/test/IceStorm/repstress/run.py +++ b/cpp/test/IceStorm/repstress/run.py @@ -16,9 +16,9 @@ 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(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceStormUtil publisher = os.path.join(os.getcwd(), "publisher") subscriber = os.path.join(os.getcwd(), "subscriber") @@ -40,86 +40,86 @@ icestorm = IceStormUtil.init(TestUtil.toplevel, os.getcwd(), "replicated", repli ' --IceStorm.Election.ResponseTimeout=2') icestorm.start() -print "creating topic...", +sys.stdout.write("creating topic... ") sys.stdout.flush() icestorm.admin("create single") -print "ok" +print("ok") -print "running subscriber...", +sys.stdout.write("running subscriber... ") sys.stdout.flush() subscriberProc = TestUtil.startServer(subscriber, ' --Ice.ServerIdleTime=0 ' + icestorm.reference(), echo = False) subscriberProc.expect("([^\n]+)\n") subControl = subscriberProc.match.group(1) -print "ok" +print("ok") -print "running publisher...", +sys.stdout.write("running publisher... ") sys.stdout.flush() publisherProc = TestUtil.startServer(publisher, ' --Ice.ServerIdleTime=0 ' + icestorm.reference(), echo = False) publisherProc.expect("([^\n]+)\n") pubControl = publisherProc.match.group(1) -print "ok" +print("ok") time.sleep(2) for i in range(0, 3): # 0, 1 - print "stopping replica 2 (0, 1 running)...", + sys.stdout.write("stopping replica 2 (0, 1 running)... ") sys.stdout.flush() icestorm.stopReplica(2) - print "ok" + print("ok") time.sleep(2) # 1, 2 - print "starting 2, stopping 0 (1, 2 running)...", + sys.stdout.write("starting 2, stopping 0 (1, 2 running)... ") sys.stdout.flush() icestorm.startReplica(2, echo=False) icestorm.stopReplica(0) - print "ok" + print("ok") # This waits for the replication to startup #icestorm.admin("list") time.sleep(2) # 0, 2 - print "starting 0, stopping 1 (0, 2 running)...", + sys.stdout.write("starting 0, stopping 1 (0, 2 running)... ") sys.stdout.flush() icestorm.startReplica(0, echo=False) icestorm.stopReplica(1) - print "ok" + print("ok") # This waits for the replication to startup #icestorm.admin("list") time.sleep(2) - print "starting 1 (all running)...", + sys.stdout.write("starting 1 (all running)... ") sys.stdout.flush() icestorm.startReplica(1, echo=False) - print "ok" + print("ok") # This waits for the replication to startup #icestorm.admin("list") time.sleep(2) -print "stopping publisher...", +sys.stdout.write("stopping publisher... ") sys.stdout.flush() runcontrol(pubControl) publisherProc.expect("([^\n]+)\n") publisherCount = publisherProc.match.group(1) publisherProc.waitTestSuccess() -print "ok" +print("ok") -print "stopping replicas...", +sys.stdout.write("stopping replicas... ") sys.stdout.flush() icestorm.stop() -print "ok" +print("ok") -print "stopping subscriber...", +sys.stdout.write("stopping subscriber... ") sys.stdout.flush() runcontrol(subControl) subscriberProc.expect("([^\n]+)\n") subscriberCount = subscriberProc.match.group(1) subscriberProc.waitTestSuccess() -print "ok" +print("ok") -print "publisher published %s events, subscriber received %s events" % (publisherCount, subscriberCount) +print("publisher published %s events, subscriber received %s events" % (publisherCount, subscriberCount)) if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd(targets, cwd = os.getcwd()) |