diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-11-25 13:13:22 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-11-25 13:13:22 +0100 |
commit | dcdc32af1fced49d80a8ccd93230e15d91ab45d8 (patch) | |
tree | eb69e2555fbd54496fce8a33f4dd610e1473ff51 /scripts/tests/Ice/networkProxy.py | |
parent | C# IceSSL/configuration log expired certificate exceptions. (diff) | |
download | ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.tar.bz2 ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.tar.xz ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.zip |
Refactored test scripts
Diffstat (limited to 'scripts/tests/Ice/networkProxy.py')
-rw-r--r-- | scripts/tests/Ice/networkProxy.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/tests/Ice/networkProxy.py b/scripts/tests/Ice/networkProxy.py new file mode 100644 index 00000000000..948b24b2e7c --- /dev/null +++ b/scripts/tests/Ice/networkProxy.py @@ -0,0 +1,38 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +import NetworkProxy + +class NetworkProxyTestCase(ClientServerTestCase): + + def __init__(self, proxyName, proxyType, proxyPortNum): + ClientServerTestCase.__init__(self, proxyName + " client/server", client = Client(props = lambda p, c: { + "Ice.{0}ProxyHost".format(proxyName): "localhost", + "Ice.{0}ProxyPort".format(proxyName): "{0}".format(c.driver.getTestPort(proxyPortNum)) + })) + self.proxyName = proxyName + self.proxyType = proxyType + self.proxyPortNum = proxyPortNum + self.proxy = None + + def setupClientSide(self, current): + current.write("starting {0} proxy... ".format(self.proxyName)) + self.proxy = self.proxyType(current.driver.getTestPort(self.proxyPortNum)) + current.writeln("ok") + + def teardownClientSide(self, current, success): + current.write("terminating {0} proxy... ".format(self.proxyName)) + self.proxy.terminate() + self.proxy = None + current.writeln("ok") + +TestSuite(__name__, [ + NetworkProxyTestCase("SOCKS", NetworkProxy.SocksProxy, 30), + NetworkProxyTestCase("HTTP", NetworkProxy.HttpProxy, 31), +], options = { "ipv6" : [False] }) |