summaryrefslogtreecommitdiff
path: root/python/test/Ice/faultTolerance/Client.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/test/Ice/faultTolerance/Client.py')
-rwxr-xr-xpython/test/Ice/faultTolerance/Client.py59
1 files changed, 18 insertions, 41 deletions
diff --git a/python/test/Ice/faultTolerance/Client.py b/python/test/Ice/faultTolerance/Client.py
index 9673fd3b41d..b1f9d8cb981 100755
--- a/python/test/Ice/faultTolerance/Client.py
+++ b/python/test/Ice/faultTolerance/Client.py
@@ -8,53 +8,30 @@
#
# **********************************************************************
-import os, sys, traceback
-import Ice, AllTests
+from TestHelper import TestHelper
+import AllTests
-def test(b):
- if not b:
- raise RuntimeError('test assertion failed')
-def usage(n):
- sys.stderr.write("Usage: " + n + " port...\n")
+class Client(TestHelper):
-def run(args, communicator):
- ports = []
- for arg in args[1:]:
- if arg[0] == '-':
- sys.stderr.write(args[0] + ": unknown option `" + arg + "'\n")
- usage(args[0])
- return False
+ def run(self, args):
- ports.append(12010 + int(arg))
+ properties = self.createTestProperties(args)
- if len(ports) == 0:
- sys.stderr.write(args[0] + ": no ports specified\n")
- usage(args[0])
- return False
+ #
+ # This test aborts servers, so we don't want warnings.
+ #
+ properties.setProperty('Ice.Warn.Connections', '0')
- try:
- AllTests.allTests(communicator, ports)
- except:
- traceback.print_exc()
- test(False)
+ ports = []
+ for arg in args:
+ if arg[0] == '-':
+ raise RuntimeError("unknown option `" + arg + "'")
+ ports.append(int(arg))
- return True
+ if len(ports) == 0:
+ raise RuntimeError("no ports specified")
-try:
- initData = Ice.InitializationData()
- initData.properties = Ice.createProperties(sys.argv)
-
- #
- # This test aborts servers, so we don't want warnings.
- #
- initData.properties.setProperty('Ice.Warn.Connections', '0')
-
- with Ice.initialize(sys.argv, initData) as communicator:
- status = run(sys.argv, communicator)
-except:
- traceback.print_exc()
- status = False
-
-sys.exit(not status)
+ with self.initialize(properties=properties) as communicator:
+ AllTests.allTests(self, communicator, ports)