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]83cf9cc9b3Change-Id: I016e2fd5c27ee0748c5e4e48251443e634fd5c91 Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user