summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulia Kreger <juliaashleykreger@gmail.com>2023-05-08 14:08:47 -0700
committerJulia Kreger <juliaashleykreger@gmail.com>2023-05-08 14:08:47 -0700
commitcec72275a10722abb69d8d2df711d41b01aee9b5 (patch)
tree6c48de396c6abcc22db993fc1b10717a827f4f1a
parent4518577770bb16cc2e4042014509cc08914796d9 (diff)
downloadironic-cec72275a10722abb69d8d2df711d41b01aee9b5.tar.gz
CI: Fix another network test
Turns out more than one test was relying upon the object change determination test. Modifies this test to use the same pattern of behavior so we are avoiding racing. Change-Id: I29ee6cab7320d13fcc2eeda27dae08aeb2d98b00
-rw-r--r--ironic/tests/unit/drivers/modules/network/test_common.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ironic/tests/unit/drivers/modules/network/test_common.py b/ironic/tests/unit/drivers/modules/network/test_common.py
index 48be8ceae..e58fcaa20 100644
--- a/ironic/tests/unit/drivers/modules/network/test_common.py
+++ b/ironic/tests/unit/drivers/modules/network/test_common.py
@@ -1065,10 +1065,14 @@ class TestNeutronVifPortIDMixin(db_base.DbTestCase):
expected_dhcp_opts = [{'opt_name': '61', 'opt_value': 'fake2'}]
self.port.extra = expected_extra
self.port.internal_info = expected_ii
+ what_changed_mock = mock.Mock()
+ what_changed_mock.return_value = ['extra', 'internal_info']
+ self.port.obj_what_changed = what_changed_mock
with task_manager.acquire(self.context, self.node.id) as task:
self.interface.port_changed(task, self.port)
dhcp_update_mock.assert_called_once_with(
mock.ANY, 'fake-id', expected_dhcp_opts, context=task.context)
+ self.assertEqual(2, what_changed_mock.call_count)
@mock.patch('ironic.dhcp.neutron.NeutronDHCPApi.update_port_dhcp_opts',
autospec=True)