diff options
author | Mark Spruiell <mes@zeroc.com> | 2017-06-13 15:16:14 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2017-06-13 15:16:14 -0700 |
commit | 55152e4cb857f17260b59255b72de2d0caf45dee (patch) | |
tree | a1efae4ba3de87c97586209e0e2e833e64cc7e1d /python/test | |
parent | Fix for ICE-8044 - adapterDeactivation test failure caused by deadlock (diff) | |
download | ice-55152e4cb857f17260b59255b72de2d0caf45dee.tar.bz2 ice-55152e4cb857f17260b59255b72de2d0caf45dee.tar.xz ice-55152e4cb857f17260b59255b72de2d0caf45dee.zip |
C++ & python test fixes
Diffstat (limited to 'python/test')
-rwxr-xr-x | python/test/Ice/adapterDeactivation/Server.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/binding/Server.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/blobject/Server.py | 2 | ||||
-rw-r--r-- | python/test/Ice/exceptions/AllTests.py | 4 | ||||
-rwxr-xr-x | python/test/Ice/exceptions/Server.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/exceptions/ServerAMD.py | 2 | ||||
-rw-r--r-- | python/test/Ice/facets/AllTests.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/faultTolerance/Server.py | 2 | ||||
-rw-r--r-- | python/test/Ice/info/AllTests.py | 12 | ||||
-rw-r--r-- | python/test/Ice/location/AllTests.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/location/Server.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/operations/Server.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/operations/ServerAMD.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/optional/Server.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/optional/ServerAMD.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/proxy/Server.py | 2 | ||||
-rwxr-xr-x | python/test/Ice/proxy/ServerAMD.py | 2 | ||||
-rw-r--r-- | python/test/Ice/slicing/exceptions/AllTests.py | 160 | ||||
-rwxr-xr-x | python/test/Ice/timeout/Server.py | 2 | ||||
-rwxr-xr-x | python/test/Slice/escape/Client.py | 2 |
20 files changed, 107 insertions, 103 deletions
diff --git a/python/test/Ice/adapterDeactivation/Server.py b/python/test/Ice/adapterDeactivation/Server.py index 820022ddcb4..3c54857a08b 100755 --- a/python/test/Ice/adapterDeactivation/Server.py +++ b/python/test/Ice/adapterDeactivation/Server.py @@ -15,7 +15,7 @@ import Test, TestI class TestServer(Ice.Application): def run(self, args): - self.communicator().getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + self.communicator().getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = self.communicator().createObjectAdapter("TestAdapter") locator = TestI.ServantLocatorI() diff --git a/python/test/Ice/binding/Server.py b/python/test/Ice/binding/Server.py index ace8c09fbd5..d16f7e95129 100755 --- a/python/test/Ice/binding/Server.py +++ b/python/test/Ice/binding/Server.py @@ -15,7 +15,7 @@ Ice.loadSlice('Test.ice') import Test, TestI def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("TestAdapter") id = Ice.stringToIdentity("communicator") adapter.add(TestI.RemoteCommunicatorI(), id) diff --git a/python/test/Ice/blobject/Server.py b/python/test/Ice/blobject/Server.py index 09fb77c6286..35970d14be9 100755 --- a/python/test/Ice/blobject/Server.py +++ b/python/test/Ice/blobject/Server.py @@ -30,7 +30,7 @@ class TestI(Test.Hello): current.adapter.getCommunicator().shutdown() def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(TestI(), Ice.stringToIdentity("test")) adapter.activate() diff --git a/python/test/Ice/exceptions/AllTests.py b/python/test/Ice/exceptions/AllTests.py index 4fb500d88b4..701d832543d 100644 --- a/python/test/Ice/exceptions/AllTests.py +++ b/python/test/Ice/exceptions/AllTests.py @@ -215,7 +215,7 @@ class Callback(CallbackBase): def allTests(communicator): sys.stdout.write("testing servant registration exceptions... ") sys.stdout.flush() - communicator.getProperties().setProperty("TestAdapter1.Endpoints", "default") + communicator.getProperties().setProperty("TestAdapter1.Endpoints", "tcp -h *") adapter = communicator.createObjectAdapter("TestAdapter1") obj = EmptyI() adapter.add(obj, Ice.stringToIdentity("x")) @@ -249,7 +249,7 @@ def allTests(communicator): sys.stdout.write("testing servant locator registrations exceptions... ") sys.stdout.flush() - communicator.getProperties().setProperty("TestAdapter2.Endpoints", "default") + communicator.getProperties().setProperty("TestAdapter2.Endpoints", "tcp -h *") adapter = communicator.createObjectAdapter("TestAdapter2") loc = ServantLocatorI() adapter.addServantLocator(loc, "x") diff --git a/python/test/Ice/exceptions/Server.py b/python/test/Ice/exceptions/Server.py index 2afc4e427f5..bcc0113679e 100755 --- a/python/test/Ice/exceptions/Server.py +++ b/python/test/Ice/exceptions/Server.py @@ -38,7 +38,7 @@ try: initData.properties = Ice.createProperties(sys.argv) initData.properties.setProperty("Ice.Warn.Dispatch", "0") initData.properties.setProperty("Ice.Warn.Connections", "0"); - initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010") initData.properties.setProperty("Ice.MessageSizeMax", "10") initData.properties.setProperty("TestAdapter2.Endpoints", "default -p 12011") initData.properties.setProperty("TestAdapter2.MessageSizeMax", "0") diff --git a/python/test/Ice/exceptions/ServerAMD.py b/python/test/Ice/exceptions/ServerAMD.py index ea6b9a9832f..5b09172f58b 100755 --- a/python/test/Ice/exceptions/ServerAMD.py +++ b/python/test/Ice/exceptions/ServerAMD.py @@ -169,7 +169,7 @@ try: initData.properties = Ice.createProperties(sys.argv) initData.properties.setProperty("Ice.Warn.Dispatch", "0") initData.properties.setProperty("Ice.Warn.Connections", "0"); - initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010") initData.properties.setProperty("Ice.MessageSizeMax", "10") initData.properties.setProperty("TestAdapter2.Endpoints", "default -p 12011") initData.properties.setProperty("TestAdapter2.MessageSizeMax", "0") diff --git a/python/test/Ice/facets/AllTests.py b/python/test/Ice/facets/AllTests.py index d5e488e781f..3840b2cb990 100644 --- a/python/test/Ice/facets/AllTests.py +++ b/python/test/Ice/facets/AllTests.py @@ -42,7 +42,7 @@ def allTests(communicator): sys.stdout.write("testing facet registration exceptions... ") sys.stdout.flush() - communicator.getProperties().setProperty("FacetExceptionTestAdapter.Endpoints", "default") + communicator.getProperties().setProperty("FacetExceptionTestAdapter.Endpoints", "tcp -h *") adapter = communicator.createObjectAdapter("FacetExceptionTestAdapter") obj = EmptyI() adapter.add(obj, Ice.stringToIdentity("d")) diff --git a/python/test/Ice/faultTolerance/Server.py b/python/test/Ice/faultTolerance/Server.py index 684f9933802..d605afae783 100755 --- a/python/test/Ice/faultTolerance/Server.py +++ b/python/test/Ice/faultTolerance/Server.py @@ -50,7 +50,7 @@ def run(args, communicator): usage(args[0]) return False - endpts = "default -p " + str(port) + ":udp" + endpts = "default -p " + str(port) communicator.getProperties().setProperty("TestAdapter.Endpoints", endpts) adapter = communicator.createObjectAdapter("TestAdapter") object = TestI() diff --git a/python/test/Ice/info/AllTests.py b/python/test/Ice/info/AllTests.py index 43f9d24dc1d..6fead9352a9 100644 --- a/python/test/Ice/info/AllTests.py +++ b/python/test/Ice/info/AllTests.py @@ -72,12 +72,12 @@ def allTests(communicator): print("ok") - defaultHost = communicator.getProperties().getProperty("Ice.Default.Host") - sys.stdout.write("test object adapter endpoint information... ") sys.stdout.flush() - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -t 15000:udp") + host = "::1" if communicator.getProperties().getPropertyAsInt("Ice.IPv6") != 0 else "127.0.0.1" + communicator.getProperties().setProperty("TestAdapter.Endpoints", "tcp -h \"" + host + + "\" -t 15000:udp -h \"" + host + "\"") adapter = communicator.createObjectAdapter("TestAdapter") endpoints = adapter.getEndpoints() test(len(endpoints) == 2) @@ -87,12 +87,12 @@ def allTests(communicator): tcpEndpoint = getTCPEndpointInfo(endpoints[0].getInfo()) test(tcpEndpoint.type() == Ice.TCPEndpointType or tcpEndpoint.type() == 2 or tcpEndpoint.type() == 4 or tcpEndpoint.type() == 5) - test(tcpEndpoint.host == defaultHost) + test(tcpEndpoint.host == host) test(tcpEndpoint.port > 0) test(tcpEndpoint.timeout == 15000) udpEndpoint = endpoints[1].getInfo() - test(udpEndpoint.host == defaultHost) + test(udpEndpoint.host == host) test(udpEndpoint.datagram()) test(udpEndpoint.port > 0) @@ -132,6 +132,8 @@ def allTests(communicator): sys.stdout.write("test connection endpoint information... ") sys.stdout.flush() + defaultHost = communicator.getProperties().getProperty("Ice.Default.Host") + tcpinfo = getTCPEndpointInfo(base.ice_getConnection().getEndpoint().getInfo()) test(tcpinfo.port == 12010) test(not tcpinfo.compress) diff --git a/python/test/Ice/location/AllTests.py b/python/test/Ice/location/AllTests.py index 94baf21339e..cf111391f87 100644 --- a/python/test/Ice/location/AllTests.py +++ b/python/test/Ice/location/AllTests.py @@ -239,7 +239,7 @@ def allTests(communicator, ref): sys.stdout.flush() properties = communicator.getProperties() properties.setProperty("Ice.PrintAdapterReady", "0") - adapter = communicator.createObjectAdapterWithEndpoints("Hello", "default") + adapter = communicator.createObjectAdapterWithEndpoints("Hello", "tcp -h *") adapter.setLocator(locator) assert(adapter.getLocator() == locator) diff --git a/python/test/Ice/location/Server.py b/python/test/Ice/location/Server.py index b0451fe22f3..25fbd4696f9 100755 --- a/python/test/Ice/location/Server.py +++ b/python/test/Ice/location/Server.py @@ -162,7 +162,7 @@ def run(args, communicator, initData): # properties = communicator.getProperties() properties.setProperty("Ice.ThreadPool.Server.Size", "2") - properties.setProperty("ServerManager.Endpoints", "default -p 12010:udp") + properties.setProperty("ServerManager.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("ServerManager") diff --git a/python/test/Ice/operations/Server.py b/python/test/Ice/operations/Server.py index 5ec8816dc25..0966d26aa48 100755 --- a/python/test/Ice/operations/Server.py +++ b/python/test/Ice/operations/Server.py @@ -19,7 +19,7 @@ Ice.loadSlice('"-I' + slice_dir + '" Test.ice') import Test, TestI def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(TestI.MyDerivedClassI(), Ice.stringToIdentity("test")) adapter.activate() diff --git a/python/test/Ice/operations/ServerAMD.py b/python/test/Ice/operations/ServerAMD.py index 62edcc362c5..ed445fefdd0 100755 --- a/python/test/Ice/operations/ServerAMD.py +++ b/python/test/Ice/operations/ServerAMD.py @@ -29,7 +29,7 @@ Ice.loadSlice("'-I" + slice_dir + "' Test.ice") import Test def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(MyDerivedClassI(), Ice.stringToIdentity("test")) adapter.activate() diff --git a/python/test/Ice/optional/Server.py b/python/test/Ice/optional/Server.py index b1f3398cb56..1bbc86cc4c1 100755 --- a/python/test/Ice/optional/Server.py +++ b/python/test/Ice/optional/Server.py @@ -187,7 +187,7 @@ class InitialI(Test.Initial): return True def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("TestAdapter") initial = InitialI() adapter.add(initial, Ice.stringToIdentity("initial")) diff --git a/python/test/Ice/optional/ServerAMD.py b/python/test/Ice/optional/ServerAMD.py index 075a7c08101..b8128b426e1 100755 --- a/python/test/Ice/optional/ServerAMD.py +++ b/python/test/Ice/optional/ServerAMD.py @@ -193,7 +193,7 @@ class InitialI(Test.Initial): return Ice.Future.completed(True) def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("TestAdapter") initial = InitialI() adapter.add(initial, Ice.stringToIdentity("initial")) diff --git a/python/test/Ice/proxy/Server.py b/python/test/Ice/proxy/Server.py index 2c6d3ee8c2f..30b31562b03 100755 --- a/python/test/Ice/proxy/Server.py +++ b/python/test/Ice/proxy/Server.py @@ -20,7 +20,7 @@ Ice.loadSlice("'-I" + slice_dir + "' Test.ice") import Test, TestI def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(TestI.MyDerivedClassI(), Ice.stringToIdentity("test")) diff --git a/python/test/Ice/proxy/ServerAMD.py b/python/test/Ice/proxy/ServerAMD.py index 2f285d4fc8a..41cb8480313 100755 --- a/python/test/Ice/proxy/ServerAMD.py +++ b/python/test/Ice/proxy/ServerAMD.py @@ -37,7 +37,7 @@ class MyDerivedClassI(Test.MyDerivedClass): return Test.MyDerivedClass.ice_isA(self, s, current) def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(MyDerivedClassI(), Ice.stringToIdentity("test")) adapter.activate() diff --git a/python/test/Ice/slicing/exceptions/AllTests.py b/python/test/Ice/slicing/exceptions/AllTests.py index 1a56ee2b282..92602a5ce80 100644 --- a/python/test/Ice/slicing/exceptions/AllTests.py +++ b/python/test/Ice/slicing/exceptions/AllTests.py @@ -508,89 +508,91 @@ def allTests(communicator): test(False) print("ok") - sys.stdout.write("preserved exceptions... ") - sys.stdout.flush() - adapter = communicator.createObjectAdapterWithEndpoints("Relay", "default") - relay = Test.RelayPrx.uncheckedCast(adapter.addWithUUID(RelayI())) - adapter.activate() + defaultHost = communicator.getProperties().getProperty("Ice.Default.Host") + if defaultHost == "127.0.0.1" or defaultHost == "::1": + sys.stdout.write("preserved exceptions... ") + sys.stdout.flush() + adapter = communicator.createObjectAdapterWithEndpoints("Relay", "default") + relay = Test.RelayPrx.uncheckedCast(adapter.addWithUUID(RelayI())) + adapter.activate() - try: - t.relayKnownPreservedAsBase(relay) - test(False) - except Test.KnownPreservedDerived as ex: - test(ex.b == "base") - test(ex.kp == "preserved") - test(ex.kpd == "derived") - except Ice.OperationNotExistException: - pass - except: - test(False) + try: + t.relayKnownPreservedAsBase(relay) + test(False) + except Test.KnownPreservedDerived as ex: + test(ex.b == "base") + test(ex.kp == "preserved") + test(ex.kpd == "derived") + except Ice.OperationNotExistException: + pass + except: + test(False) - try: - t.relayKnownPreservedAsKnownPreserved(relay) - test(False) - except Test.KnownPreservedDerived as ex: - test(ex.b == "base") - test(ex.kp == "preserved") - test(ex.kpd == "derived") - except Ice.OperationNotExistException: - pass - except: - test(False) + try: + t.relayKnownPreservedAsKnownPreserved(relay) + test(False) + except Test.KnownPreservedDerived as ex: + test(ex.b == "base") + test(ex.kp == "preserved") + test(ex.kpd == "derived") + except Ice.OperationNotExistException: + pass + except: + test(False) - try: - t.relayUnknownPreservedAsBase(relay) - test(False) - except Test.Preserved2 as ex: - test(ex.b == "base") - test(ex.kp == "preserved") - test(ex.kpd == "derived") - test(ex.p1.ice_id() == Test.PreservedClass.ice_staticId()) - pc = ex.p1 - test(isinstance(pc, Test.PreservedClass)) - test(pc.bc == "bc") - test(pc.pc == "pc") - test(ex.p2 == ex.p1) - except Test.KnownPreservedDerived as ex: - # - # For the 1.0 encoding, the unknown exception is sliced to KnownPreserved. - # - test(t.ice_getEncodingVersion() == Ice.Encoding_1_0) - test(ex.b == "base") - test(ex.kp == "preserved") - test(ex.kpd == "derived") - except Ice.OperationNotExistException: - pass - except: - test(False) + try: + t.relayUnknownPreservedAsBase(relay) + test(False) + except Test.Preserved2 as ex: + test(ex.b == "base") + test(ex.kp == "preserved") + test(ex.kpd == "derived") + test(ex.p1.ice_id() == Test.PreservedClass.ice_staticId()) + pc = ex.p1 + test(isinstance(pc, Test.PreservedClass)) + test(pc.bc == "bc") + test(pc.pc == "pc") + test(ex.p2 == ex.p1) + except Test.KnownPreservedDerived as ex: + # + # For the 1.0 encoding, the unknown exception is sliced to KnownPreserved. + # + test(t.ice_getEncodingVersion() == Ice.Encoding_1_0) + test(ex.b == "base") + test(ex.kp == "preserved") + test(ex.kpd == "derived") + except Ice.OperationNotExistException: + pass + except: + test(False) - try: - t.relayUnknownPreservedAsKnownPreserved(relay) - test(False) - except Test.Preserved2 as ex: - test(ex.b == "base") - test(ex.kp == "preserved") - test(ex.kpd == "derived") - test(ex.p1.ice_id() == Test.PreservedClass.ice_staticId()) - pc = ex.p1 - test(isinstance(pc, Test.PreservedClass)) - test(pc.bc == "bc") - test(pc.pc == "pc") - test(ex.p2 == ex.p1) - except Test.KnownPreservedDerived as ex: - # - # For the 1.0 encoding, the unknown exception is sliced to KnownPreserved. - # - test(t.ice_getEncodingVersion() == Ice.Encoding_1_0) - test(ex.b == "base") - test(ex.kp == "preserved") - test(ex.kpd == "derived") - except Ice.OperationNotExistException: - pass - except: - test(False) + try: + t.relayUnknownPreservedAsKnownPreserved(relay) + test(False) + except Test.Preserved2 as ex: + test(ex.b == "base") + test(ex.kp == "preserved") + test(ex.kpd == "derived") + test(ex.p1.ice_id() == Test.PreservedClass.ice_staticId()) + pc = ex.p1 + test(isinstance(pc, Test.PreservedClass)) + test(pc.bc == "bc") + test(pc.pc == "pc") + test(ex.p2 == ex.p1) + except Test.KnownPreservedDerived as ex: + # + # For the 1.0 encoding, the unknown exception is sliced to KnownPreserved. + # + test(t.ice_getEncodingVersion() == Ice.Encoding_1_0) + test(ex.b == "base") + test(ex.kp == "preserved") + test(ex.kpd == "derived") + except Ice.OperationNotExistException: + pass + except: + test(False) - adapter.destroy() - print("ok") + adapter.destroy() + print("ok") return t diff --git a/python/test/Ice/timeout/Server.py b/python/test/Ice/timeout/Server.py index 28dd620eac5..cde7d51ee98 100755 --- a/python/test/Ice/timeout/Server.py +++ b/python/test/Ice/timeout/Server.py @@ -49,7 +49,7 @@ class TimeoutI(Test.Timeout): current.adapter.getCommunicator().shutdown() def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(TimeoutI(), Ice.stringToIdentity("timeout")) adapter.activate() diff --git a/python/test/Slice/escape/Client.py b/python/test/Slice/escape/Client.py index 1946d09fc94..dbbdf199c26 100755 --- a/python/test/Slice/escape/Client.py +++ b/python/test/Slice/escape/Client.py @@ -75,7 +75,7 @@ def testtypes(): print("ok") def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(execI(), Ice.stringToIdentity("test")) adapter.activate() |