Files
python-tripleoclient/tripleoclient/tests/v1/overcloud_upgrade/fakes.py
mandreou 96ffa3a325 Adds Overcloud Upgrade class and entry points for major upgrade
This further refactors the update/upgrades cli and separates
the update and upgrade code. This adds the overcloud_upgrade.py
which defines the UpgradePrepare and UpgradeRun. The entry
points are now:

  openstack overcloud upgrade prepare --container-registry-file ...

For the no-op heat stack update to refresh stack outputs and

  openstack overcloud upgrade run --nodes foo --playbooks all

For running all the upgrade ansible playbooks. A corresponding
converge sub-command will be introduced in a subsequent patch.

Change-Id: I1880e8f546df8d509871ba3b4f02877e95c611c8
2018-03-02 14:44:58 +00:00

62 lines
1.8 KiB
Python

# Copyright 2015 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):
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 TestOvercloudUpgradePrepare(utils.TestCommand):
def setUp(self):
super(TestOvercloudUpgradePrepare, 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 TestOvercloudUpgradeRun(utils.TestCommand):
def setUp(self):
super(TestOvercloudUpgradeRun, 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()