Fix couple of issues in tests

- Separete idempotency tests from bvt
- Idempotency tests now using failover group
- Createmirror tests now using simple snapshots as basic cluster
- Upgrade minor version tests now using official public repos
- Adjust test group for updating box murano with murano-node

Change-Id: I1bc5a2338a539fb9cb2f0edaa8cea7e16830dd29
This commit is contained in:
Victor Ryzhenkin 2016-11-07 20:56:27 +03:00
parent f0b084433e
commit 55f343d02c
9 changed files with 193 additions and 179 deletions

View File

@ -653,14 +653,9 @@ class PluginHelper(object):
ip=self.ssh_manager.admin_ip,
command=cmd)
def install_mu(self, repos='proposed'):
if repos:
cmd = "fuel2 update install --env {} --repos {} " \
"--restart-rabbit --restart-mysql".format(self.cluster_id,
repos)
else:
cmd = "fuel2 update install --env {}" \
"--restart-rabbit --restart-mysql ".format(self.cluster_id)
def install_mu(self):
cmd = "fuel2 update install --env {}" \
"--restart-rabbit --restart-mysql".format(self.cluster_id)
std_out = self.ssh_manager.check_call(
ip=self.ssh_manager.admin_ip,
@ -722,5 +717,22 @@ class PluginHelper(object):
def compare_pid(self, old_pid, new_pid):
asserts.assert_equal(old_pid, new_pid,
'PID has changed after executing' \
'PID has changed after executing'
'setup_repositories command')
def add_update_repo(self):
ip = self.ssh_manager.admin_ip
logger.info("Adding update mirror")
cmd = ("yum-config-manager --add-repo=http://mirror.fuel-infra.org/"
"mos-repos/centos/mos9.0-centos7/updates/x86_64/")
self.ssh_manager.execute_on_remote(ip, cmd,
err_msg="Adding repo failed")
logger.info("Importing GPG keys")
cmd = ("rpm --import http://mirror.fuel-infra.org/mos-repos/"
"centos/mos9.0-centos7/updates/RPM-GPG-KEY-mos9.0")
self.ssh_manager.execute_on_remote(ip, cmd,
err_msg="GPG keys import failed")
logger.info("Cleaning yum cache")
cmd = "yum clean all"
self.ssh_manager.execute_on_remote(
ip, cmd, err_msg="yum cache flush unsuccessful")

View File

@ -19,8 +19,6 @@ from fuelweb_test.helpers.decorators import retry
from fuelweb_test import logger
from fuelweb_test.tests import base_test_case
from murano_plugin_tests import settings
from murano_plugin_tests.helpers import checkers
from murano_plugin_tests.helpers import helpers
from murano_plugin_tests.helpers import remote_ops
@ -167,9 +165,9 @@ class MuranoPluginApi(object):
operations[operation](target_node)
self.wait_plugin_online()
def apply_maintenance_update_90_to_91(self):
def apply_maintenance_update(self):
"""Method applies maintenance updates on whole cluster
from MOS9.0 to MOS9.1
from MOS 9.0 to MOS 9.x
1) Add latest proposed repository
2) Import PGP key for installed repository
@ -184,25 +182,7 @@ class MuranoPluginApi(object):
Mirantis OpenStack 9.1 - Potential updates: ALL NODES UP-TO-DATE
"""
logger.info("Add latest proposed repository")
timestamp = settings.MOS_CENTOS_PROPOSED_MIRROR_ID
self.helpers.add_centos_test_proposed_repo(
settings.CENTOS_REPO_URL, timestamp)
logger.info("Add extra Ubuntu repo to deployed cluster")
timestamp_ubuntu = settings.MOS_UBUNTU_MIRROR_ID
proposed = {
'name': 'proposed',
'section': 'main restricted',
'uri': settings.UBUNTU_REPO_URL + timestamp_ubuntu + '/',
'priority': 1200,
'suite': 'mos9.0-proposed',
'type': 'deb'}
self.helpers.add_cluster_repo(proposed)
self.helpers.add_update_repo()
logger.info("Install python-cudet library")

View File

@ -107,3 +107,40 @@ class TestMuranoFailover(api.MuranoPluginApi):
"""
self._test_failover("hard_reboot", ["controller"],
"deploy_murano_plugin_on_controller")
@test(depends_on_groups=["deploy_murano_plugin_on_controller"],
groups=["mirror", "system", "failover",
"create_mirror_and_check_murano_services"])
@log_snapshot_after_test
def create_mirror_and_check_murano_services(self):
"""Verify that Murano services is alive after fuel create mirror
Scenario:
1. Revert snapshot with deployed cluster
(deploy_murano_plugin_in_environment_with_murano)
2. Save PID of the plugin services
3. Execute setup_repositories command for murano-node
from master node
4. Check that PID wasn't changed
5. Check that plugin is working
6. Run Murano Platform OSTF
Duration 45m
Snapshot create_mirror_and_check_murano_services
"""
self.env.revert_snapshot(
"deploy_murano_plugin_on_controller")
pid = self.helpers.get_plugin_pid('murano')
self.helpers.fuel_create_repositories(
self.helpers.get_all_ready_nodes())
new_pid = self.helpers.get_plugin_pid('murano')
self.helpers.compare_pid(pid, new_pid)
self.check_plugin_online()
self.env.make_snapshot("create_mirror_and_check_murano_services",
is_make=False)

View File

@ -0,0 +1,126 @@
# 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 fuelweb_test.helpers.decorators import log_snapshot_after_test
from proboscis import test
from murano_plugin_tests.murano_plugin import api
@test(groups=["plugins"])
class TestMuranoPuppetIdempotency(api.MuranoPluginApi):
"""Class for testing puppet idempotency for Murano plugin."""
@test(depends_on_groups=["deploy_murano_plugin_on_controller"],
groups=["check_plugin_idempotency_on_controller", "deploy",
"murano", "idempotency", "failover"])
@log_snapshot_after_test
def check_plugin_idempotency_on_controller(self):
"""Rerun puppet apply on controller and check plugin idempotency.
Scenario:
1. Revert snapshot with deployed cluster (controller + compute)
2. Run puppet apply for controller
Duration 10m
"""
self.env.revert_snapshot("deploy_murano_plugin_on_controller")
plugin_path = '/etc/fuel/plugins/detach-murano-1.0/'
modules_path = plugin_path + 'modules:/etc/puppet/modules/'
plugin_manifest_path = plugin_path + 'manifests/'
cluster_id = self.fuel_web.get_last_created_cluster()
attr = self.fuel_web.client.get_cluster_attributes(cluster_id)
cfapi = attr['editable']['detach-murano']['metadata']['versions'][0][
'murano_cfapi']
contr_node = self.fuel_web.get_nailgun_node_by_name('slave-01')
list_controller_manifests = ['murano_hiera_override.pp',
'pin_murano_plugin_repo.pp',
'murano.pp',
'murano_rabbitmq.pp',
'murano_keystone.pp',
'murano_db.pp',
'murano_dashboard.pp'
'import_murano_package.pp',
'murano_logging.pp',
'update_openrc.pp',
'murano_haproxy.pp']
if cfapi['value']:
list_controller_manifests.insert(4, 'murano_cfapi.pp')
for manifest in list_controller_manifests:
cmd = 'puppet apply --modulepath={0} {1} {2}'.format(
modules_path, plugin_manifest_path + manifest, '-d --test')
self.ssh_manager.check_call(ip=contr_node['ip'],
command=cmd,
expected=[0])
@test(depends_on_groups=["deploy_murano_plugin"],
groups=["check_plugin_idempotency_on_murano_node", "deploy",
"murano", "idempotency", "failover"])
@log_snapshot_after_test
def check_plugin_idempotency_on_murano_node(self):
"""Rerun puppet apply on murano node and check plugin idempotency.
Scenario:
1. Revert snapshot with deployed cluster
2. Run puppet apply for murano node
Duration 10m
"""
self.env.revert_snapshot("deploy_murano_plugin")
plugin_path = '/etc/fuel/plugins/detach-murano-1.0/'
modules_path = plugin_path + 'modules:/etc/puppet/modules/'
plugin_manifest_path = plugin_path + 'manifests/'
ssl_path = '/etc/puppet/modules/osnailyfacter/modular/ssl/'
cluster_id = self.fuel_web.get_last_created_cluster()
attr = self.fuel_web.client.get_cluster_attributes(cluster_id)
cfapi = attr['editable']['detach-murano']['metadata']['versions'][0][
'murano_cfapi']
murano_node = self.fuel_web.get_nailgun_node_by_name('slave-03')
list_murano_manifests = ['murano_hiera_override.pp',
'pin_murano_plugin_repo.pp',
'murano.pp',
'murano_rabbitmq.pp',
'import_murano_package.pp',
'murano_logging.pp']
if cfapi['value']:
list_murano_manifests.insert(4, 'murano_cfapi.pp')
list_ssl_manifests = ['ssl_keys_saving.pp',
'ssl_add_trust_chain.pp',
'ssl_dns_setup.pp']
for manifest in list_murano_manifests:
cmd = 'puppet apply --modulepath={0} {1} {2}'.format(
modules_path, plugin_manifest_path + manifest, '-d --test')
self.ssh_manager.check_call(ip=murano_node['ip'],
command=cmd,
expected=[0])
for manifest in list_ssl_manifests:
cmd = 'puppet apply --modulepath={0} {1} {2}'.format(
modules_path, ssl_path + manifest, '-d --test')
self.ssh_manager.check_call(ip=murano_node['ip'],
command=cmd,
expected=[0])

View File

@ -24,7 +24,7 @@ class TestMuranoPluginMU(api.MuranoPluginApi):
@test(depends_on_groups=["deploy_murano_plugin"],
groups=["test_mu_upgrade_murano_node", "murano",
"test_mu_upgrade", "murano_plugin_upgrade"])
"test_mu_upgrade", "maintenance_update"])
@log_snapshot_after_test
def test_mu_upgrade_murano_node(self):
"""Apply MU over cluster with plugin and Murano node
@ -43,13 +43,13 @@ class TestMuranoPluginMU(api.MuranoPluginApi):
self.env.revert_snapshot("deploy_murano_plugin")
self.wait_plugin_online()
self.apply_maintenance_update_90_to_91()
self.apply_maintenance_update()
self.run_ostf(['sanity', 'smoke'])
self.check_plugin_online()
@test(depends_on_groups=["deploy_murano_plugin_on_controller"],
groups=["test_mu_upgrade_murano_plugin", "murano",
"test_mu_upgrade", "murano_plugin_upgrade"])
"test_mu_upgrade", "maintenance_update"])
@log_snapshot_after_test
def test_mu_upgrade_without_murano_node(self):
"""Apply MU over cluster with plugin without Murano node
@ -68,6 +68,6 @@ class TestMuranoPluginMU(api.MuranoPluginApi):
self.env.revert_snapshot("deploy_murano_plugin_on_controller")
self.wait_plugin_online()
self.apply_maintenance_update_90_to_91()
self.apply_maintenance_update()
self.run_ostf(['sanity', 'smoke'])
self.check_plugin_online()

View File

@ -245,104 +245,3 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
self.prepare_plugin()
self.uninstall_plugin()
@test(depends_on_groups=["deploy_murano_plugin_on_controller"],
groups=["check_plugin_idempotency_on_controller", "deploy",
"murano", "idempotency"])
@log_snapshot_after_test
def check_plugin_idempotency_on_controller(self):
"""Rerun puppet apply on controller and check plugin idempotency.
Scenario:
1. Revert snapshot with deployed cluster (controller + compute)
2. Run puppet apply for controller
Duration 10m
"""
self.env.revert_snapshot("deploy_murano_plugin_on_controller")
plugin_path = '/etc/fuel/plugins/detach-murano-1.0/'
modules_path = plugin_path + 'modules:/etc/puppet/modules/'
plugin_manifest_path = plugin_path + 'manifests/'
cluster_id = self.fuel_web.get_last_created_cluster()
attr = self.fuel_web.client.get_cluster_attributes(cluster_id)
cfapi = attr['editable']['detach-murano']['metadata']['versions'][0]['murano_cfapi']
contr_node = self.fuel_web.get_nailgun_node_by_name('slave-01')
list_controller_manifests = ['murano_hiera_override.pp',
'pin_murano_plugin_repo.pp',
'murano.pp',
'murano_rabbitmq.pp',
'murano_keystone.pp',
'murano_db.pp',
'murano_dashboard.pp'
'import_murano_package.pp',
'murano_logging.pp',
'update_openrc.pp',
'murano_haproxy.pp']
if cfapi['value']:
list_controller_manifests.insert(4, 'murano_cfapi.pp')
for manifest in list_controller_manifests:
cmd = 'puppet apply --modulepath={0} {1} {2}'.format(
modules_path, plugin_manifest_path + manifest, '-d --test')
self.ssh_manager.check_call(ip=contr_node['ip'],
command=cmd,
expected=[0])
@test(depends_on_groups=["deploy_murano_plugin"],
groups=["check_plugin_idempotency_on_murano_node", "deploy",
"murano", "idempotency"])
@log_snapshot_after_test
def check_plugin_idempotency_on_murano_node(self):
"""Rerun puppet apply on murano node and check plugin idempotency.
Scenario:
1. Revert snapshot with deployed cluster
2. Run puppet apply for murano node
Duration 10m
"""
self.env.revert_snapshot("deploy_murano_plugin")
plugin_path = '/etc/fuel/plugins/detach-murano-1.0/'
modules_path = plugin_path + 'modules:/etc/puppet/modules/'
plugin_manifest_path = plugin_path + 'manifests/'
ssl_path = '/etc/puppet/modules/osnailyfacter/modular/ssl/'
cluster_id = self.fuel_web.get_last_created_cluster()
attr = self.fuel_web.client.get_cluster_attributes(cluster_id)
cfapi = attr['editable']['detach-murano']['metadata']['versions'][0]['murano_cfapi']
murano_node = self.fuel_web.get_nailgun_node_by_name('slave-03')
list_murano_manifests = ['murano_hiera_override.pp',
'pin_murano_plugin_repo.pp',
'murano.pp',
'murano_rabbitmq.pp',
'import_murano_package.pp',
'murano_logging.pp']
if cfapi['value']:
list_murano_manifests.insert(4, 'murano_cfapi.pp')
list_ssl_manifests = ['ssl_keys_saving.pp',
'ssl_add_trust_chain.pp',
'ssl_dns_setup.pp']
for manifest in list_murano_manifests:
cmd = 'puppet apply --modulepath={0} {1} {2}'.format(
modules_path, plugin_manifest_path + manifest, '-d --test')
self.ssh_manager.check_call(ip=murano_node['ip'],
command=cmd,
expected=[0])
for manifest in list_ssl_manifests:
cmd = 'puppet apply --modulepath={0} {1} {2}'.format(
modules_path, ssl_path + manifest, '-d --test')
self.ssh_manager.check_call(ip=murano_node['ip'],
command=cmd,
expected=[0])

View File

@ -86,7 +86,7 @@ class TestMuranoPluginUpdate(api.MuranoPluginApi):
@test(depends_on=[deploy_murano_out_of_the_box],
groups=["deploy_murano_and_plugin_add_role", "deploy",
"murano", "murano_plugin_upgrade",
"deploy_murano_plugin_in_environment_with_murano"])
"deploy_murano_node_in_environment_with_murano"])
@log_snapshot_after_test
def deploy_murano_node_in_environment_with_murano(self):
"""Upgrade Murano via plugin (adding murano-node) and run OSTF tests.

View File

@ -132,44 +132,3 @@ class TestSystemMuranoPlugin(api.MuranoPluginApi):
self.run_ostf(['sanity', 'smoke', 'ha'])
self.env.make_snapshot("add_remove_murano_node", is_make=False)
@test(depends_on_groups=["deploy_murano_plugin_in_environment_with_murano"],
groups=["mirror", "system", "failover",
"create_mirror_and_check_murano_services"])
@log_snapshot_after_test
def create_mirror_and_check_murano_services(self):
"""Verify that Murano services is alive after fuel create mirror
Scenario:
1. Revert snapshot with deployed cluster
(deploy_murano_plugin_in_environment_with_murano)
2. Save PID of the plugin services
3. Execute setup_repositories command for murano-node
from master node
4. Check that PID wasn't changed
5. Check that plugin is working
6. Run Murano Platform OSTF
Duration 45m
Snapshot create_mirror_and_check_murano_services
"""
self.env.revert_snapshot(
"deploy_murano_plugin_in_environment_with_murano")
pid = self.helpers.get_plugin_pid('murano')
self.helpers.fuel_create_repositories(
self.helpers.get_all_ready_nodes())
new_pid = self.helpers.get_plugin_pid('murano')
self.helpers.compare_pid(pid, new_pid)
self.check_plugin_online()
self.run_ostf(['sanity', 'smoke', 'ha'])
self.check_plugin_online()
self.env.make_snapshot("create_mirror_and_check_murano_services",
is_make=False)

View File

@ -40,6 +40,7 @@ class CloseSSHConnectionsPlugin(plugins.Plugin):
def import_tests():
from murano_plugin import test_failover # noqa
from murano_plugin import test_idempotency # noqa
from murano_plugin import test_murano_maintenance_update # noqa
from murano_plugin import test_murano_plugin_bvt # noqa
from murano_plugin import test_murano_plugin_update # noqa