Merge "Fixes port status hanging to build status"
This commit is contained in:
commit
cbfd690d65
@ -310,6 +310,10 @@ class HyperVNeutronAgent(object):
|
|||||||
device_details['physical_network'],
|
device_details['physical_network'],
|
||||||
device_details['segmentation_id'],
|
device_details['segmentation_id'],
|
||||||
device_details['admin_state_up'])
|
device_details['admin_state_up'])
|
||||||
|
self.plugin_rpc.update_device_up(self.context,
|
||||||
|
device,
|
||||||
|
self.agent_id,
|
||||||
|
cfg.CONF.host)
|
||||||
return resync
|
return resync
|
||||||
|
|
||||||
def _treat_devices_removed(self, devices):
|
def _treat_devices_removed(self, devices):
|
||||||
|
@ -111,8 +111,20 @@ class TestHyperVNeutronAgent(base.BaseTestCase):
|
|||||||
def test_treat_devices_added_updates_known_port(self):
|
def test_treat_devices_added_updates_known_port(self):
|
||||||
details = mock.MagicMock()
|
details = mock.MagicMock()
|
||||||
details.__contains__.side_effect = lambda x: True
|
details.__contains__.side_effect = lambda x: True
|
||||||
self.assertTrue(self.mock_treat_devices_added(details,
|
with mock.patch.object(self.agent.plugin_rpc,
|
||||||
'_treat_vif_port'))
|
"update_device_up") as func:
|
||||||
|
self.assertTrue(self.mock_treat_devices_added(details,
|
||||||
|
'_treat_vif_port'))
|
||||||
|
self.assertTrue(func.called)
|
||||||
|
|
||||||
|
def test_treat_devices_added_missing_port_id(self):
|
||||||
|
details = mock.MagicMock()
|
||||||
|
details.__contains__.side_effect = lambda x: False
|
||||||
|
with mock.patch.object(self.agent.plugin_rpc,
|
||||||
|
"update_device_up") as func:
|
||||||
|
self.assertFalse(self.mock_treat_devices_added(details,
|
||||||
|
'_treat_vif_port'))
|
||||||
|
self.assertFalse(func.called)
|
||||||
|
|
||||||
def test_treat_devices_removed_returns_true_for_missing_device(self):
|
def test_treat_devices_removed_returns_true_for_missing_device(self):
|
||||||
attrs = {'update_device_down.side_effect': Exception()}
|
attrs = {'update_device_down.side_effect': Exception()}
|
||||||
|
Loading…
Reference in New Issue
Block a user