Set up column when simulating port binding

The current northd in OVN 26.03 no longer considers port-up-notif
feature configured on the chassis [1] and in order to set an LSP.up
column it requires the corresponding PB.chassis AND PB.up being set,
as opposed to previous versions that considered only PB.chassis, if
port-up-notif was not set.

The LspBindCommand is used as an ovn-controller binding simulation and
hence since 24.03, where the port-notif-up was deprecated, should also
set the PB.up column along with the chassis.

This also mirrors what ovn-sbctl lsp-bind does:
aab84f8650/utilities/ovn-sbctl.c (L549)

[1] 83cf9cc9b3

Change-Id: I016e2fd5c27ee0748c5e4e48251443e634fd5c91
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
This commit is contained in:
Jakub Libosvar
2026-03-05 15:38:19 -05:00
parent 9df3d19c23
commit a8dcb36c33
2 changed files with 5 additions and 0 deletions

View File

@@ -104,6 +104,7 @@ class LspBindCommand(cmd.BaseCommand):
raise RuntimeError("Port %s already bound to %s" % (self.port,
self.chassis))
binding.chassis = chassis
binding.up = [True]
class LspUnbindCommand(cmd.BaseCommand):
@@ -121,3 +122,4 @@ class LspUnbindCommand(cmd.BaseCommand):
return
raise
binding.chassis = []
binding.up = [False]

View File

@@ -106,6 +106,7 @@ class OvnSouthboundTest(base.FunctionalTestCase):
binding = idlutils.row_by_value(self.api.idl, 'Port_Binding',
'logical_port', port.name)
self.assertIn(chassis, binding.chassis)
self.assertCountEqual([True], binding.up)
return chassis, switch, port
def test_lsp_bind_exists(self):
@@ -123,6 +124,7 @@ class OvnSouthboundTest(base.FunctionalTestCase):
'logical_port', port.name)
self.assertNotIn(other, binding.chassis)
self.assertIn(chassis, binding.chassis)
self.assertCountEqual([True], binding.up)
def test_lsp_unbind(self):
_chassis, _switch, port = self.test_lsp_bind()
@@ -130,6 +132,7 @@ class OvnSouthboundTest(base.FunctionalTestCase):
binding = idlutils.row_by_value(self.api.idl, 'Port_Binding',
'logical_port', port.name)
self.assertEqual([], binding.chassis)
self.assertCountEqual([False], binding.up)
def test_lsp_unbind_no_exist(self):
cmd = self.api.lsp_unbind(utils.get_rand_device_name())