From 3addfdd697dc2625c19c3070ebcb5adc135ca2d9 Mon Sep 17 00:00:00 2001 From: Artem Panchenko Date: Tue, 26 Apr 2016 00:36:25 +0300 Subject: [PATCH] Skip 2 health checks if no computes w/o DPDK If environment doesn't contain compute nodes without DPDK then it's impossible to run instance and access it over network using default flavor which doesn't use huge pages for RAM. Change-Id: Ic6daf95fb7380a4c9355a5a1e5c6a1e45de46f89 Closes-bug: #1567447 (cherry picked from commit 2bdaeafbb2c92fb85aa5b77e24128678fb96fff4) --- fuel_health/tests/smoke/test_dpdk.py | 2 +- .../tests/smoke/test_neutron_actions.py | 2 +- ..._nova_create_instance_with_connectivity.py | 2 +- fuel_plugin/ostf_adapter/mixins.py | 4 +++- fuel_plugin/testing/tests/base.py | 19 +++++++++++++++++-- .../tests/unit/test_support_utilities.py | 14 +++++++++----- 6 files changed, 32 insertions(+), 11 deletions(-) diff --git a/fuel_health/tests/smoke/test_dpdk.py b/fuel_health/tests/smoke/test_dpdk.py index 8fefcd0a..b474f8bd 100644 --- a/fuel_health/tests/smoke/test_dpdk.py +++ b/fuel_health/tests/smoke/test_dpdk.py @@ -53,7 +53,7 @@ class TestDPDK(neutronmanager.NeutronBaseTest, nmanager.SmokeChecksTest): 18. Remove network Duration: 300 s. - Deployment tags: dpdk + Deployment tags: computes_with_dpdk """ if not self.config.compute.dpdk_compute_fqdn: self.skipTest('There are no compute nodes with DPDK') diff --git a/fuel_health/tests/smoke/test_neutron_actions.py b/fuel_health/tests/smoke/test_neutron_actions.py index 22e715ec..e909adb5 100644 --- a/fuel_health/tests/smoke/test_neutron_actions.py +++ b/fuel_health/tests/smoke/test_neutron_actions.py @@ -56,7 +56,7 @@ class TestNeutron(neutronmanager.NeutronBaseTest): Duration: 300 s. - Deployment tags: neutron + Deployment tags: neutron, computes_without_dpdk """ if not self.config.compute.compute_nodes: self.skipTest('There are no compute nodes') diff --git a/fuel_health/tests/smoke/test_nova_create_instance_with_connectivity.py b/fuel_health/tests/smoke/test_nova_create_instance_with_connectivity.py index 1cac1c75..fdf7e3c5 100644 --- a/fuel_health/tests/smoke/test_nova_create_instance_with_connectivity.py +++ b/fuel_health/tests/smoke/test_nova_create_instance_with_connectivity.py @@ -304,7 +304,7 @@ class TestNovaNetwork(nmanager.NovaNetworkScenarioTest): 5. Delete floating ip. 6. Delete instance. Duration: 200 s. - Deployment tags: enable_without_ceph + Deployment tags: enable_without_ceph, computes_without_dpdk Available since release: 2014.2-6.1 """ self.check_image_exists() diff --git a/fuel_plugin/ostf_adapter/mixins.py b/fuel_plugin/ostf_adapter/mixins.py index 95eae888..be480515 100644 --- a/fuel_plugin/ostf_adapter/mixins.py +++ b/fuel_plugin/ostf_adapter/mixins.py @@ -184,7 +184,9 @@ def _get_cluster_attrs(cluster_id, token=None): deployment_tags.add('sriov') if dpdk_compute_ids: - deployment_tags.add('dpdk') + deployment_tags.add('computes_with_dpdk') + if not dpdk_compute_ids or set(compute_ids) - set(dpdk_compute_ids): + deployment_tags.add('computes_without_dpdk') if not enable_without_ceph: deployment_tags.add('enable_without_ceph') diff --git a/fuel_plugin/testing/tests/base.py b/fuel_plugin/testing/tests/base.py index ae6c074a..3f25e3b4 100644 --- a/fuel_plugin/testing/tests/base.py +++ b/fuel_plugin/testing/tests/base.py @@ -204,8 +204,13 @@ CLUSTERS = { 'id': "1", 'roles': "compute" }, + { + "hostname": "node-2", + 'id': "2", + 'roles': "compute" + }, ], - 'node_interfaces': [ + 'node-1_interfaces': [ { 'interface_properties': { 'dpdk': { @@ -213,7 +218,17 @@ CLUSTERS = { } } - } + }, + ], + 'node-2_interfaces': [ + { + 'interface_properties': { + 'dpdk': { + 'available': 'false' + } + } + + }, ], 'cluster_attributes': { 'editable': { diff --git a/fuel_plugin/testing/tests/unit/test_support_utilities.py b/fuel_plugin/testing/tests/unit/test_support_utilities.py index e2784621..05c68285 100644 --- a/fuel_plugin/testing/tests/unit/test_support_utilities.py +++ b/fuel_plugin/testing/tests/unit/test_support_utilities.py @@ -31,7 +31,7 @@ class TestDeplTagsGetter(base.BaseUnitTest): 'deployment_tags': set( ['ha', 'rhel', 'additional_components', 'murano', 'nova_network', 'public_on_all_nodes', - 'enable_without_ceph']), + 'enable_without_ceph', 'computes_without_dpdk']), 'release_version': '2015.2-1.0' } } @@ -57,7 +57,8 @@ class TestDeplTagsGetter(base.BaseUnitTest): 'deployment_tags': set( ['ha', 'rhel', 'additional_components', 'murano', 'nova_network', 'public_on_all_nodes', - 'enable_without_ceph', 'sriov']), + 'enable_without_ceph', 'sriov', + 'computes_without_dpdk']), 'release_version': '2015.2-1.0' } } @@ -83,8 +84,9 @@ class TestDeplTagsGetter(base.BaseUnitTest): 'cluster_id': 8, 'attrs': { 'deployment_tags': set( - ['dpdk', 'neutron', 'enable_without_ceph', 'ha', - 'public_on_all_nodes', 'rhel']), + ['computes_with_dpdk', 'neutron', 'enable_without_ceph', + 'ha', 'public_on_all_nodes', 'rhel', + 'computes_without_dpdk']), 'release_version': '2015.2-1.0' } } @@ -100,7 +102,9 @@ class TestDeplTagsGetter(base.BaseUnitTest): m.register_uri('GET', '/api/nodes?cluster_id=8', json=cluster['cluster_node']) m.register_uri('GET', '/api/nodes/1/interfaces', - json=cluster['node_interfaces']) + json=cluster['node-1_interfaces']) + m.register_uri('GET', '/api/nodes/2/interfaces', + json=cluster['node-2_interfaces']) res = mixins._get_cluster_attrs(expected['cluster_id']) self.assertEqual(res, expected['attrs'])