[
https://issues.apache.org/jira/browse/DISPATCH-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17053633#comment-17053633
]
ASF GitHub Bot commented on DISPATCH-1582:
------------------------------------------
kgiusti commented on pull request #697: DISPATCH-1582 - Ignore router control
message with version greater th…
URL: https://github.com/apache/qpid-dispatch/pull/697#discussion_r389050032
##########
File path: tests/system_tests_routing_protocol.py
##########
@@ -0,0 +1,252 @@
+#
+# 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.
+#
+
+from __future__ import unicode_literals
+from __future__ import division
+from __future__ import absolute_import
+from __future__ import print_function
+
+from proton import Message, Timeout, symbol, int32
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
+from system_test import unittest
+from proton.handlers import MessagingHandler
+from proton.reactor import Container, DynamicNodeProperties
+from qpid_dispatch_internal.compat import UNICODE
+from qpid_dispatch.management.client import Node
+
+
+class RouterTest(TestCase):
+
+ inter_router_port = None
+
+ @classmethod
+ def setUpClass(cls):
+ """Start a router"""
+ super(RouterTest, cls).setUpClass()
+
+ def router(name, connection):
+
+ config = [
+ ('router', {'mode': 'interior', 'id': name}),
+ ('listener', {'port': cls.tester.get_port(),
'stripAnnotations': 'no'}),
+ ('listener', {'port': cls.tester.get_port(),
'stripAnnotations': 'no', 'multiTenant': 'yes'}),
+ ('listener', {'port': cls.tester.get_port(),
'stripAnnotations': 'no', 'role': 'route-container'}),
+ connection
+ ]
+
+ config = Qdrouterd.Config(config)
+
+ cls.routers.append(cls.tester.qdrouterd(name, config, wait=True))
+
+ cls.routers = []
+
+ inter_router_port = cls.tester.get_port()
+
+ router('A', ('listener', {'role': 'inter-router', 'port':
inter_router_port}))
+ router('B', ('connector', {'name': 'connectorToA', 'role':
'inter-router', 'port': inter_router_port, 'verifyHostname': 'no'}))
+
+ cls.routers[0].wait_router_connected('B')
+ cls.routers[1].wait_router_connected('A')
+
+
+ def test_01_reject_higher_version_hello(self):
+ test = RejectHigherVersionHelloTest(self.routers[0].addresses[3])
+ test.run()
+ self.assertEqual(None, test.error)
+
+ def test_02_reject_higher_version_mar(self):
+ test = RejectHigherVersionMARTest(self.routers[0].addresses[3],
self.routers[0].addresses[0])
+ test.run()
+ self.assertEqual(None, test.error)
+
+
+class Entity(object):
+ def __init__(self, status_code, status_description, attrs):
+ self.status_code = status_code
+ self.status_description = status_description
+ self.attrs = attrs
+
+ def __getattr__(self, key):
+ return self.attrs[key]
+
+
+class RouterProxy(object):
+ def __init__(self, reply_addr):
+ self.reply_addr = reply_addr
+
+ def response(self, msg):
+ ap = msg.properties
+ return Entity(ap['statusCode'], ap['statusDescription'], msg.body)
+
+ def read_address(self, name):
+ ap = {'operation': 'READ', 'type':
'org.apache.qpid.dispatch.router.address', 'name': name}
+ return Message(properties=ap, reply_to=self.reply_addr)
+
+ def query_addresses(self):
+ ap = {'operation': 'QUERY', 'type':
'org.apache.qpid.dispatch.router.address'}
+ return Message(properties=ap, reply_to=self.reply_addr)
+
+
+class Timeout(object):
Review comment:
import this from system_test rather than define a new one
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Prepare Routing Protocol for Backward Compatibility
> ---------------------------------------------------
>
> Key: DISPATCH-1582
> URL: https://issues.apache.org/jira/browse/DISPATCH-1582
> Project: Qpid Dispatch
> Issue Type: Improvement
> Components: Routing Engine
> Reporter: Ted Ross
> Assignee: Ted Ross
> Priority: Minor
> Fix For: 1.11.0
>
>
> In anticipation of moving to routing protocol version 2 (we're currently on
> 1), there are a few changes needed to make it easy for version 2 to be
> backward compatible to version 1. This Jira will track those changes.
> The proposed change is to ensure that a version 1 router ignores version >1
> messages, issuing a low-volume warning log when one is received. This way, a
> version 2 router can send both versions or send targeted versions based on
> its knowledge of peer routers protocol versions.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]