[qpid-dispatch] branch master updated: DISPATCH-1746: Additional fix. Copied the earlier fix to system_tests_multi_tenancy_policy

2020-11-05 Thread gmurthy
This is an automated email from the ASF dual-hosted git repository.

gmurthy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
 new 31d9aa1  DISPATCH-1746: Additional fix. Copied the earlier fix to 
system_tests_multi_tenancy_policy
31d9aa1 is described below

commit 31d9aa18972d39c23740161def02e8f99e4da41d
Author: Ganesh Murthy 
AuthorDate: Thu Nov 5 18:11:23 2020 -0500

DISPATCH-1746: Additional fix. Copied the earlier fix to 
system_tests_multi_tenancy_policy
---
 tests/system_tests_multi_tenancy_policy.py | 19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/tests/system_tests_multi_tenancy_policy.py 
b/tests/system_tests_multi_tenancy_policy.py
index 70b2c09..bfa1a58 100644
--- a/tests/system_tests_multi_tenancy_policy.py
+++ b/tests/system_tests_multi_tenancy_policy.py
@@ -846,6 +846,9 @@ class WaypointTest(MessagingHandler):
 self.waypoint_sender   = None
 self.waypoint_receiver = None
 self.waypoint_queue= []
+self.waypoint_sender_opened = False
+self.waypoint_receiver_opened = False
+self.firsts_created = False
 
 self.count  = 10
 self.n_sent = 0
@@ -880,30 +883,31 @@ class WaypointTest(MessagingHandler):
 self.first_conn  = event.container.connect(self.first_host)
 self.second_conn = event.container.connect(self.second_host)
 
-def on_connection_opened(self, event):
-if event.connection == self.first_conn:
-self.first_sender   = 
event.container.create_sender(self.first_conn, self.first_address)
-self.first_receiver = 
event.container.create_receiver(self.first_conn, self.first_address)
-
 def on_link_opening(self, event):
-if event.sender:
+if event.sender and not self.waypoint_sender:
 self.waypoint_sender = event.sender
 if event.sender.remote_source.address == self.second_address:
 event.sender.source.address = self.second_address
 event.sender.open()
+self.waypoint_sender_opened = True
 else:
 self.fail("Incorrect address on incoming sender: got %s, 
expected %s" %
   (event.sender.remote_source.address, 
self.second_address))
 
-elif event.receiver:
+elif event.receiver and not self.waypoint_receiver:
 self.waypoint_receiver = event.receiver
 if event.receiver.remote_target.address == self.second_address:
 event.receiver.target.address = self.second_address
 event.receiver.open()
+self.waypoint_receiver_opened = True
 else:
 self.fail("Incorrect address on incoming receiver: got %s, 
expected %s" %
   (event.receiver.remote_target.address, 
self.second_address))
 
+if self.waypoint_sender_opened and self.waypoint_receiver_opened and 
not self.firsts_created:
+self.firsts_created = True
+self.first_sender = event.container.create_sender(self.first_conn, 
self.first_address)
+self.first_receiver = 
event.container.create_receiver(self.first_conn, self.first_address)
 
 def on_sendable(self, event):
 if event.sender == self.first_sender:
@@ -927,5 +931,6 @@ class WaypointTest(MessagingHandler):
 container.run()
 
 
+
 if __name__ == '__main__':
 unittest.main(main_module())


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



[qpid-proton] branch master updated: PROTON-2288: Replace C++ TLS certificates with more secure ones to allow tests to carry on working

2020-11-05 Thread astitcher
This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/master by this push:
 new e2bcd30  PROTON-2288: Replace C++ TLS certificates with more secure 
ones to allow tests to carry on working
e2bcd30 is described below

commit e2bcd30219cfa6264846739e282082d4a1c4b6e4
Author: Andrew Stitcher 
AuthorDate: Thu Nov 5 12:55:25 2020 -0500

PROTON-2288: Replace C++ TLS certificates with more secure ones to allow 
tests to carry on working
---
 cpp/testdata/certs/bad-server-certificate.p12  | Bin 2186 -> 2442 bytes
 cpp/testdata/certs/bad-server-certificate.pem  |  49 +---
 cpp/testdata/certs/bad-server-private-key.pem  |  45 +++---
 cpp/testdata/certs/bad-server.pkcs12   | Bin 2223 -> 2479 bytes
 cpp/testdata/certs/ca-certificate.p12  | Bin 1408 -> 1056 bytes
 cpp/testdata/certs/ca-certificate.pem  |  51 ++---
 cpp/testdata/certs/ca.pkcs12   | Bin 2263 -> 2519 bytes
 cpp/testdata/certs/client-certificate.p12  | Bin 2242 -> 2506 bytes
 cpp/testdata/certs/client-certificate.pem  |  41 +++--
 cpp/testdata/certs/client-certificate1.p12 | Bin 2300 -> 2564 bytes
 cpp/testdata/certs/client-certificate1.pem |  41 +++--
 .../certs/client-private-key-no-password.pem   |  41 +++--
 cpp/testdata/certs/client-private-key.pem  |  45 +++---
 cpp/testdata/certs/client-private-key1.pem |  45 +++---
 cpp/testdata/certs/client-request.pem  |  36 ++-
 cpp/testdata/certs/client-request1.pem |  37 ++-
 cpp/testdata/certs/client.pkcs12   | Bin 2231 -> 2495 bytes
 cpp/testdata/certs/client1.pkcs12  | Bin 2345 -> 2609 bytes
 cpp/testdata/certs/make_certs.sh   |  14 +++---
 cpp/testdata/certs/server-certificate-lh.pem   |  41 +++--
 cpp/testdata/certs/server-certificate.p12  | Bin 2258 -> 2522 bytes
 cpp/testdata/certs/server-certificate.pem  |  42 +++--
 cpp/testdata/certs/server-lh.pkcs12| Bin 2199 -> 2463 bytes
 cpp/testdata/certs/server-private-key-lh.pem   |  45 +++---
 cpp/testdata/certs/server-private-key.pem  |  45 +++---
 cpp/testdata/certs/server-request-lh.pem   |  35 ++
 cpp/testdata/certs/server-request.pem  |  37 ++-
 cpp/testdata/certs/server-wc-certificate.p12   | Bin 2320 -> 2576 bytes
 cpp/testdata/certs/server-wc-certificate.pem   |  44 --
 cpp/testdata/certs/server-wc-private-key.pem   |  45 +++---
 cpp/testdata/certs/server-wc-request.pem   |  39 +++-
 cpp/testdata/certs/server-wc.pkcs12| Bin 2317 -> 2581 bytes
 cpp/testdata/certs/server.pkcs12   | Bin 2263 -> 2527 bytes
 33 files changed, 413 insertions(+), 405 deletions(-)

diff --git a/cpp/testdata/certs/bad-server-certificate.p12 
b/cpp/testdata/certs/bad-server-certificate.p12
index b986651..3bf4e7b 100644
Binary files a/cpp/testdata/certs/bad-server-certificate.p12 and 
b/cpp/testdata/certs/bad-server-certificate.p12 differ
diff --git a/cpp/testdata/certs/bad-server-certificate.pem 
b/cpp/testdata/certs/bad-server-certificate.pem
index a18b890..e10bcad 100644
--- a/cpp/testdata/certs/bad-server-certificate.pem
+++ b/cpp/testdata/certs/bad-server-certificate.pem
@@ -1,31 +1,26 @@
 Bag Attributes
 friendlyName: bad-server
-localKeyID: 54 69 6D 65 20 31 35 33 38 34 34 39 30 36 34 33 33 37 
-subject=/CN=127.0.0.1/O=Not Trusted Inc
-issuer=/CN=127.0.0.1/O=Not Trusted Inc
+localKeyID: 54 69 6D 65 20 31 36 30 34 35 39 34 35 34 37 36 31 32 
+subject=CN = 127.0.0.1, O = Not Trusted Inc
+
+issuer=CN = 127.0.0.1, O = Not Trusted Inc
+
 -BEGIN CERTIFICATE-
-MIIEWjCCBAWgAwIBAgIEZQJ1MDANBglghkgBZQMEAwIFADAuMRIwEAYDVQQDEwkx
-MjcuMC4wLjExGDAWBgNVBAoTD05vdCBUcnVzdGVkIEluYzAgFw0xODEwMDIwMjU3
-NDRaGA8yMjkyMDcxNjAyNTc0NFowLjESMBAGA1UEAxMJMTI3LjAuMC4xMRgwFgYD
-VQQKEw9Ob3QgVHJ1c3RlZCBJbmMwggNCMIICNQYHKoZIzjgEATCCAigCggEBAI95
-Ndm5qum/q+2Ies9JUbbzLsWeO683GOjqxJYfPv02BudDUanEGDM5uAnnwq4cU5un
-R1uF0BGtuLR5h3VJhGlcrA6PFLM2CCiiL/onEQo9YqmTRTQJoP5pbEZY+EvdIIGc
-NwmgEFexla3NACM9ulSEtikfnWSO+INEhneXnOwEtDSmrC516Zhd4j2wKS/BEYyf
-+p2BgeczjbeStzDXueNJWS9oCZhyFTkV6j1ri0ZTxjNFj4A7MqTC4PJykCVuTj+K
-Owg4ocRQ5OGMGimjfd9eoUPeS2b/BJA+1c8WI+FY1IfGCOl/IRzYHcojy244B2X4
-IuNCvkhMBXY5OWAc1mcCHQC69pamhXj3397n+mfJd8eF7zKyM7rlgMC81WldAoIB
-ABamXFggSFBwTnUCo5dXBA002jo0eMFU1OSlwC0kLuBPluYeS9CQSr2sjzfuseCf
-MYLSPJBDy2QviABBYO35ygmzIHannDKmJ/JHPpGHm6LE50S9IIFUTLVbgCw2jR+o
-PtSJ6U4PoGiOMkKKXHjEeMaNBSe3HJo6uwsL4SxEaJY559POdNsQGmWqK4f2TGgm

[qpid-dispatch] branch dev-protocol-adaptors-2 updated: DISPATCH-1807: Rewrite TCP adaptor self test

2020-11-05 Thread chug
This is an automated email from the ASF dual-hosted git repository.

chug pushed a commit to branch dev-protocol-adaptors-2
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/dev-protocol-adaptors-2 by 
this push:
 new 66a4d9f  DISPATCH-1807: Rewrite TCP adaptor self test
66a4d9f is described below

commit 66a4d9ffe7126bc93df543458d33569dfe2c5b2d
Author: Chuck Rolke 
AuthorDate: Thu Nov 5 12:18:20 2020 -0500

DISPATCH-1807: Rewrite TCP adaptor self test

Create multi-router network and an echo server for each router.
Then launch echo clients to chosen routers targeting the echo server
on any other router.
---
 tests/system_tests_tcp_adaptor.py | 420 --
 1 file changed, 314 insertions(+), 106 deletions(-)

diff --git a/tests/system_tests_tcp_adaptor.py 
b/tests/system_tests_tcp_adaptor.py
index 40f667b..52c945a 100644
--- a/tests/system_tests_tcp_adaptor.py
+++ b/tests/system_tests_tcp_adaptor.py
@@ -33,6 +33,7 @@ from system_test import Logger
 from system_test import QdManager
 from system_test import unittest
 from system_test import DIR
+from system_test import SkipIfNeeded
 from qpid_dispatch.management.client import Node
 from subprocess import PIPE, STDOUT
 
@@ -45,75 +46,256 @@ except ImportError:
 class TCP_echo_server(object):
 pass
 
-class TcpAdaptorOneRouterEcho(TestCase):
+
+DISABLE_SELECTOR_TESTS = False
+DISABLE_SELECTOR_REASON = ''
+try:
+import selectors
+except ImportError:
+DISABLE_SELECTOR_TESTS = True
+DISABLE_SELECTOR_REASON = "Python selectors module is not available on 
this platform."
+
+
+class TcpAdaptor(TestCase):
 """
-Run echo tests through a stand-alone router
+4 edge routers connected via 2 interior routers.
+6 echo servers are connected via tcpConnector, one to each router.
+Each router has 7 listeners, one for each server and
+another for which there is no server.
 """
-amqp_listener_port   = None
-tcp_client_listener_port = None
-tcp_server_listener_port = None
+#  +---++-++-++---+
+#  |  EA1  |<-->|  INTA   |<==>|  INTB   |<-->|  EB1  |
+#  +---+| || |+---+
+#  +---+| || |+---+
+#  |  EA2  |<-->| || |<-->|  EB2  |
+#  +---++-++-++---+
+#
+# Each router tcp-connects to a like-named echo server.
+# Each router has tcp-listeners for ever echo server
+#
+#  ++ ++ ++ ++ ++ ++
+#   +--|tcp |-|tcp |-|tcp |-|tcp |-|tcp |-|tcp |--+
+#   |  |lsnr| |lsnr| |lsnr| |lsnr| |lsnr| |lsnr|  |
+#   |  |EA1 | |EA2 | |INTA| |INTB| |EB1 | |EB2 |  |
+#   |  ++ ++ ++ ++ ++ ++  |
+#   |  +-+  +--+
+#   |  Router  | tcp |  | echo |
+#   |  EA1 |connector|->|server|
+#   |  +-+  | EA1  |
+#   | | +--+
+#   +-+
+#
+
+# Allocate routers in this order
+router_order = ['INTA', 'INTB', 'EA1', 'EA2', 'EB1', 'EB2']
+
+# List indexed in router_order
+# First listener in each router is normal AMQP for test setup and mgmt.
+amqp_listener_ports   = {}
+
+# Each router listens for TCP where the tcp-address is the router name.
+# Each router has N listeners, one for the echo server connected to each 
router.
+tcp_client_listener_ports = {}
+
+# Each router connects to an echo server
+tcp_server_listener_ports = {}
+
+# Each router has a TCP listener that has no associated server
+nodest_listener_ports = {}
+
+# Each router has a console listener
+http_listener_ports = {}
+
+# local timeout in seconds to wait for one echo client to finish
+echo_timeout = 30
 
-echo_timeout = 30 # local timeout to wait for one echo client to finish
+# TCP siteId for listeners and connectors
+site = "mySite"
 
 @classmethod
 def setUpClass(cls):
 """Start a router"""
-super(TcpAdaptorOneRouterEcho, cls).setUpClass()
+super(TcpAdaptor, cls).setUpClass()
 
-def router(name, mode, l_amqp, l_tcp_client, l_tcp_server, addr, site, 
extra=None):
+if DISABLE_SELECTOR_TESTS:
+return
+
+def router(name, mode, connection, extra=None):
+"""
+Launch a router through the system_test framework.
+For each router:
+ * normal listener first
+ * http listener for console connections
+ * tcp listener for 'nodest', which will never exist
+ * tcp connector to echo