Add uca deploy test scenario

blueprint deploy-with-uca-packages

Change-Id: Ie807456b401bfb9c1f8596cf90c94cfc996eb60c
This commit is contained in:
Matthew Mosesohn 2016-02-18 13:55:08 +03:00
parent af148e1a8c
commit e5fb8edd47
6 changed files with 149 additions and 0 deletions

View File

@ -302,6 +302,11 @@ Test CentOS bootstrap
.. automodule:: fuelweb_test.tests.test_centos_bootstrap
:members:
Test Ubuntu Cloud Archive
-------------------------
.. automodule:: fuelweb_test.tests.test_uca
:members:
Test Vcenter
------------
.. automodule:: fuelweb_test.tests.test_vcenter

View File

@ -0,0 +1,43 @@
# Copyright 2016 Mirantis, 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.
from proboscis import asserts
from fuelweb_test import settings
def change_cluster_uca_config(cluster_attributes):
'Returns cluster attributes with UCA repo configuration.'
# check attributes have uca options
for option in ["repo_type", "uca_repo_url", "uca_openstack_release",
"pin_haproxy", "pin_rabbitmq", "pin_ceph"]:
asserts.assert_true(
option in cluster_attributes["editable"]["repo_setup"],
"{0} is not in cluster attributes: {1}".
format(option, str(cluster_attributes["editable"]["repo_setup"])))
# enable UCA repository
uca_options = cluster_attributes["editable"]["repo_setup"]
uca_options["repo_type"]["value"] = settings.UCA_REPO_TYPE
uca_options["uca_repo_url"]["value"] = settings.UCA_REPO_URL
uca_options["uca_openstack_release"]["value"] = settings.UCA_RELEASE
uca_options["pin_haproxy"]["value"] = settings.UCA_PIN_HAPROXY
uca_options["pin_rabbitmq"]["value"] = settings.UCA_PIN_RABBITMQ
uca_options["pin_ceph"]["value"] = settings.UCA_PIN_RABBITMQ
return cluster_attributes

View File

@ -52,6 +52,7 @@ from fuelweb_test.helpers.security import SecurityChecks
from fuelweb_test.helpers.ssh_manager import SSHManager
from fuelweb_test.helpers.ssl import change_cluster_ssl_config
from fuelweb_test.helpers.ssl import copy_cert_from_master
from fuelweb_test.helpers.uca import change_cluster_uca_config
from fuelweb_test.helpers.utils import get_node_hiera_roles
from fuelweb_test.helpers.utils import node_freemem
from fuelweb_test.helpers.utils import pretty_log
@ -79,6 +80,7 @@ from fuelweb_test.settings import REPLACE_DEFAULT_REPOS
from fuelweb_test.settings import REPLACE_DEFAULT_REPOS_ONLY_ONCE
from fuelweb_test.settings import SSL_CN
from fuelweb_test.settings import TIMEOUT
from fuelweb_test.settings import UCA_ENABLED
from fuelweb_test.settings import USER_OWNED_CERT
from fuelweb_test.settings import VCENTER_DATACENTER
from fuelweb_test.settings import VCENTER_DATASTORE
@ -578,6 +580,9 @@ class FuelWebClient(object):
if configure_ssl:
self.ssl_configure(cluster_id)
if UCA_ENABLED or settings.get('uca_enabled', False):
self.enable_uca(cluster_id)
if not cluster_id:
raise Exception("Could not get cluster '%s'" % name)
# TODO: rw105719
@ -594,6 +599,14 @@ class FuelWebClient(object):
"with next attributes {0}".format(attributes))
self.client.update_cluster_attributes(cluster_id, attributes)
@logwrap
def enable_uca(self, cluster_id):
attributes = self.client.get_cluster_attributes(cluster_id)
change_cluster_uca_config(attributes)
logger.debug("Try to update cluster "
"with next attributes {0}".format(attributes))
self.client.update_cluster_attributes(cluster_id, attributes)
@logwrap
def vcenter_configure(self, cluster_id, vcenter_value=None,
multiclusters=None, vc_glance=None,

View File

@ -566,6 +566,16 @@ EMC_USERNAME = os.environ.get('EMC_USERNAME')
EMC_PASSWORD = os.environ.get('EMC_PASSWORD')
EMC_POOL_NAME = os.environ.get('EMC_POOL_NAME', '')
UCA_ENABLED = os.environ.get('UCA_ENABLED', False)
UCA_REPO_TYPE = os.environ.get('UCA_REPO_TYPE', 'uca')
UCA_REPO_URL = os.environ.get(
'UCA_REPO_URL',
'http://ubuntu-cloud.archive.canonical.com/ubuntu')
UCA_RELEASE = os.environ.get('UCA_RELEASE', 'mitaka')
UCA_PIN_HAPROXY = get_var_as_bool('UCA_PIN_HAPROXY', True)
UCA_PIN_RABBITMQ = get_var_as_bool('UCA_PIN_RABBITMQ', True)
UCA_PIN_CEPH = get_var_as_bool('UCA_PIN_CEPH', True)
ALWAYS_CREATE_DIAGNOSTIC_SNAPSHOT = get_var_as_bool(
'ALWAYS_CREATE_DIAGNOSTIC_SNAPSHOT', False)

View File

View File

@ -0,0 +1,78 @@
# Copyright 2016 Mirantis, 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.
from proboscis import test
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test.tests.base_test_case import SetupEnvironment
from fuelweb_test.tests.base_test_case import TestBasic
@test(groups=["uca_neutron_ha"])
class UCATest(TestBasic):
"""UCATest.""" # TODO(mattymo) documentation
@test(depends_on=[SetupEnvironment.prepare_slaves_5],
groups=["uca_neutron_ha"])
@log_snapshot_after_test
def uca_neutron_ha(self):
"""Deploy cluster in ha mode with UCA repo
Scenario:
1. Create cluster
2. Enable UCA configuration
3. Add 3 nodes with controller role
4. Add 2 nodes with compute+cinder role
5. Deploy the cluster
6. Run network verification
7. Run OSTF
Duration 60m
Snapshot uca_neutron_ha
"""
self.env.revert_snapshot("ready_with_5_slaves")
uca_enabled = {'uca_enabled': True}
self.show_step(1, initialize=True)
self.show_step(2)
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=settings.DEPLOYMENT_MODE,
settings=uca_enabled
)
self.show_step(3)
self.show_step(4)
self.fuel_web.update_nodes(
cluster_id,
{
'slave-01': ['controller'],
'slave-02': ['controller'],
'slave-03': ['controller'],
'slave-04': ['compute', 'cinder'],
'slave-05': ['compute', 'cinder'],
}
)
self.show_step(5)
self.fuel_web.deploy_cluster_wait(cluster_id)
self.show_step(6)
self.fuel_web.verify_network(cluster_id)
self.show_step(7)
self.fuel_web.run_ostf(cluster_id=cluster_id)
self.env.make_snapshot("uca_neutron_ha")