
1. What is the problem Our current mechanism to handle dhcp port creation is that we first create the top dhcp port, then use the allocated ip to create the bottom dhcp port. If we get an "IpAddressInUse" error, meaning that bottom dhcp agent has already created the dhcp port with the same ip, we just reuse the port; otherwise, we successfully create the bottom dhcp port, we remove other dhcp ports with different ips, so dhcp agent can be notified and use the bottom dhcp port we create. However, we find that this mechanism doesn't work in the following situation. Dhcp agent may create the bottom dhcp port after we do the check about whether other dhcp ports exist, so we don't remove the dhcp port created by dhcp agent, thus we end up with two bottom dhcp ports, one is created by dhcp agent, one is created by us. 2. What is the solution to the problem Create bottom subnet with dhcp disabled, so dhcp agent will not be scheduled, then create bottom dhcp port and update bottom subnet to enable dhcp. Finding that there is already a reserved dhcp port, dhcp agent will not create another dhcp port and directly use the existing one. 3. What the features need to be implemented to the Tricircle to realize the solution No new feature introuduced. Change-Id: I8bb8622b34b709edef230d1f1c985e3fabd5adb0
41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
# Copyright (c) 2015 Huawei Technologies Co., Ltd.
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from neutron.conf import common as n_conf
|
|
from oslo_config import cfg
|
|
from oslotest import base
|
|
|
|
|
|
CONFLICT_OPT_NAMES = [
|
|
'api_extensions_path',
|
|
'bind_port',
|
|
'bind_host',
|
|
'allow_pagination',
|
|
'allow_sorting'
|
|
]
|
|
|
|
|
|
class TestCase(base.BaseTestCase):
|
|
"""Test case base class for all unit tests."""
|
|
def setUp(self):
|
|
# neutron has configuration options "api_extensions_path",
|
|
# "bind_port" and "bind_host"which conflicts with tricircle
|
|
# configuration option, so unregister this option before
|
|
# running tricircle tests
|
|
for opt in n_conf.core_opts:
|
|
if opt.name in CONFLICT_OPT_NAMES:
|
|
cfg.CONF.unregister_opt(opt)
|
|
super(TestCase, self).setUp()
|