Minor modification to test to make sure link routes are all activated before the test begins. This closes
@@ -31,7 +31,7 @@ from system_test import AsyncTestSender
from system_test import AsyncTestReceiver
from system_test import QdManager
from system_test import MgmtMsgProxy
-from system_test import unittest
+from system_test import unittest, QdManager
from test_broker import FakeBroker
from proton import Delivery
@@ -2121,6 +2121,31 @@ class Dispatch1428(TestCase):
for c in cmds:
self.run_qdmanage(cmd=c, address=self.routers[1].addresses[0])
+ # Now that the qdmanage has run, query the link routes and make sure that their "operStatus" is "active" before
+ # running any of the tests.
+ long_type = 'org.apache.qpid.dispatch.router.config.linkRoute'
+ qd_manager = QdManager(self, address=self.routers[1].addresses[0])
+
+ for i in xrange(5):
+ all_link_routes_activated = True
+ link_routes = qd_manager.query(long_type)
+ for link_route in link_routes:
+ oper_status = link_route['operStatus']
+ if oper_status != "active":
+ all_link_routes_activated = False
+ break
+ if not all_link_routes_activated:
+ # One or more of the link routes have not been activated.
+ # Check after one second.
+ sleep(1)
+ else:
+ break
+
+ # All link routes created in this test MUST be activated before
+ # we can continue further testing.
+ self.assertTrue(all_link_routes_activated)
+
+
first = SendReceive("%s/foo" % self.routers[1].addresses[0], "%s/foo" % self.routers[0].addresses[0])
first.run()
self.assertEqual(None, first.error)
