Add a runner for contrail-test Juniper tests
- add steps in tcp_tests/templates/opencontrail to prepare tests
- add a fixture and a test runner 'test_opencontrail' that gets
the two variables from environment to pass them to test runner:
export OPENCONTRAIL_TAGS=smoke
export OPENCONTRAIL_FEATURES=neutron
- fix docstrings for fixtures
- add print of the environment variables that can be used in tests
and current defaults (taking into account the exported variables)
diff --git a/tcp_tests/settings_oslo.py b/tcp_tests/settings_oslo.py
index 88633a0..8190720 100644
--- a/tcp_tests/settings_oslo.py
+++ b/tcp_tests/settings_oslo.py
@@ -22,6 +22,8 @@
from tcp_tests.helpers import oslo_cfg_types as ct
from tcp_tests import settings
+print ("\n" + "-" * 10 + " Initialize oslo.config variables with defaults"
+ " from environment" + "-" * 10)
_default_conf = pkg_resources.resource_filename(
__name__, 'templates/underlay/{0}.yaml'.format(settings.LAB_CONFIG_NAME))
@@ -35,6 +37,9 @@
_default_openstack_steps = pkg_resources.resource_filename(
__name__, 'templates/openstack/{0}-openstack.yaml'.format(
settings.LAB_CONFIG_NAME))
+_default_opencontrail_prepare_tests_steps_path = pkg_resources.resource_filename(
+ __name__, 'templates/opencontrail/{0}-opencontrail.yaml'.format(
+ settings.LAB_CONFIG_NAME))
hardware_opts = [
@@ -92,7 +97,7 @@
]
common_services_opts = [
- ct.Cfg('installed', ct.Boolean(),
+ ct.Cfg('common_services_installed', ct.Boolean(),
help="", default=False),
]
@@ -102,12 +107,21 @@
default=_default_openstack_steps),
]
openstack_opts = [
- ct.Cfg('installed', ct.Boolean(),
+ ct.Cfg('openstack_installed', ct.Boolean(),
help="", default=False),
- ct.Cfg('keystone_endpoint', ct.String(),
+ ct.Cfg('openstack_keystone_endpoint', ct.String(),
help="", default=''),
]
+opencontrail_opts = [
+ ct.Cfg('opencontrail_tags', ct.String(),
+ help="", default=''),
+ ct.Cfg('opencontrail_features', ct.String(),
+ help="", default=''),
+ ct.Cfg('opencontrail_prepare_tests_steps_path', ct.String(),
+ help="Path to YAML with steps to prepare contrail-tests",
+ default=_default_opencontrail_prepare_tests_steps_path),
+]
_group_opts = [
('hardware', hardware_opts),
@@ -118,6 +132,7 @@
('common_services', common_services_opts),
('openstack_deploy', openstack_deploy_opts),
('openstack', openstack_opts),
+ ('opencontrail', opencontrail_opts),
]
@@ -158,6 +173,10 @@
title="Openstack deploy config and credentials",
help=""))
config.register_opts(group='openstack_deploy', opts=openstack_deploy_opts)
+
+ config.register_group(cfg.OptGroup(name='opencontrail',
+ title="Options for Juniper contrail-tests", help=""))
+ config.register_opts(group='opencontrail', opts=opencontrail_opts)
return config