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 <[email protected]>
Authored: Wed May 11 13:48:01 2016 -0400
Committer: Ted Ross <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to