Repository: qpid-dispatch Updated Branches: refs/heads/master 51cba5cd7 -> 1b39fff04
DISPATCH-1080 - Added code to skip tests only if SASL extended is not available on the executing system Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/1b39fff0 Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/1b39fff0 Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/1b39fff0 Branch: refs/heads/master Commit: 1b39fff04f7d8e15f0762183d1d4b4c3a801739c Parents: 51cba5c Author: Ganesh Murthy <gmur...@redhat.com> Authored: Tue Jul 17 10:32:26 2018 -0400 Committer: Ganesh Murthy <gmur...@redhat.com> Committed: Tue Jul 17 10:57:58 2018 -0400 ---------------------------------------------------------------------- tests/system_tests_ssl.py | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/1b39fff0/tests/system_tests_ssl.py ---------------------------------------------------------------------- diff --git a/tests/system_tests_ssl.py b/tests/system_tests_ssl.py index 1a5b45d..8d49ded 100644 --- a/tests/system_tests_ssl.py +++ b/tests/system_tests_ssl.py @@ -100,7 +100,14 @@ class RouterTestSslClient(RouterTestSslBase): cls.routers = [] if not SASL.extended(): - return + router = ('router', {'id': 'QDR.A', + 'mode': 'interior', + 'saslConfigName': 'tests-mech-PLAIN', + 'saslConfigDir': os.getcwd()}) + else: + router = ('router', {'id': 'QDR.A', + 'mode': 'interior'}) + # Generate authentication DB super(RouterTestSslClient, cls).create_sasl_files() @@ -116,11 +123,8 @@ class RouterTestSslClient(RouterTestSslBase): cls.PORT_TLS_SASL = cls.tester.get_port() cls.PORT_SSL3 = cls.tester.get_port() - config = Qdrouterd.Config([ - ('router', {'id': 'QDR.A', - 'mode': 'interior', - 'saslConfigName': 'tests-mech-PLAIN', - 'saslConfigDir': os.getcwd()}), + conf = [ + router, # TLSv1 only ('listener', {'host': '0.0.0.0', 'role': 'normal', 'port': cls.PORT_TLS1, 'authenticatePeer': 'no', @@ -229,7 +233,9 @@ class RouterTestSslClient(RouterTestSslBase): 'DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS', 'protocols': 'SSLv23', 'password': 'server-password'}) - ]) + ] + + config = Qdrouterd.Config(conf) cls.routers.append(cls.tester.qdrouterd("A", config, wait=False)) cls.routers[0].wait_ports() @@ -371,6 +377,9 @@ class RouterTestSslClient(RouterTestSslBase): and forcing the TLS protocol version, which should be accepted by the listener. :return: """ + if not SASL.extended(): + self.skipTest("Cyrus library not available. skipping test") + self.assertTrue(self.is_ssl_sasl_client_accepted(self.PORT_TLS_SASL, "TLSv1")) self.assertTrue(self.is_ssl_sasl_client_accepted(self.PORT_TLS_SASL, "TLSv1.2")) @@ -380,6 +389,9 @@ class RouterTestSslClient(RouterTestSslBase): and forcing the TLS protocol version, which should be rejected by the listener. :return: """ + if not SASL.extended(): + self.skipTest("Cyrus library not available. skipping test") + self.assertFalse(self.is_ssl_sasl_client_accepted(self.PORT_TLS_SASL, "TLSv1.1")) @@ -568,6 +580,9 @@ class RouterTestSslInterRouter(RouterTestSslBase): Retrieves connected router nodes. :return: """ + if not SASL.extended(): + self.skipTest("Cyrus library not available. skipping test") + url = Url("amqp://0.0.0.0:%d/$management" % self.PORT_NO_SSL) node = Node.connect(url) response = node.query(type="org.apache.qpid.dispatch.router.node", attribute_names=["id"]) @@ -581,6 +596,9 @@ class RouterTestSslInterRouter(RouterTestSslBase): """ Validates if all expected routers are connected in the network """ + if not SASL.extended(): + self.skipTest("Cyrus library not available. skipping test") + router_nodes = self.get_router_nodes() self.assertTrue(router_nodes) for node in router_nodes: --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org