Move define_custom_groups to system_test package

Add function for adding custom group which checks presence
    the config file

Implement blueprint template-based-testcases

Change-Id: I4347754749cc5d7fb3c46eeebea6cb0097551777
This commit is contained in:
Dmitry Tyzhnenko 2015-12-17 18:18:39 +02:00 committed by Dmitry Tyzhnenko
parent cc5592bdff
commit 8f54429f75
2 changed files with 58 additions and 29 deletions

View File

@ -18,35 +18,6 @@ import sys
from nose.plugins import Plugin
from paramiko.transport import _join_lingering_threads
from proboscis import register
def define_custom_groups():
# Should move to system_test.__init__.py after upgrade devops to 2.9.13
groups_list = [
{"groups": ["system_test.ceph_ha"],
"depends": [
"system_test.deploy_and_check_radosgw("
"ceph_all_on_neutron_vlan)"]},
{"groups": ["filling_root"],
"depends": [
"system_test.failover.filling_root("
"ceph_all_on_neutron_vlan)"]},
{"groups": ["system_test.strength"],
"depends": [
"system_test.failover.destroy_controllers.first("
"ceph_all_on_neutron_vlan)",
"system_test.failover.destroy_controllers.second("
"1ctrl_ceph_2ctrl_1comp_1comp_ceph_neutronVLAN)"]},
{"groups": ["fuel_master_migrate"],
"depends": [
"system_test.fuel_migration(1ctrl_1comp_neutronVLAN)",
"system_test.fuel_migration(1ctrl_1comp_neutronTUN)"]}
]
for new_group in groups_list:
register(groups=new_group['groups'],
depends_on_groups=new_group['depends'])
class CloseSSHConnectionsPlugin(Plugin):
@ -177,6 +148,8 @@ def run_tests():
if __name__ == '__main__':
from system_test import define_custom_groups
import_tests()
define_custom_groups()
from fuelweb_test.helpers.patching import map_test

View File

@ -14,4 +14,60 @@
import fuelweb_test
from system_test.helpers.utils import get_configs
from proboscis import register
logger = fuelweb_test.logger
def cached_add_group(yamls):
def add(group, systest_group, config_name,
validate_config=True):
"""Add user friendly group
:type group_name: str
:type systest_group: str
:type config_name: str
"""
# from proboscis.decorators import DEFAULT_REGISTRY
if validate_config and config_name not in yamls:
raise NameError("Config {} not found".format(config_name))
register(groups=[group],
depends_on_groups=[
"{systest_group}({config_name})".format(
systest_group=systest_group,
config_name=config_name)])
return add
def define_custom_groups():
"""Map user friendly group name to system test groups
groups - contained user friendly alias
depends - contained groups which should be runned
"""
add_group = cached_add_group(get_configs())
add_group(group="system_test.ceph_ha",
systest_group="system_test.deploy_and_check_radosgw",
config_name="ceph_all_on_neutron_vlan")
add_group(group="filling_root",
systest_group="system_test.failover.filling_root",
config_name="ceph_all_on_neutron_vlan")
add_group(group="system_test.strength",
systest_group="system_test.failover.destroy_controllers.first",
config_name="ceph_all_on_neutron_vlan")
add_group(group="system_test.strength",
systest_group="system_test.failover.destroy_controllers.second",
config_name="1ctrl_ceph_2ctrl_1comp_1comp_ceph_neutronVLAN")
add_group(group="fuel_master_migrate",
systest_group="system_test.fuel_migration",
config_name="1ctrl_1comp_neutronVLAN")
add_group(group="fuel_master_migrate",
systest_group="system_test.fuel_migration",
config_name="1ctrl_1comp_neutronTUN")