Skip to content

Commit 602bb1a

Browse files
ralonsohkarelyatin
authored andcommitted
[OVN][FT] Make explicit the "publish" call check in "test_port_forwarding"
The functional test "TestMaintenance.test_port_forwarding" is checking the "registry.publish" call after calling "create_floatingip_port_forwarding" and "update_floatingip_port_forwarding". This patch makes this check explicit for the expected call. This patch is similar to [1]. [1]https://review.opendev.org/c/openstack/neutron/+/893028 Related-Bug: #2033387 Change-Id: I595dbd9b3abf413408fddf60735c0e8bd54e1d5c (cherry picked from commit 2f637b2)
1 parent 049fc36 commit 602bb1a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_maintenance.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,9 @@ def _verify_lb(test, protocol, vip_ext_port, vip_int_port):
906906
pf_def.INTERNAL_IP_ADDRESS: p1_ip}
907907
pf_obj = self.pf_plugin.create_floatingip_port_forwarding(
908908
self.context, fip_id, **fip_attrs(fip_pf_args))
909-
m_publish.assert_called_once()
909+
call = mock.call('port_forwarding', 'after_create', self.pf_plugin,
910+
payload=mock.ANY)
911+
m_publish.assert_has_calls([call])
910912

911913
# Assert load balancer for port forwarding was not created
912914
self.assertFalse(self._find_pf_lb(router_id, fip_id))
@@ -924,7 +926,9 @@ def _verify_lb(test, protocol, vip_ext_port, vip_int_port):
924926
m_publish.reset_mock()
925927
self.pf_plugin.update_floatingip_port_forwarding(
926928
self.context, pf_obj['id'], fip_id, **fip_attrs(fip_pf_args))
927-
m_publish.assert_called_once()
929+
call = mock.call('port_forwarding', 'after_update', self.pf_plugin,
930+
payload=mock.ANY)
931+
m_publish.assert_has_calls([call])
928932

929933
# Assert load balancer for port forwarding is stale
930934
_verify_lb(self, 'tcp', 2222, 22)

0 commit comments

Comments
 (0)