You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2017/12/21 20:02:17 UTC

qpid-dispatch git commit: DISPATCH-894 - Made the following changes to make the system tests work on CentOS 6. 1. Modified system tests to use unittest2 instead of unittest test framework. 2. Modified tests/CMakeLists.txt to use the unit2 test runner. 3.

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master ac9c414f2 -> 4a173e1ec


DISPATCH-894 - Made the following changes to make the system tests work on CentOS 6.
1. Modified system tests to use unittest2 instead of unittest test framework.
2. Modified tests/CMakeLists.txt to use the unit2 test runner.
3. Fixed some tests to use backwards compatible assert functions.
4. Remove unused imports in tests


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/4a173e1e
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/4a173e1e
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/4a173e1e

Branch: refs/heads/master
Commit: 4a173e1ec0f7e0e8f9d7d37b9549d4f9c9d37fb0
Parents: ac9c414
Author: Ganesh Murthy <gm...@redhat.com>
Authored: Wed Dec 6 10:08:24 2017 -0500
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Thu Dec 21 14:11:29 2017 -0500

----------------------------------------------------------------------
 .travis.yml                                     |  2 +
 README                                          |  1 +
 tests/CMakeLists.txt                            |  8 ++--
 tests/router_engine_test.py                     |  2 +-
 tests/router_policy_test.py                     |  3 +-
 tests/run_system_tests.py                       |  2 +-
 tests/system_tests_auth_service_plugin.py       |  9 +++--
 tests/system_tests_autolinks.py                 |  6 +--
 tests/system_tests_broker.py                    |  5 ++-
 tests/system_tests_default_distribution.py      | 10 +++--
 tests/system_tests_delivery_abort.py            |  9 ++---
 .../system_tests_denied_unsettled_multicast.py  |  9 ++---
 tests/system_tests_distribution.py              | 19 ++--------
 tests/system_tests_drain.py                     |  5 ++-
 tests/system_tests_drain_support.py             |  6 ++-
 tests/system_tests_dynamic_terminus.py          |  9 ++---
 tests/system_tests_failover_list.py             | 15 ++------
 tests/system_tests_handle_failover.py           | 15 ++++++--
 tests/system_tests_http.py                      |  7 +++-
 tests/system_tests_link_routes.py               |  7 ++--
 tests/system_tests_log_message_components.py    |  5 +++
 tests/system_tests_management.py                | 40 ++++++++++----------
 tests/system_tests_multi_tenancy.py             |  7 ++--
 tests/system_tests_one_router.py                |  3 +-
 tests/system_tests_policy.py                    |  5 ++-
 tests/system_tests_protocol_family.py           |  4 +-
 tests/system_tests_protocol_settings.py         | 24 ++++++++----
 tests/system_tests_qdmanage.py                  |  4 +-
 tests/system_tests_qdstat.py                    |  4 +-
 tests/system_tests_sasl_plain.py                |  9 +++--
 tests/system_tests_topology.py                  | 20 +++-------
 tests/system_tests_two_routers.py               | 11 +++---
 tests/system_tests_user_id.py                   |  5 ++-
 tests/system_tests_user_id_proxy.py             |  6 +--
 34 files changed, 158 insertions(+), 138 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index a246b5f..c7cc08a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,6 +39,8 @@ addons:
     # documentation
     - asciidoc
     - dblatex
+    # unit test requirement
+    - python-unittest2
 
 install:
 - PREFIX=$PWD/install

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/README
----------------------------------------------------------------------
diff --git a/README b/README
index bbb8de2..22ad2ce 100644
--- a/README
+++ b/README
@@ -19,6 +19,7 @@ packages installed:
 - cyrus-sasl-plain
 - cyrus-sasl-devel
 - asciidoc (for building docs)
+- python-unittest2 (python2-unittest2 on Fedora) (we use unittest2 for running python tests)
 
 Dispatch will not build on Windows.
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index bdff4e4..a8aedd2 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -66,9 +66,9 @@ add_test(unit_tests_size_1     ${TEST_WRAP} -x unit_tests_size 1)
 add_test(unit_tests            ${TEST_WRAP} -x unit_tests ${CMAKE_CURRENT_SOURCE_DIR}/threads4.conf)
 
 # Unit test python modules
-add_test(router_engine_test    ${TEST_WRAP} -m unittest -v router_engine_test)
-add_test(management_test       ${TEST_WRAP} -m unittest -v management)
-add_test(router_policy_test    ${TEST_WRAP} -m unittest -v router_policy_test)
+add_test(router_engine_test    ${TEST_WRAP} -x unit2 -v router_engine_test)
+add_test(management_test       ${TEST_WRAP} -x unit2 -v management)
+add_test(router_policy_test    ${TEST_WRAP} -x unit2 -v router_policy_test)
 
 if(USE_LIBWEBSOCKETS)
   set(SYSTEM_TESTS_HTTP system_tests_http)
@@ -105,7 +105,7 @@ foreach(py_test_module
     ${SYSTEM_TESTS_HTTP}
     )
 
-  add_test(${py_test_module} ${TEST_WRAP} -m unittest -v ${py_test_module})
+  add_test(${py_test_module} ${TEST_WRAP} -x unit2 -v ${py_test_module})
   list(APPEND SYSTEM_TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${py_test_module}.py)
 endforeach()
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/router_engine_test.py
----------------------------------------------------------------------
diff --git a/tests/router_engine_test.py b/tests/router_engine_test.py
index 174365c..aef261d 100644
--- a/tests/router_engine_test.py
+++ b/tests/router_engine_test.py
@@ -19,7 +19,7 @@
 
 import os
 import sys
-import unittest
+import unittest2 as unittest
 import mock                     # Mock definitions for tests.
 
 sys.path.append(os.path.join(os.environ["SOURCE_DIR"], "python"))

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/router_policy_test.py
----------------------------------------------------------------------
diff --git a/tests/router_policy_test.py b/tests/router_policy_test.py
index 326f71e..27ad56e 100644
--- a/tests/router_policy_test.py
+++ b/tests/router_policy_test.py
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-import unittest
+import unittest2 as unittest
 
 from qpid_dispatch_internal.policy.policy_util import HostAddr, is_ipv6_enabled
 from qpid_dispatch_internal.policy.policy_util import HostStruct
@@ -316,5 +316,6 @@ class PolicyAppConnectionMgrTests(TestCase):
         self.assertTrue(stats.connections_approved == 10000)
         self.assertTrue(stats.connections_denied == 1)
 
+
 if __name__ == '__main__':
     unittest.main(main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/run_system_tests.py
----------------------------------------------------------------------
diff --git a/tests/run_system_tests.py b/tests/run_system_tests.py
index a9b3232..460692f 100644
--- a/tests/run_system_tests.py
+++ b/tests/run_system_tests.py
@@ -28,7 +28,7 @@ the standard system places. Use run.py or config.sh to run against dispatch buil
 import os
 import sys
 from fnmatch import fnmatch
-import unittest
+import unittest2 as unittest
 import system_test
 
 # Collect all system_tests_*.py scripts in the same directory as this script.

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_auth_service_plugin.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_auth_service_plugin.py b/tests/system_tests_auth_service_plugin.py
index 2c03ac5..b1a8e32 100644
--- a/tests/system_tests_auth_service_plugin.py
+++ b/tests/system_tests_auth_service_plugin.py
@@ -17,13 +17,15 @@
 # under the License.
 #
 
-import unittest, os, json
-from subprocess import PIPE, Popen, STDOUT
-from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, Process
+import unittest2 as unittest
+import os
+from subprocess import PIPE, Popen
+from system_test import TestCase, Qdrouterd, main_module
 from proton import SASL
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
 
+
 class AuthServicePluginTest(TestCase):
     @classmethod
     def createSaslFiles(cls):
@@ -135,6 +137,7 @@ class SimpleConnect(MessagingHandler):
     def run(self):
         Container(self).run()
 
+
 if __name__ == '__main__':
     unittest.main(main_module())
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_autolinks.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_autolinks.py b/tests/system_tests_autolinks.py
index 1776e93..a8e1d5c 100644
--- a/tests/system_tests_autolinks.py
+++ b/tests/system_tests_autolinks.py
@@ -17,11 +17,11 @@
 # under the License.
 #
 
-import unittest
-from proton import Message, Delivery, PENDING, ACCEPTED, REJECTED
+import unittest2 as unittest
+from proton import Message
 from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
 from proton.handlers import MessagingHandler
-from proton.reactor import Container, AtMostOnce, AtLeastOnce
+from proton.reactor import Container
 
 CONNECTION_PROPERTIES = {u'connection': u'properties', u'int_property': 6451}
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_broker.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_broker.py b/tests/system_tests_broker.py
index 98a164a..3832bf0 100644
--- a/tests/system_tests_broker.py
+++ b/tests/system_tests_broker.py
@@ -21,10 +21,12 @@
 System tests involving one or more brokers and dispatch routers integrated
 with waypoints.
 """
-import unittest, system_test
+import unittest2 as unittest
+import system_test
 from system_test import Qdrouterd, message, MISSING_REQUIREMENTS
 from itertools import cycle
 
+
 class DistributedQueueTest(system_test.TestCase): # pylint: disable=too-many-public-methods
     """System tests involving routers and qpidd brokers"""
 
@@ -101,5 +103,6 @@ class DistributedQueueTest(system_test.TestCase): # pylint: disable=too-many-pub
             addrs = [r.addresses[0]+"/"+self.testq for r in routers]
             self.verify_equal_spread(addrs, addrs)
 
+
 if __name__ == '__main__':
     unittest.main(system_test.main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_default_distribution.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_default_distribution.py b/tests/system_tests_default_distribution.py
index 90adbd2..6d66996 100644
--- a/tests/system_tests_default_distribution.py
+++ b/tests/system_tests_default_distribution.py
@@ -17,14 +17,15 @@
 # under the License.
 #
 
+import unittest2 as unittest
 import re
-import system_test
 from subprocess import PIPE
-from system_test import TestCase, Qdrouterd, TIMEOUT
+from system_test import TestCase, Qdrouterd, TIMEOUT, main_module
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
 from proton import Message
 
+
 class DefaultDistributionTest(TestCase):
     """System tests for testing the defaultDistribution attribute of the router entity"""
     @classmethod
@@ -46,7 +47,7 @@ class DefaultDistributionTest(TestCase):
 
     def run_qdstat(self, args, regexp=None, address=None):
         p = self.popen(
-            ['qdstat', '--bus', str(address or self.address), '--timeout', str(system_test.TIMEOUT) ] + args,
+            ['qdstat', '--bus', str(address or self.address), '--timeout', str(TIMEOUT) ] + args,
             name='qdstat-'+self.id(), stdout=PIPE, expect=None)
 
         out = p.communicate()[0]
@@ -184,3 +185,6 @@ class UnavailableAnonymousSender(MessagingHandler):
     def run(self):
         Container(self).run()
 
+
+if __name__ == '__main__':
+    unittest.main(main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_delivery_abort.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_delivery_abort.py b/tests/system_tests_delivery_abort.py
index dcf763a..30c7a13 100644
--- a/tests/system_tests_delivery_abort.py
+++ b/tests/system_tests_delivery_abort.py
@@ -17,12 +17,11 @@
 # under the License.
 #
 
-import unittest, os, json
-from subprocess import PIPE, STDOUT
-from proton import Message, PENDING, ACCEPTED, REJECTED, RELEASED, SSLDomain, SSLUnavailable, Timeout
-from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, Process
+import unittest2 as unittest
+from proton import Message, Timeout
+from system_test import TestCase, Qdrouterd, main_module
 from proton.handlers import MessagingHandler
-from proton.reactor import Container, DynamicNodeProperties
+from proton.reactor import Container
 
 # PROTON-828:
 try:

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_denied_unsettled_multicast.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_denied_unsettled_multicast.py b/tests/system_tests_denied_unsettled_multicast.py
index b139733..bc85084 100644
--- a/tests/system_tests_denied_unsettled_multicast.py
+++ b/tests/system_tests_denied_unsettled_multicast.py
@@ -17,12 +17,11 @@
 # under the License.
 #
 
-import unittest, os, json
-from subprocess import PIPE, STDOUT
-from proton import Message, PENDING, ACCEPTED, REJECTED, RELEASED, SSLDomain, SSLUnavailable, Timeout
-from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, Process
+import unittest2 as unittest
+from proton import Message, Timeout
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
 from proton.handlers import MessagingHandler
-from proton.reactor import Container, DynamicNodeProperties
+from proton.reactor import Container
 
 # PROTON-828:
 try:

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_distribution.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_distribution.py b/tests/system_tests_distribution.py
index 0156afc..ed5307e 100644
--- a/tests/system_tests_distribution.py
+++ b/tests/system_tests_distribution.py
@@ -17,19 +17,11 @@
 # under the License.
 #
 
-import unittest, os, json
-from subprocess      import PIPE, STDOUT
-from proton          import Message, PENDING, ACCEPTED, REJECTED, RELEASED, SSLDomain, SSLUnavailable, Timeout
-from system_test     import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, Process
+import unittest2 as unittest
+from proton          import Message, Timeout
+from system_test     import TestCase, Qdrouterd, main_module, TIMEOUT
 from proton.handlers import MessagingHandler
-from proton.reactor  import Container, AtMostOnce, AtLeastOnce, DynamicNodeProperties, LinkOption, ApplicationEvent, EventInjector
-from proton.utils    import BlockingConnection
-from qpid_dispatch.management.client import Node
-
-import time
-import datetime
-
-
+from proton.reactor  import Container, LinkOption, ApplicationEvent, EventInjector
 
 # PROTON-828:
 try:
@@ -4201,8 +4193,5 @@ class ParallelWaypointTest ( MessagingHandler ):
         container.run()
 
 
-
-
-
 if __name__ == '__main__':
     unittest.main(main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_drain.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_drain.py b/tests/system_tests_drain.py
index b379d27..b2ecadb 100644
--- a/tests/system_tests_drain.py
+++ b/tests/system_tests_drain.py
@@ -17,12 +17,12 @@
 # under the License.
 #
 
-import unittest
-
+import unittest2 as unittest
 from system_test import TestCase, Qdrouterd, main_module
 from system_tests_drain_support import DrainMessagesHandler, DrainOneMessageHandler
 from system_tests_drain_support import DrainNoMessagesHandler, DrainNoMoreMessagesHandler
 
+
 class DrainSupportTest(TestCase):
 
     @classmethod
@@ -62,5 +62,6 @@ class DrainSupportTest(TestCase):
         drain_support.run()
         self.assertEqual(drain_support.error, None)
 
+
 if __name__ == '__main__':
     unittest.main(main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_drain_support.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_drain_support.py b/tests/system_tests_drain_support.py
index 661cf20..2600ec0 100644
--- a/tests/system_tests_drain_support.py
+++ b/tests/system_tests_drain_support.py
@@ -17,10 +17,11 @@
 # under the License.
 #
 
+import unittest2 as unittest
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
 from proton import Message, Endpoint
-from system_test import TIMEOUT
+from system_test import main_module, TIMEOUT
 
 class Timeout(object):
     def __init__(self, parent):
@@ -205,3 +206,6 @@ class DrainNoMoreMessagesHandler(MessagingHandler):
     def run(self):
         Container(self).run()
 
+
+if __name__ == '__main__':
+    unittest.main(main_module())
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_dynamic_terminus.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_dynamic_terminus.py b/tests/system_tests_dynamic_terminus.py
index bd43cf3..f00c478 100644
--- a/tests/system_tests_dynamic_terminus.py
+++ b/tests/system_tests_dynamic_terminus.py
@@ -17,12 +17,11 @@
 # under the License.
 #
 
-import unittest, os, json
-from subprocess import PIPE, STDOUT
-from proton import Message, PENDING, ACCEPTED, REJECTED, RELEASED, SSLDomain, SSLUnavailable, Timeout
-from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, Process
+import unittest2 as unittest
+from proton import Message, Timeout
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
 from proton.handlers import MessagingHandler
-from proton.reactor import Container, DynamicNodeProperties, LinkOption
+from proton.reactor import Container, LinkOption
 
 # PROTON-828:
 try:

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_failover_list.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_failover_list.py b/tests/system_tests_failover_list.py
index af76835..b62faef 100644
--- a/tests/system_tests_failover_list.py
+++ b/tests/system_tests_failover_list.py
@@ -17,12 +17,11 @@
 # under the License.
 #
 
-import unittest, os, json
-from subprocess import PIPE, STDOUT
-from proton import Message, PENDING, ACCEPTED, REJECTED, RELEASED, SSLDomain, SSLUnavailable, Timeout
-from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, Process
+import unittest2 as unittest
+from proton import Timeout
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
 from proton.handlers import MessagingHandler
-from proton.reactor import Container, DynamicNodeProperties
+from proton.reactor import Container
 
 # PROTON-828:
 try:
@@ -33,8 +32,6 @@ except ImportError:
 
 class RouterTest(TestCase):
 
-    inter_router_port = None
-
     @classmethod
     def setUpClass(cls):
         """Start a router"""
@@ -55,12 +52,9 @@ class RouterTest(TestCase):
 
         cls.routers = []
 
-        inter_router_port = cls.tester.get_port()
-
         router('A')
         cls.routers[0].wait_ready()
 
-
     def test_01_no_failover_list(self):
         test = FailoverTest(self.routers[0].addresses[0], 0)
         test.run()
@@ -130,7 +124,6 @@ class FailoverTest(MessagingHandler):
         self.timer.cancel()
         self.conn.close()
 
-
     def run(self):
         Container(self).run()
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_handle_failover.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_handle_failover.py b/tests/system_tests_handle_failover.py
index 0204a48..eb8663e 100644
--- a/tests/system_tests_handle_failover.py
+++ b/tests/system_tests_handle_failover.py
@@ -17,9 +17,10 @@
 # under the License.
 #
 
+import unittest2 as unittest
 import json, re
 from time import sleep
-import system_test
+from system_test import main_module, TIMEOUT
 from system_test import TestCase, Qdrouterd, Process, TIMEOUT
 from subprocess import PIPE, STDOUT
 
@@ -95,7 +96,7 @@ class FailoverTest(TestCase):
 
     def run_qdstat(self, args, regexp=None, address=None):
         p = self.popen(
-            ['qdstat', '--bus', str(address or self.router.addresses[0]), '--timeout', str(system_test.TIMEOUT) ] + args,
+            ['qdstat', '--bus', str(address or self.router.addresses[0]), '--timeout', str(TIMEOUT) ] + args,
             name='qdstat-'+self.id(), stdout=PIPE, expect=None)
 
         out = p.communicate()[0]
@@ -118,7 +119,9 @@ class FailoverTest(TestCase):
     def test_remove_router_B(self):
         # First make sure there are no inter-router connections on router C
         outs = self.run_qdstat(['--connections'], address=self.routers[2].addresses[1])
-        self.assertNotIn('inter-router', outs)
+
+        inter_router = 'inter-router' in outs
+        self.assertFalse(inter_router)
 
         # Kill the router B
         FailoverTest.routers[0].teardown()
@@ -133,8 +136,12 @@ class FailoverTest(TestCase):
         output = json.loads(self.run_qdmanage(query_command, address=self.routers[1].addresses[0]))
         # The failoverList must now be gone since the backup router does not send a failoverList in its
         # connection properties.
-        self.assertIsNone(output[0].get('failoverList'))
+        self.assertTrue(output[0].get('failoverList') == None)
 
         # Since router B has been killed, router A should now try to connect to a listener on router C.
         # Use qdstat to connect to router C and determine that there is an inter-router connection with router A.
         self.run_qdstat(['--connections'], regexp=r'QDR.A.*inter-router.*', address=self.routers[2].addresses[1])
+
+
+if __name__ == '__main__':
+    unittest.main(main_module())
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_http.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_http.py b/tests/system_tests_http.py
index adfbd54..7fc8a23 100644
--- a/tests/system_tests_http.py
+++ b/tests/system_tests_http.py
@@ -17,9 +17,11 @@
 # under the License.
 #
 
-import unittest, os, json, threading, sys, ssl, urllib2
+import unittest2 as unittest
+import os, threading, sys, urllib2
 import ssl
-from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, Process
+from system_test import TestCase, Qdrouterd, main_module, DIR
+
 
 class RouterTestHttp(TestCase):
 
@@ -132,5 +134,6 @@ class RouterTestHttp(TestCase):
         # Provide client cert
         self.assert_get_cert("https://localhost:%d" % r.ports[2])
 
+
 if __name__ == '__main__':
     unittest.main(main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_link_routes.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_link_routes.py b/tests/system_tests_link_routes.py
index 0cdc22b..afee3a5 100644
--- a/tests/system_tests_link_routes.py
+++ b/tests/system_tests_link_routes.py
@@ -17,17 +17,16 @@
 # under the License.
 #
 
-import unittest
+import unittest2 as unittest
 from time import sleep, time
 from subprocess import PIPE, STDOUT
 
 from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, Process
 
-from proton import Message, Endpoint
+from proton import Message
 from proton.handlers import MessagingHandler
 from proton.reactor import AtMostOnce, Container, DynamicNodeProperties, LinkOption
-from proton.utils import BlockingConnection, LinkDetached
-
+from proton.utils import BlockingConnection
 from system_tests_drain_support import DrainMessagesHandler, DrainOneMessageHandler, DrainNoMessagesHandler, DrainNoMoreMessagesHandler
 
 from qpid_dispatch.management.client import Node

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_log_message_components.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_log_message_components.py b/tests/system_tests_log_message_components.py
index bba36f4..e6b674e 100644
--- a/tests/system_tests_log_message_components.py
+++ b/tests/system_tests_log_message_components.py
@@ -17,6 +17,7 @@
 # under the License.
 #
 
+import unittest2 as unittest
 import json
 from proton import Message, symbol
 from system_test import TestCase, Qdrouterd, Process, TIMEOUT
@@ -203,3 +204,7 @@ class LogMessageTest(MessagingHandler):
 
     def run(self):
         Container(self).run()
+
+
+if __name__ == '__main__':
+    unittest.main(main_module())
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_management.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_management.py b/tests/system_tests_management.py
index 0bd865d..f5e915d 100644
--- a/tests/system_tests_management.py
+++ b/tests/system_tests_management.py
@@ -1,25 +1,26 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one
-## or more contributor license agreements.  See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership.  The ASF licenses this file
-## to you under the Apache License, Version 2.0 (the
-## "License"); you may not use this file except in compliance
-## with the License.  You may obtain a copy of the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing,
-## software distributed under the License is distributed on an
-## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-## KIND, either express or implied.  See the License for the
-## specific language governing permissions and limitations
-## under the License
-##
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License
+#
 
 """System tests for management of qdrouter"""
 
-import unittest, system_test, re, os, json, sys
+import unittest2 as unittest
+import system_test, re, os, json, sys
 from qpid_dispatch.management.client import Node, ManagementError, Url, BadRequestStatus, NotImplementedStatus, NotFoundStatus
 from qpid_dispatch_internal.management.qdrouter import QdSchema
 from qpid_dispatch_internal.compat import dictify
@@ -464,5 +465,6 @@ class ManagementTest(system_test.TestCase):
         got = self.node.call(self.node.request(operation="GET-SCHEMA", identity="self")).body
         self.assertEquals(schema, got)
 
+
 if __name__ == '__main__':
     unittest.main(system_test.main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_multi_tenancy.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_multi_tenancy.py b/tests/system_tests_multi_tenancy.py
index 3e4a16d..a555f81 100644
--- a/tests/system_tests_multi_tenancy.py
+++ b/tests/system_tests_multi_tenancy.py
@@ -17,10 +17,9 @@
 # under the License.
 #
 
-import unittest, os, json
-from subprocess import PIPE, STDOUT
-from proton import Message, PENDING, ACCEPTED, REJECTED, RELEASED, SSLDomain, SSLUnavailable, Timeout
-from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, Process
+import unittest2 as unittest
+from proton import Message, Timeout
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
 from proton.handlers import MessagingHandler
 from proton.reactor import Container, DynamicNodeProperties
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_one_router.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_one_router.py b/tests/system_tests_one_router.py
index b59ebd2..6a37e79 100644
--- a/tests/system_tests_one_router.py
+++ b/tests/system_tests_one_router.py
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-import unittest
+import unittest2 as unittest
 from proton import Condition, Message, Delivery, PENDING, ACCEPTED, REJECTED, Url, symbol
 from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
 from proton.handlers import MessagingHandler, TransactionHandler
@@ -1897,5 +1897,6 @@ class RejectDispositionTest(MessagingHandler):
     def run(self):
         Container(self).run()
 
+
 if __name__ == '__main__':
     unittest.main(main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_policy.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_policy.py b/tests/system_tests_policy.py
index 120137d..8d9e81f 100644
--- a/tests/system_tests_policy.py
+++ b/tests/system_tests_policy.py
@@ -17,8 +17,8 @@
 # under the License.
 #
 
-import unittest, json
-import os
+import unittest as unittest
+import os, json
 from system_test import TestCase, Qdrouterd, main_module, Process, TIMEOUT, DIR
 from subprocess import PIPE, STDOUT
 from proton import ConnectionException
@@ -301,5 +301,6 @@ class SenderReceiverLimits(TestCase):
 
         bs1.close()
 
+
 if __name__ == '__main__':
     unittest.main(main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_protocol_family.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_protocol_family.py b/tests/system_tests_protocol_family.py
index f5990fd..512061c 100644
--- a/tests/system_tests_protocol_family.py
+++ b/tests/system_tests_protocol_family.py
@@ -17,8 +17,7 @@
 # under the License.
 #
 
-import unittest
-from time import sleep
+import unittest2 as unittest
 from proton import Message
 from system_test import TestCase, Qdrouterd, main_module
 from qpid_dispatch_internal.policy.policy_util import is_ipv6_enabled
@@ -139,5 +138,6 @@ class ProtocolFamilyTest(TestCase):
         M1.stop()
         M2.stop()
 
+
 if __name__ == '__main__':
     unittest.main(main_module())
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_protocol_settings.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_protocol_settings.py b/tests/system_tests_protocol_settings.py
index 9cc0529..1b7aa33 100644
--- a/tests/system_tests_protocol_settings.py
+++ b/tests/system_tests_protocol_settings.py
@@ -17,14 +17,18 @@
 # under the License.
 #
 
-import unittest
-from proton import Message, Delivery, PENDING, ACCEPTED, REJECTED
+import unittest2 as unittest
 from system_test import TestCase, Qdrouterd, main_module
-from proton.handlers import MessagingHandler
-from proton.reactor import Container, AtMostOnce, AtLeastOnce
-from proton.utils import BlockingConnection, SyncRequestResponse
-from qpid_dispatch.management.client import Node
-from proton import ConnectionException
+from proton.utils import BlockingConnection
+import subprocess
+X86_64_ARCH = "x86_64"
+skip_test = True
+
+# Dont skip tests on 64 bit architectures.
+p = subprocess.Popen("uname -m", shell=True, stdout=subprocess.PIPE)
+if X86_64_ARCH in p.communicate()[0]:
+    skip_test = False
+
 
 class MaxFrameMaxSessionFramesTest(TestCase):
     """System tests setting proton negotiated size max-frame-size and incoming-window"""
@@ -223,6 +227,8 @@ class MaxSessionFramesDefaultTest(TestCase):
 
     def test_max_session_frames_default(self):
         # Set up a connection to get the Open and a receiver to get a Begin frame in the log
+        if skip_test:
+            return self.skipTest("Test skipped on non-64 bit architectures")
         bc = BlockingConnection(self.router.addresses[0])
         bc.create_receiver("xxx")
         bc.close()
@@ -259,6 +265,8 @@ class MaxFrameMaxSessionFramesZeroTest(TestCase):
 
     def test_max_frame_max_session_zero(self):
         # Set up a connection to get the Open and a receiver to get a Begin frame in the log
+        if skip_test:
+            return self.skipTest("Test disabled on non-64 bit architectures")
         bc = BlockingConnection(self.router.addresses[0])
         bc.create_receiver("xxx")
         bc.close()
@@ -316,6 +324,8 @@ class ConnectorSettingsDefaultTest(TestCase):
         cls.routers[1].wait_router_connected('QDR.A')
 
     def test_connector_default(self):
+        if skip_test:
+            return self.skipTest("Test disabled on non-64 bit architectures")
         with  open('../setUpClass/A.log', 'r') as router_log:
             log_lines = router_log.read().split("\n")
             open_lines = [s for s in log_lines if "<- @open" in s]

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_qdmanage.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_qdmanage.py b/tests/system_tests_qdmanage.py
index 86f1fd6..d2ac364 100644
--- a/tests/system_tests_qdmanage.py
+++ b/tests/system_tests_qdmanage.py
@@ -17,9 +17,9 @@
 # under the License
 #
 
-import json, unittest, os
+import json, unittest2 as unittest, os
 
-from system_test import TestCase, Process, Qdrouterd, main_module, TIMEOUT, DIR, wait_port
+from system_test import TestCase, Process, Qdrouterd, main_module, TIMEOUT, DIR
 from subprocess import PIPE, STDOUT
 from qpid_dispatch_internal.compat import dictify
 from qpid_dispatch_internal.management.qdrouter import QdSchema

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_qdstat.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_qdstat.py b/tests/system_tests_qdstat.py
index ca1d6b6..84000da 100644
--- a/tests/system_tests_qdstat.py
+++ b/tests/system_tests_qdstat.py
@@ -23,6 +23,8 @@ import system_test
 import unittest
 from subprocess import PIPE
 from proton import Url, SSLDomain, SSLUnavailable, SASL
+from system_test import main_module
+
 
 class QdstatTest(system_test.TestCase):
     """Test qdstat tool output"""
@@ -358,4 +360,4 @@ except SSLUnavailable:
 
 
 if __name__ == '__main__':
-    unittest.main(system_test.main_module())
+    unittest.main(main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_sasl_plain.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_sasl_plain.py b/tests/system_tests_sasl_plain.py
index 766a0a8..4e03da8 100644
--- a/tests/system_tests_sasl_plain.py
+++ b/tests/system_tests_sasl_plain.py
@@ -17,9 +17,9 @@
 # under the License.
 #
 
-import unittest, os, json
-from subprocess import PIPE, Popen, STDOUT
-from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, Process
+import unittest2 as unittest, os
+from subprocess import PIPE, Popen
+from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT
 from qpid_dispatch.management.client import Node
 from proton import SASL
 
@@ -541,7 +541,8 @@ class RouterTestVerifyHostNameNo(RouterTestPlainSaslCommon):
         local_node.delete(type='connector', name='connectorToX')
         local_node.delete(type='sslProfile', name='client-ssl-profile')
         connections = local_node.query(type='org.apache.qpid.dispatch.connection').get_entities()
-        self.assertNotIn("QDR.X", [c.container for c in connections]) # Should not be present now
+        is_qdr_x = "QDR.X" in [c.container for c in connections]
+        self.assertFalse(is_qdr_x) # Should not be present now
 
         # re-create the ssl profile
         local_node.create({'type': 'sslProfile',

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_topology.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_topology.py b/tests/system_tests_topology.py
index 5e58483..cd171aa 100644
--- a/tests/system_tests_topology.py
+++ b/tests/system_tests_topology.py
@@ -17,20 +17,14 @@
 # under the License.
 #
 
-import unittest, os, json
-from subprocess      import PIPE, STDOUT
-from proton          import Message, PENDING, ACCEPTED, REJECTED, RELEASED, SSLDomain, SSLUnavailable, Timeout
-from system_test     import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, Process
+
+import unittest2 as unittest
+from proton          import Message, Timeout
+from system_test     import TestCase, Qdrouterd, main_module
 from proton.handlers import MessagingHandler
-from proton.reactor  import Container, AtMostOnce, AtLeastOnce, DynamicNodeProperties, LinkOption, ApplicationEvent, EventInjector
-from proton.utils    import BlockingConnection
-from qpid_dispatch.management.client import Node
+from proton.reactor  import Container
 
 import time
-import datetime
-import pdb
-
-
 
 # PROTON-828:
 try:
@@ -39,8 +33,6 @@ except ImportError:
     from proton import PN_STATUS_MODIFIED as MODIFIED
 
 
-
-
 #------------------------------------------------
 # Helper classes for all tests.
 #------------------------------------------------
@@ -603,7 +595,5 @@ class TopologyFailover ( MessagingHandler ):
         Container(self).run()
 
 
-
-
 if __name__ == '__main__':
     unittest.main(main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_two_routers.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_two_routers.py b/tests/system_tests_two_routers.py
index a718dd3..7fae131 100644
--- a/tests/system_tests_two_routers.py
+++ b/tests/system_tests_two_routers.py
@@ -17,12 +17,12 @@
 # under the License.
 #
 
-import unittest, os, json, logging
-from subprocess import PIPE, STDOUT
-from proton import Message, PENDING, ACCEPTED, REJECTED, RELEASED, Timeout
-from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, Process
+import unittest2 as unittest
+import logging
+from proton import Message, PENDING, ACCEPTED, REJECTED, Timeout
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
 from proton.handlers import MessagingHandler
-from proton.reactor import Container, AtMostOnce, AtLeastOnce
+from proton.reactor import Container
 
 # PROTON-828:
 try:
@@ -1315,5 +1315,6 @@ class AttachOnInterRouterTest(MessagingHandler):
         finally:
             logging.disable(logging.NOTSET) # Restore to normal
 
+
 if __name__ == '__main__':
     unittest.main(main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_user_id.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_user_id.py b/tests/system_tests_user_id.py
index e62f311..f9058c6 100644
--- a/tests/system_tests_user_id.py
+++ b/tests/system_tests_user_id.py
@@ -19,10 +19,10 @@
 
 
 import os
-import unittest
+import unittest2 as unittest
 from system_test import TestCase, Qdrouterd, DIR, main_module
 from qpid_dispatch.management.client import Node
-from proton import SSLDomain, Message
+from proton import SSLDomain
 
 class QdSSLUseridTest(TestCase):
 
@@ -313,5 +313,6 @@ class QdSSLUseridTest(TestCase):
 
         node.close()
 
+
 if __name__ == '__main__':
     unittest.main(main_module())

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4a173e1e/tests/system_tests_user_id_proxy.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_user_id_proxy.py b/tests/system_tests_user_id_proxy.py
index 409aaf1..09d2d40 100644
--- a/tests/system_tests_user_id_proxy.py
+++ b/tests/system_tests_user_id_proxy.py
@@ -19,13 +19,13 @@
 
 
 import os
-import unittest
+import unittest2 as unittest
 from system_test import TestCase, Qdrouterd, DIR, main_module
-from qpid_dispatch.management.client import Node
 import proton
-from proton import SSLDomain, Message, ProtonException, Delivery
+from proton import SSLDomain, Delivery
 from proton.utils import BlockingConnection
 
+
 class QdSSLUseridTest(TestCase):
 
     @staticmethod


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org