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 2016/05/11 17:53:09 UTC
[1/2] qpid-dispatch git commit: DISPATCH-319 - Added a new test to
expose the discrepancy between path and valid-origins
Repository: qpid-dispatch
Updated Branches:
refs/heads/master 8366141f1 -> 2138da722
DISPATCH-319 - Added a new test to expose the discrepancy between path and valid-origins
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/465e5371
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/465e5371
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/465e5371
Branch: refs/heads/master
Commit: 465e5371ca156809fe0c5291940fbb2e944c0db2
Parents: 8366141
Author: Ted Ross <tr...@redhat.com>
Authored: Wed May 11 13:48:01 2016 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Wed May 11 13:48:01 2016 -0400
----------------------------------------------------------------------
tests/router_engine_test.py | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/465e5371/tests/router_engine_test.py
----------------------------------------------------------------------
diff --git a/tests/router_engine_test.py b/tests/router_engine_test.py
index 003728c..2294ffb 100644
--- a/tests/router_engine_test.py
+++ b/tests/router_engine_test.py
@@ -613,6 +613,38 @@ class PathTest(unittest.TestCase):
self.assertEqual(valid_origins['R6'], ['R2', 'R3', 'R4'])
self.assertEqual(valid_origins['R7'], ['R2', 'R3', 'R4'])
+ def test_topology6_path_vs_valid_origin(self):
+ """
+
+ +====+ +====+ +----+
+ | R1 |--10--| R3 |--10--| R5 |
+ +====+ +====+ +----+
+ | | |
+ 1 10 1
+ | | |
+ +----+ +----+ +----+
+ | R2 |--10--| R4 |--10--| R6 |
+ +----+ +----+ +----+
+
+ """
+ collection = { 'R1': LinkState(None, 'R1', 1, {'R2':1, 'R3':10}),
+ 'R2': LinkState(None, 'R2', 1, {'R1':1, 'R4':10}),
+ 'R3': LinkState(None, 'R3', 1, {'R1':10, 'R4':10, 'R5':10}),
+ 'R4': LinkState(None, 'R4', 1, {'R2':10, 'R3':10, 'R6':10}),
+ 'R5': LinkState(None, 'R5', 1, {'R3':10, 'R6':1}),
+ 'R6': LinkState(None, 'R6', 1, {'R4':10, 'R5':1}) }
+
+ self.id = 'R3'
+ self.engine = PathEngine(self)
+ r3_next_hops, r3_costs, r3_valid_origins = self.engine.calculate_routes(collection)
+
+ self.id = 'R1'
+ self.engine = PathEngine(self)
+ r1_next_hops, r1_costs, r1_valid_origins = self.engine.calculate_routes(collection)
+
+ self.assertEqual(r1_next_hops['R6'], 'R2')
+ self.assertEqual(r3_valid_origins['R6'], [])
+
if __name__ == '__main__':
unittest.main(main_module())
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/2] qpid-dispatch git commit: DISPATCH-319 - Generate the
valid-origin correctly for each computed path. Don't assume that the path
from A -> Z is the reverse of the path from Z -> A.
Posted by tr...@apache.org.
DISPATCH-319 - Generate the valid-origin correctly for each computed path. Don't assume
that the path from A -> Z is the reverse of the path from Z -> A.
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/2138da72
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/2138da72
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/2138da72
Branch: refs/heads/master
Commit: 2138da7223f98d84a6f9bdbb02d938f83e42181c
Parents: 465e537
Author: Ted Ross <tr...@redhat.com>
Authored: Wed May 11 13:48:40 2016 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Wed May 11 13:48:40 2016 -0400
----------------------------------------------------------------------
python/qpid_dispatch_internal/router/path.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2138da72/python/qpid_dispatch_internal/router/path.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch_internal/router/path.py b/python/qpid_dispatch_internal/router/path.py
index 2e15257..1df094c 100644
--- a/python/qpid_dispatch_internal/router/path.py
+++ b/python/qpid_dispatch_internal/router/path.py
@@ -110,7 +110,8 @@ class PathEngine(object):
path.append(v)
nodes.remove(v)
if v == self.id:
- valid_origin[root].extend(path)
+ for dest in path:
+ valid_origin[dest].append(root)
u = v
v = prev[u]
return valid_origin
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org