From cec72275a10722abb69d8d2df711d41b01aee9b5 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Mon, 8 May 2023 14:08:47 -0700 Subject: 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 --- ironic/tests/unit/drivers/modules/network/test_common.py | 4 ++++ 1 file changed, 4 insertions(+) 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) -- cgit v1.2.1