
Before we update the heat stack for the ffwd-upgrade prepare we can use this to run any required commands on the overcloud. The current use case is removal of the /usr/libexec/os-apply-config/templates/etc/os-net-config/config.json Otherwise after the upgrade prepare is executed, overcloud nodes will have empty config.json for os-net-config (also discussed [0]) The current implementation of .deployment.v1.deploy_on_servers assumes all servers are managed by nova. This is OK for N..Q ffu but we will need to revisit in future, see [1] for more info. [0]: https://bugzilla.redhat.com/show_bug.cgi?id=1561255 [1]: https://bugs.launchpad.net/tripleo/+bug/1770356 Related-Bug: 1758161 Related: tripleo-common Ic138c4925c5c96d1cf718af7ae59bcf5f0ba96dc Change-Id: I77fdc9deab97c785725f09b8529c512950753f86
74 lines
2.3 KiB
Python
74 lines
2.3 KiB
Python
# Copyright 2018 Red Hat, Inc.
|
|
#
|
|
# 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.
|
|
#
|
|
|
|
import mock
|
|
from osc_lib.tests import utils
|
|
|
|
from tripleoclient.tests import fakes
|
|
|
|
|
|
class FakeClientWrapper(object):
|
|
|
|
def __init__(self):
|
|
self._instance = mock.Mock()
|
|
self.object_store = FakeObjectClient()
|
|
|
|
def messaging_websocket(self, queue="tripleo"):
|
|
return fakes.FakeWebSocket()
|
|
|
|
|
|
class FakeObjectClient(object):
|
|
|
|
def __init__(self):
|
|
self._instance = mock.Mock()
|
|
self.put_object = mock.Mock()
|
|
|
|
def get_object(self, *args):
|
|
return
|
|
|
|
|
|
class TestFFWDUpgradePrepare(utils.TestCommand):
|
|
|
|
def setUp(self):
|
|
super(TestFFWDUpgradePrepare, self).setUp()
|
|
|
|
self.app.client_manager.auth_ref = mock.Mock(auth_token="TOKEN")
|
|
self.app.client_manager.baremetal = mock.Mock()
|
|
self.app.client_manager.orchestration = mock.Mock()
|
|
self.app.client_manager.tripleoclient = FakeClientWrapper()
|
|
self.app.client_manager.workflow_engine = mock.Mock()
|
|
|
|
|
|
class TestFFWDUpgradeRun(utils.TestCommand):
|
|
|
|
def setUp(self):
|
|
super(TestFFWDUpgradeRun, self).setUp()
|
|
|
|
self.app.client_manager.auth_ref = mock.Mock(auth_token="TOKEN")
|
|
self.app.client_manager.tripleoclient = FakeClientWrapper()
|
|
self.app.client_manager.workflow_engine = mock.Mock()
|
|
|
|
|
|
class TestFFWDUpgradeConverge(utils.TestCommand):
|
|
|
|
def setUp(self):
|
|
super(TestFFWDUpgradeConverge, self).setUp()
|
|
|
|
self.app.client_manager.auth_ref = mock.Mock(auth_token="TOKEN")
|
|
self.app.client_manager.baremetal = mock.Mock()
|
|
self.app.client_manager.orchestration = mock.Mock()
|
|
self.app.client_manager.tripleoclient = FakeClientWrapper()
|
|
self.app.client_manager.workflow_engine = mock.Mock()
|