nb: set chassis_name for new gateway chassis
Set the passed 'chassis_name' on created gateway chassis. According to https://github.com/ovn-org/ovn/blob/main/ovn-nb.ovsschema#L538 Closses-Bug: #1946746 Change-Id: I4309b793c5d7b5b335e4d37fa7ced30b9f034b48
This commit is contained in:
parent
47a01029f5
commit
0e4c7a056c
@ -1473,6 +1473,7 @@ class GatewayChassisAddCommand(cmd.AddCommand):
|
||||
# since 'name' is indexed
|
||||
gwc = txn.insert(self.api.tables[self.table_name])
|
||||
gwc.name = self.name
|
||||
gwc.chassis_name = self.chassis_name
|
||||
gwc.priority = self.priority
|
||||
self.set_columns(gwc, **self.columns)
|
||||
self.result = gwc
|
||||
|
@ -1218,6 +1218,15 @@ class TestLogicalRouterPortOps(OvnNorthboundTest):
|
||||
self.assertIn(c1, lrp.gateway_chassis)
|
||||
self.assertIn(c2, lrp.gateway_chassis)
|
||||
|
||||
def test_gwc_add(self):
|
||||
# NOTE: no API method to create gateway chassis directly
|
||||
name, c1_name = [utils.get_rand_device_name() for _ in range(2)]
|
||||
lrp = self._lrp_add(name, gateway_chassis=[c1_name])
|
||||
c1 = self.api.lookup('Gateway_Chassis', "%s_%s" % (lrp.name, c1_name))
|
||||
self.assertEqual(c1.name, "%s_%s" % (lrp.name, c1_name))
|
||||
self.assertEqual(c1.chassis_name, c1_name)
|
||||
self.assertEqual(c1.priority, 1)
|
||||
|
||||
def test_lrp_del_uuid(self):
|
||||
lrp = self._lrp_add(None)
|
||||
self.api.lrp_del(lrp.uuid).execute(check_error=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user