]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix MismatchError to nondeterministic order for list of controllers
authorarmando-migliaccio <armamig@gmail.com>
Fri, 24 Apr 2015 16:27:40 +0000 (09:27 -0700)
committerArmando Migliaccio <armamig@gmail.com>
Fri, 24 Apr 2015 16:32:13 +0000 (16:32 +0000)
The list of controllers returned by the ovsdb server can be in any order,
therefore we can't assert likes for likes. Assert the sorted lists instead.

Change-Id: Ice3bb8cc0b3da70f8c9aae50d8cdae2b474ff49b
Closes-bug: #1448202

neutron/tests/functional/agent/test_ovs_lib.py

index f59584f122ee9f5b19b5b28091944016e0af6fd8..69589a564863672e01465495eafad77a1f915547 100644 (file)
@@ -240,7 +240,7 @@ class OVSBridgeTestCase(OVSBridgeTestBase):
 
     def _set_controllers_connection_mode(self, controllers):
         self.br.set_controller(controllers)
-        self.assertEqual(controllers, self.br.get_controller())
+        self.assertEqual(sorted(controllers), sorted(self.br.get_controller()))
         self.br.set_controllers_connection_mode('out-of-band')
         self._assert_controllers_connection_mode('out-of-band')
         self.br.del_controller()