Merge "Conform tests to the 11/ocata release"

This commit is contained in:
Jenkins 2017-01-12 11:59:22 +00:00 committed by Gerrit Code Review
commit ead3c8e52a
5 changed files with 38 additions and 8 deletions

View File

@ -1045,6 +1045,10 @@ class EnvironmentManager(object):
{'repository_path': 'repositories/ubuntu',
'version': 'newton-10.0', 'os': 'ubuntu',
'mode': ['ha'],
'deployment_scripts_path': 'deployment_scripts/'},
{'repository_path': 'repositories/ubuntu',
'version': 'ocata-11.0', 'os': 'ubuntu',
'mode': ['ha'],
'deployment_scripts_path': 'deployment_scripts/'}
]
}

View File

@ -2608,6 +2608,19 @@ class BaseDeploymentSerializer(BaseSerializerTest):
"""
return facts
@staticmethod
def _get_plugins_names(plugins):
"""Plugins names for non-LCM serializers
Plugins data in case of legacy serializers consist
of plugins names only.
Could be overloaded by LCM serializers.
:param plugins: array of plugins names
:returns: plugins names as it is
"""
return plugins
class TestDeploymentMultinodeSerializer61(BaseDeploymentSerializer):

View File

@ -344,8 +344,9 @@ class TestDeploymentAttributesSerialization80(
objects.Cluster.prepare_for_deployment(self.cluster_db)
serialized_for_astute = self.serializer.serialize(
self.cluster_db, self.cluster_db.nodes)
serialized_for_astute = deployment_info_to_legacy(
serialized_for_astute)
serialized_for_astute = self._handle_facts(
deployment_info_to_legacy(serialized_for_astute)
)
for node in serialized_for_astute:
transformations = node['network_scheme']['transformations']
baremetal_brs = filter(lambda t: t.get('name') ==
@ -398,7 +399,9 @@ class TestDeploymentAttributesSerialization80(
for node in serialized_for_astute:
self.assertIn('plugins', node)
self.assertItemsEqual(
expected_plugins_list, node['plugins'])
expected_plugins_list,
self._get_plugins_names(node['plugins'])
)
self.assertTrue(all(name in node for name
in expected_plugins_list))

View File

@ -38,6 +38,7 @@ from nailgun.test.integration import test_orchestrator_serializer_80
class TestSerializer90Mixin(object):
env_version = "mitaka-9.0"
task_deploy = True
dpdk_bridge_provider = consts.NEUTRON_L23_PROVIDERS.ovs
@classmethod
def create_serializer(cls, cluster):
@ -67,7 +68,7 @@ class TestSerializer90Mixin(object):
@staticmethod
def _handle_facts(facts):
"""Handle deployment facts fro LCM serializers
"""Handle deployment facts for LCM serializers
As we are running 7.0 tests against 9.0 environments where
LCM serializer is used it's not expected to have master node
@ -160,7 +161,8 @@ class TestDeploymentAttributesSerialization90(
serialized_for_astute = self.serializer.serialize(
self.cluster_db, self.cluster_db.nodes)
self.assertEqual(len(serialized_for_astute['nodes']), 1)
self.assertEqual(len(self._handle_facts(
serialized_for_astute['nodes'])), 1)
serialized_node = serialized_for_astute['nodes'][0]
dpdk = serialized_node.get('dpdk')
@ -182,6 +184,7 @@ class TestDeploymentAttributesSerialization90(
transformations)
self.assertEqual(private_br.get('vendor_specific'),
vendor_specific)
self.assertEqual(private_br.get('provider'), self.dpdk_bridge_provider)
self.assertEqual(len(all_ports) - len(dpdk_ports),
len(other_nic.assigned_networks_list))
self.assertEqual(len(dpdk_ports), 1)
@ -277,7 +280,8 @@ class TestDeploymentAttributesSerialization90(
self.env.node_nics_put(node.id, interfaces)
serialized_for_astute = self.serialize()
self.assertEqual(len(serialized_for_astute['nodes']), 1)
self.assertEqual(len(self._handle_facts(
serialized_for_astute['nodes'])), 1)
serialized_node = serialized_for_astute['nodes'][0]
dpdk = serialized_node.get('dpdk')
@ -825,7 +829,7 @@ class TestDeploymentLCMSerialization90(
def test_plugins_in_serialized(self):
releases = [
{'repository_path': 'repositories/ubuntu',
'version': 'mitaka-9.0', 'os': 'ubuntu',
'version': self.env_version, 'os': 'ubuntu',
'mode': ['ha', 'multinode'],
'deployment_scripts_path': 'deployment_scripts/'}
]

View File

@ -83,7 +83,13 @@ class TestPluginBase(base.BaseTestCase):
"""Should return set of all versions this plugin is applicable to"""
self.assertEqual(
self.plugin_adapter.plugin_release_versions,
set(['2014.2-6.0', '2015.1-8.0', 'mitaka-9.0', 'newton-10.0'])
set([
'2014.2-6.0',
'2015.1-8.0',
'mitaka-9.0',
'newton-10.0',
'ocata-11.0'
])
)
def test_full_name(self):