Files
distcloud/distributedcloud/dccommon/tests/base.py
Yuxing Jiang 4d577ff461 Skip route creation if a route is configured
This commit adds pre-check if a route is already configured before
adding a route, skips the route creation request to prevent the
DC operation blocked by the failed sysinv route creation response due
to existing route.

Test plan:
1. Pre-add static route before subcloud add, the subcloud add
operation can skip the route create request. The subcloud can be
online after deployment.
2. Add 1000 static routes to the system controllers before subcloud
deployment, batch deploy a large number of subclouds. All the
subclouds can be deployed successfully w/o the pre-deploy failure, the
subclouds become online after the deployment. Logs about skipping the
route creation due to existing route can be found in dcmanager.log

Story: 2010719
Task: 48620

Signed-off-by: Yuxing Jiang <Yuxing.Jiang@windriver.com>
Change-Id: If5475f182d9911c23467a071396bb8207bb30804
2023-08-15 12:12:36 -04:00

46 lines
1.4 KiB
Python

# Copyright (c) 2015 Ericsson AB
# Copyright (c) 2020-2023 Wind River Systems, Inc.
# 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 dccommon.tests import utils
from oslotest import base
KEYSTONE_ENDPOINT_0 = [
"9785cc7f99b6469ba6fe89bd8d5b9072", "NULL", "admin",
"7d48ddb964034eb588e557b976d11cdf", "http://[fd01:1::2]:9292", "{}", True,
"SystemController"
]
ROUTE_0 = [
"2018-04-11 17:01:49.654734", "NULL", "NULL", 1,
"3a07ca95-d6fe-48cb-9393-b949f800b552", 6,
"fd01:2::", 64, "fd01:1::1", 1, 9
]
ROUTE_1 = [
"2018-04-11 17:01:49.654734", "NULL", "NULL", 1,
"3a07ca95-d6fe-48cb-9393-b949f800b552", 6,
"fd01:3::", 64, "fd01:1::1", 1, 9
]
class DCCommonTestCase(base.BaseTestCase):
"""Test case base class for all unit tests."""
def setUp(self):
super(DCCommonTestCase, self).setUp()
self.ctx = utils.dummy_context()