Skip to content

Commit 6b86538

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 92e27a0 commit 6b86538

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
@@ -1005,7 +1005,9 @@ def _verify_lb(test, protocol, vip_ext_port, vip_int_port):
10051005
pf_def.INTERNAL_IP_ADDRESS: p1_ip}
10061006
pf_obj = self.pf_plugin.create_floatingip_port_forwarding(
10071007
self.context, fip_id, **fip_attrs(fip_pf_args))
1008-
m_publish.assert_called_once()
1008+
call = mock.call('port_forwarding', 'after_create', self.pf_plugin,
1009+
payload=mock.ANY)
1010+
m_publish.assert_has_calls([call])
10091011

10101012
# Assert load balancer for port forwarding was not created
10111013
self.assertFalse(self._find_pf_lb(router_id, fip_id))
@@ -1023,7 +1025,9 @@ def _verify_lb(test, protocol, vip_ext_port, vip_int_port):
10231025
m_publish.reset_mock()
10241026
self.pf_plugin.update_floatingip_port_forwarding(
10251027
self.context, pf_obj['id'], fip_id, **fip_attrs(fip_pf_args))
1026-
m_publish.assert_called_once()
1028+
call = mock.call('port_forwarding', 'after_update', self.pf_plugin,
1029+
payload=mock.ANY)
1030+
m_publish.assert_has_calls([call])
10271031

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

0 commit comments

Comments
 (0)