Skip to content

Commit c4b3225

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 98a3eae commit c4b3225

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
@@ -908,7 +908,9 @@ def _verify_lb(test, protocol, vip_ext_port, vip_int_port):
908908
pf_def.INTERNAL_IP_ADDRESS: p1_ip}
909909
pf_obj = self.pf_plugin.create_floatingip_port_forwarding(
910910
self.context, fip_id, **fip_attrs(fip_pf_args))
911-
m_publish.assert_called_once()
911+
call = mock.call('port_forwarding', 'after_create', self.pf_plugin,
912+
payload=mock.ANY)
913+
m_publish.assert_has_calls([call])
912914

913915
# Assert load balancer for port forwarding was not created
914916
self.assertFalse(self._find_pf_lb(router_id, fip_id))
@@ -926,7 +928,9 @@ def _verify_lb(test, protocol, vip_ext_port, vip_int_port):
926928
m_publish.reset_mock()
927929
self.pf_plugin.update_floatingip_port_forwarding(
928930
self.context, pf_obj['id'], fip_id, **fip_attrs(fip_pf_args))
929-
m_publish.assert_called_once()
931+
call = mock.call('port_forwarding', 'after_update', self.pf_plugin,
932+
payload=mock.ANY)
933+
m_publish.assert_has_calls([call])
930934

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

0 commit comments

Comments
 (0)