diff options
Diffstat (limited to 'scripts/tests')
36 files changed, 595 insertions, 0 deletions
diff --git a/scripts/tests/Glacier2/__init__.py b/scripts/tests/Glacier2/__init__.py new file mode 100644 index 00000000000..90d182d1c05 --- /dev/null +++ b/scripts/tests/Glacier2/__init__.py @@ -0,0 +1,8 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** diff --git a/scripts/tests/Glacier2/router.py b/scripts/tests/Glacier2/router.py new file mode 100644 index 00000000000..f3f1a5b4aa0 --- /dev/null +++ b/scripts/tests/Glacier2/router.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +passwords = { + "userid": "abc123", + "userid-0": "abc123", + "userid-1": "abc123", + "userid-2": "abc123", + "userid-3": "abc123", + "userid-4": "abc123" +} + +routerProps = { + "Ice.Warn.Dispatch" : "0", + "Ice.Warn.Connections" : "0", + "Glacier2.Filter.Category.Accept" : "c1 c2", + "Glacier2.Filter.Category.AcceptUser" : "2", + "Glacier2.SessionTimeout" : "30", +} + +def buffered(enabled): + return { "Glacier2.Client.Buffered": enabled, "Glacier2.Server.Buffered": enabled } + +Glacier2TestSuite(__name__, routerProps, [ + ClientServerTestCase(name="client/server with router in unbuffered mode", + servers=[Glacier2Router(passwords=passwords, props=buffered(False)), Server()], + client=Client(args=["--shutdown"])), + ClientServerTestCase(name="client/server with router in buffered mode", + servers=[Glacier2Router(passwords=passwords, props=buffered(True)), Server()], + clients=[Client(), Client(args=["--shutdown"])])]) + diff --git a/scripts/tests/Glacier2/sessionHelper.py b/scripts/tests/Glacier2/sessionHelper.py new file mode 100644 index 00000000000..f9d802901c8 --- /dev/null +++ b/scripts/tests/Glacier2/sessionHelper.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +Glacier2TestSuite(__name__, routerProps = { "Glacier2.SessionTimeout" : 30 }) diff --git a/scripts/tests/Ice/__init__.py b/scripts/tests/Ice/__init__.py new file mode 100644 index 00000000000..90d182d1c05 --- /dev/null +++ b/scripts/tests/Ice/__init__.py @@ -0,0 +1,8 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** diff --git a/scripts/tests/Ice/adapterDeactivation.py b/scripts/tests/Ice/adapterDeactivation.py new file mode 100644 index 00000000000..deb29ba6b5f --- /dev/null +++ b/scripts/tests/Ice/adapterDeactivation.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, multihost=False)
\ No newline at end of file diff --git a/scripts/tests/Ice/admin.py b/scripts/tests/Ice/admin.py new file mode 100644 index 00000000000..a87c0754c69 --- /dev/null +++ b/scripts/tests/Ice/admin.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, options = { "ipv6" : [False] }, multihost=False)
\ No newline at end of file diff --git a/scripts/tests/Ice/ami.py b/scripts/tests/Ice/ami.py new file mode 100644 index 00000000000..6e5abe02f7f --- /dev/null +++ b/scripts/tests/Ice/ami.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, options = { "compress" : [False] })
\ No newline at end of file diff --git a/scripts/tests/Ice/background.py b/scripts/tests/Ice/background.py new file mode 100644 index 00000000000..4db72200a79 --- /dev/null +++ b/scripts/tests/Ice/background.py @@ -0,0 +1,10 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, libDirs=["testtransport"], options={ "mx": [False] }) diff --git a/scripts/tests/Ice/enums.py b/scripts/tests/Ice/enums.py new file mode 100644 index 00000000000..1780057f1a5 --- /dev/null +++ b/scripts/tests/Ice/enums.py @@ -0,0 +1,13 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, [ + ClientServerTestCase("client/server with default encoding"), + ClientServerTestCase("client/server with 1.0 encoding", props={ "Ice.Default.EncodingVersion" : "1.0" }), +])
\ No newline at end of file diff --git a/scripts/tests/Ice/exceptions.py b/scripts/tests/Ice/exceptions.py new file mode 100644 index 00000000000..0e2ac209032 --- /dev/null +++ b/scripts/tests/Ice/exceptions.py @@ -0,0 +1,24 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +testcases = [ + ClientServerTestCase("client/server with compact format"), + ClientServerTestCase("client/server with sliced format", props={ "Ice.Default.SlicedFormat" : True }), + ClientServerTestCase("client/server with 1.0 encoding", props={ "Ice.Default.EncodingVersion" : "1.0" }), +] + +# If the mapping has AMD servers, also run with the AMD servers +if Mapping.getByPath(__name__).hasSource("Ice/exceptions", "serveramd"): + testcases += [ + ClientAMDServerTestCase("client/amd server with compact format"), + ClientAMDServerTestCase("client/amd server with sliced format", props={ "Ice.Default.SlicedFormat" : True }), + ClientAMDServerTestCase("client/amd server with 1.0 encoding", props={ "Ice.Default.EncodingVersion" : "1.0" }), + ] + +TestSuite(__name__, testcases)
\ No newline at end of file diff --git a/scripts/tests/Ice/faultTolerance.py b/scripts/tests/Ice/faultTolerance.py new file mode 100755 index 00000000000..6cc55446826 --- /dev/null +++ b/scripts/tests/Ice/faultTolerance.py @@ -0,0 +1,20 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +from Util import * + +# +# Start 12 servers +# +servers=range(1, 13) + +TestSuite(__name__, [ + ClientServerTestCase(client=Client(args=[i for i in servers]), + servers=[Server(args=[i], waitForShutdown=False) for i in servers]) +]) diff --git a/scripts/tests/Ice/hold.py b/scripts/tests/Ice/hold.py new file mode 100644 index 00000000000..a3889c461b7 --- /dev/null +++ b/scripts/tests/Ice/hold.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, [ClientServerTestCase(server=Server(readyCount=2))]) diff --git a/scripts/tests/Ice/info.py b/scripts/tests/Ice/info.py new file mode 100644 index 00000000000..e42ee312f56 --- /dev/null +++ b/scripts/tests/Ice/info.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, options = { "ipv6" : [False], "compress" : [False] }, multihost=False)
\ No newline at end of file diff --git a/scripts/tests/Ice/interceptor.py b/scripts/tests/Ice/interceptor.py new file mode 100644 index 00000000000..1db4578f24b --- /dev/null +++ b/scripts/tests/Ice/interceptor.py @@ -0,0 +1,10 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, [ClientTestCase(client=Client(props={"Ice.Warn.Dispatch" : 0}))], libDirs=["interceptortest"]) diff --git a/scripts/tests/Ice/interrupt.py b/scripts/tests/Ice/interrupt.py new file mode 100644 index 00000000000..6e5abe02f7f --- /dev/null +++ b/scripts/tests/Ice/interrupt.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, options = { "compress" : [False] })
\ No newline at end of file diff --git a/scripts/tests/Ice/metrics.py b/scripts/tests/Ice/metrics.py new file mode 100644 index 00000000000..e81bc4b22af --- /dev/null +++ b/scripts/tests/Ice/metrics.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, options = { "ipv6" : [False], "compress": [False], "protocol" : ["tcp", "ssl"] }, multihost=False) 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] }) diff --git a/scripts/tests/Ice/objects.py b/scripts/tests/Ice/objects.py new file mode 100644 index 00000000000..fef2b3fb6cb --- /dev/null +++ b/scripts/tests/Ice/objects.py @@ -0,0 +1,14 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, [ + ClientServerTestCase("client/server with compact format"), + ClientServerTestCase("client/server with sliced format", props={ "Ice.Default.SlicedFormat" : True }), + ClientServerTestCase("client/server with 1.0 encoding", props={ "Ice.Default.EncodingVersion" : "1.0" }), +])
\ No newline at end of file diff --git a/scripts/tests/Ice/optional.py b/scripts/tests/Ice/optional.py new file mode 100644 index 00000000000..b706d197749 --- /dev/null +++ b/scripts/tests/Ice/optional.py @@ -0,0 +1,23 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + + +testcases = [ + ClientServerTestCase("client/server with compact format"), + ClientServerTestCase("client/server with sliced format", props={ "Ice.Default.SlicedFormat" : True }), +] + +# If the mapping has AMD servers, also run with the AMD servers +if Mapping.getByPath(__name__).hasSource("Ice/exceptions", "serveramd"): + testcases += [ + ClientAMDServerTestCase("client/amd server with compact format"), + ClientAMDServerTestCase("client/amd server with sliced format", props={ "Ice.Default.SlicedFormat" : True }), + ] + +TestSuite(__name__, testcases)
\ No newline at end of file diff --git a/scripts/tests/Ice/properties.py b/scripts/tests/Ice/properties.py new file mode 100644 index 00000000000..92a9832aa61 --- /dev/null +++ b/scripts/tests/Ice/properties.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +class PropertiesTestSuite(TestSuite): + + def setup(self, current): + name = "\xe4\xb8\xad\xe5\x9b\xbd_client.config" if isPython2 else "\u4e2d\u56fd_client.config" + self.createFile("./config/" + name, + ["# Automatically generated by Ice test driver.", + "Ice.Trace.Protocol=1", + "Ice.Trace.Network=1", + "Ice.ProgramName=PropertiesClient", + "Config.Path=./config/" + name], + "utf-8") + +PropertiesTestSuite(__name__) diff --git a/scripts/tests/Ice/slicing/__init__.py b/scripts/tests/Ice/slicing/__init__.py new file mode 100644 index 00000000000..90d182d1c05 --- /dev/null +++ b/scripts/tests/Ice/slicing/__init__.py @@ -0,0 +1,8 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** diff --git a/scripts/tests/Ice/slicing/exceptions.py b/scripts/tests/Ice/slicing/exceptions.py new file mode 100644 index 00000000000..beb5f64484a --- /dev/null +++ b/scripts/tests/Ice/slicing/exceptions.py @@ -0,0 +1,22 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +testcases = [ + ClientServerTestCase(), + ClientServerTestCase("client/server with 1.0 encoding", props={ "Ice.Default.EncodingVersion" : "1.0" }), +] + +# If the mapping has AMD servers, also run with the AMD servers +if Mapping.getByPath(__name__).hasSource("Ice/exceptions", "serveramd"): + testcases += [ + ClientAMDServerTestCase(), + ClientAMDServerTestCase("client/amd server with 1.0 encoding", props={ "Ice.Default.EncodingVersion" : "1.0" }), + ] + +TestSuite(__name__, testcases)
\ No newline at end of file diff --git a/scripts/tests/Ice/slicing/objects.py b/scripts/tests/Ice/slicing/objects.py new file mode 100644 index 00000000000..c1d57969e85 --- /dev/null +++ b/scripts/tests/Ice/slicing/objects.py @@ -0,0 +1,13 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, [ + ClientServerTestCase(), + ClientServerTestCase("client/server with 1.0 encoding", props={ "Ice.Default.EncodingVersion" : "1.0" }), +])
\ No newline at end of file diff --git a/scripts/tests/Ice/stream.py b/scripts/tests/Ice/stream.py new file mode 100644 index 00000000000..30fecbf5b9e --- /dev/null +++ b/scripts/tests/Ice/stream.py @@ -0,0 +1,14 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + + +TestSuite(__name__, [ + ClientTestCase("client with default encoding"), + ClientTestCase("client with 1.0 encoding", props={ "Ice.Default.EncodingVersion" : "1.0" }) +])
\ No newline at end of file diff --git a/scripts/tests/Ice/timeout.py b/scripts/tests/Ice/timeout.py new file mode 100644 index 00000000000..6e5abe02f7f --- /dev/null +++ b/scripts/tests/Ice/timeout.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, options = { "compress" : [False] })
\ No newline at end of file diff --git a/scripts/tests/Ice/udp.py b/scripts/tests/Ice/udp.py new file mode 100644 index 00000000000..214d9aaf8f3 --- /dev/null +++ b/scripts/tests/Ice/udp.py @@ -0,0 +1,19 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +from Util import * + +# +# Start 5 servers +# +servers=range(0, 5) + +TestSuite(__name__, [ + ClientServerTestCase(client=Client(args=[5]), servers=[Server(args=[i], ready="McastTestAdapter") for i in servers]) +], multihost=False) diff --git a/scripts/tests/IceBox/__init__.py b/scripts/tests/IceBox/__init__.py new file mode 100644 index 00000000000..90d182d1c05 --- /dev/null +++ b/scripts/tests/IceBox/__init__.py @@ -0,0 +1,8 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** diff --git a/scripts/tests/IceBox/admin.py b/scripts/tests/IceBox/admin.py new file mode 100644 index 00000000000..cd36e7475f7 --- /dev/null +++ b/scripts/tests/IceBox/admin.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +class IceBoxAdminTestCase(ClientServerTestCase): + + def runClientSide(self, current): + + admin = IceBoxAdmin(args = ['--Ice.Config="{testdir}/config.admin"']) + current.write("testing service stop...") + admin.run(current, args=['stop', 'TestService']) + current.writeln("ok") + current.write("testing service start...") + admin.run(current, args=['start', 'TestService']) + current.writeln("ok") + current.write("testing shutdown...") + admin.run(current, args=['shutdown']) + current.writeln("ok") + +TestSuite(__name__, [ + ClientServerTestCase(server=IceBox(args=['--Ice.Config="{testdir}/config.icebox"'])), + IceBoxAdminTestCase("iceboxadmin", server=IceBox(args=['--Ice.Config="{testdir}/config.icebox"'])), +], libDirs=["testservice"], runOnMainThread=True, options={ "ipv6" : [False], "mx" : [False] }, multihost=False) diff --git a/scripts/tests/IceBox/configuration.py b/scripts/tests/IceBox/configuration.py new file mode 100644 index 00000000000..d8add442cba --- /dev/null +++ b/scripts/tests/IceBox/configuration.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +TestSuite(__name__, [ + ClientServerTestCase("client/server #1", server=IceBox(args=['--Ice.Config="{testdir}/config.icebox"'])), + ClientServerTestCase("client/server #2", server=IceBox(args=['--Ice.Config="{testdir}/config.icebox2"'])) +], libDirs=["testservice"], runOnMainThread=True, options={ "protocol" : ["tcp"], "ipv6" : [False], "mx" : [False] }, multihost=False) diff --git a/scripts/tests/IceDiscovery/__init__.py b/scripts/tests/IceDiscovery/__init__.py new file mode 100644 index 00000000000..90d182d1c05 --- /dev/null +++ b/scripts/tests/IceDiscovery/__init__.py @@ -0,0 +1,8 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** diff --git a/scripts/tests/IceDiscovery/simple.py b/scripts/tests/IceDiscovery/simple.py new file mode 100644 index 00000000000..36b4f86a39e --- /dev/null +++ b/scripts/tests/IceDiscovery/simple.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +# Client properties (plugin is loaded with Ice::registerPluginFactory) +props = lambda process, current: { + "IceDiscovery.Timeout": 50, + "IceDiscovery.RetryCount": 5, + "IceDiscovery.Interface": "127.0.0.1" if not current.config.ipv6 else "\"::1\"" if isinstance(platform, Darwin) else "", + "Ice.Plugin.IceDiscovery": current.getPluginEntryPoint("IceDiscovery") +} + +# Server properties (client properties + plugin configuration) +serverProps = lambda process, current: dict(itertools.chain({ + "Ice.Plugin.IceDiscovery": current.getPluginEntryPoint("IceDiscovery") +}.items(), props(process, current).items())) + +TestSuite(__name__, [ + ClientServerTestCase(client=Client(args=[3], props=props), + servers=[Server(args=[i], readyCount=4, props=serverProps) for i in range(0, 3)]) +], multihost=False) diff --git a/scripts/tests/IceGrid/__init__.py b/scripts/tests/IceGrid/__init__.py new file mode 100644 index 00000000000..90d182d1c05 --- /dev/null +++ b/scripts/tests/IceGrid/__init__.py @@ -0,0 +1,8 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** diff --git a/scripts/tests/IceGrid/simple.py b/scripts/tests/IceGrid/simple.py new file mode 100644 index 00000000000..379ebe790d9 --- /dev/null +++ b/scripts/tests/IceGrid/simple.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +serverProps = { + "TestAdapter.Endpoints" : "default", + "TestAdapter.AdapterId" : "TestAdapter" +} + +registryProps = { + "IceGrid.Registry.DynamicRegistration" : 1 +} + +TestSuite(__name__, [ + IceGridTestCase("without deployment", application=None, + icegridregistry=[IceGridRegistryMaster(props=registryProps), + IceGridRegistrySlave(1, props=registryProps), + IceGridRegistrySlave(2, props=registryProps)], + client=ClientServerTestCase(client=IceGridClient(), server=IceGridServer(props=serverProps))), + IceGridTestCase("with deployment", client=IceGridClient(args=["--with-deploy"])) +], multihost=False) diff --git a/scripts/tests/IceSSL/__init__.py b/scripts/tests/IceSSL/__init__.py new file mode 100644 index 00000000000..90d182d1c05 --- /dev/null +++ b/scripts/tests/IceSSL/__init__.py @@ -0,0 +1,8 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** diff --git a/scripts/tests/IceSSL/configuration.py b/scripts/tests/IceSSL/configuration.py new file mode 100644 index 00000000000..1d4f832b49f --- /dev/null +++ b/scripts/tests/IceSSL/configuration.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# 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. +# +# ********************************************************************** + +class ConfigurationTestCase(ClientServerTestCase): + + def setupServerSide(self, current): + # Nothing to do if we're not running this test with the C++ mapping + if not isinstance(self.getMapping(), CppMapping): + return + + certsPath = os.path.abspath(os.path.join(self.getPath(), "..", "certs")) + if isinstance(platform, Darwin): + keychainPath = os.path.join(certsPath, "Find.keychain") + os.system("mkdir -p {0}".format(os.path.join(certsPath, "keychain"))) + os.system("security create-keychain -p password %s" % keychainPath) + for cert in ["s_rsa_ca1.p12", "c_rsa_ca1.p12"]: + os.system("security import %s -f pkcs12 -A -P password -k %s" % (os.path.join(certsPath, cert), keychainPath)) + elif platform.hasOpenSSL(): + # + # Create copies of the CA certificates named after the subject + # hash. This is used by the tests to find the CA certificates in + # the IceSSL.DefaultDir + # + for c in ["cacert1.pem", "cacert2.pem"]: + pem = os.path.join(certsPath, c) + os.system("cp {pem} {dir}/`openssl x509 -subject_hash -noout -in {pem}`.0".format(pem=pem, dir=certsPath)) + + def teardownServerSide(self, current, success): + # Nothing to do if we're not running this test with the C++ mapping + if not isinstance(self.getMapping(), CppMapping): + return + + certsPath = os.path.abspath(os.path.join(self.getPath(), "..", "certs")) + if isinstance(platform, Darwin): + os.system("rm -rf {0} {1}".format(os.path.join(certsPath, "keychain"), os.path.join(certsPath, "Find.keychain"))) + elif platform.hasOpenSSL(): + for c in ["cacert1.pem", "cacert2.pem"]: + pem = os.path.join(certsPath, c) + os.system("rm -f {dir}/`openssl x509 -subject_hash -noout -in {pem}`.0".format(pem=pem, dir=certsPath)) + +# Filter-out the deprecated property warnings +outfilters = [ lambda x: re.sub("-! .* warning: deprecated property: IceSSL.KeyFile\n", "", x) ] + +TestSuite(__name__, [ + ConfigurationTestCase(client=Client(outfilters=outfilters, args=['"{testdir}"']), + server=Server(outfilters=outfilters)) +], multihost=False) diff --git a/scripts/tests/__init__.py b/scripts/tests/__init__.py new file mode 100644 index 00000000000..90d182d1c05 --- /dev/null +++ b/scripts/tests/__init__.py @@ -0,0 +1,8 @@ +# ********************************************************************** +# +# 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. +# +# ********************************************************************** |