Fix scale tests for vCenter

Change-Id: Ia1530ba3e562592b1c0fdf32dc9de370c1370d2f
Closes-bug: #1581464
This commit is contained in:
Ilya Bumarskov 2016-05-16 12:59:48 +03:00
parent b011f4eb80
commit b2a521336e
5 changed files with 52 additions and 25 deletions

View File

@ -41,6 +41,7 @@ from system_test import deferred_decorator
from system_test.actions.ostf_actions import HealthCheckActions from system_test.actions.ostf_actions import HealthCheckActions
from system_test.actions.plugins_actions import PluginsActions from system_test.actions.plugins_actions import PluginsActions
from system_test.actions.vcenter_actions import VMwareActions
from system_test.core.discover import load_yaml from system_test.core.discover import load_yaml
from system_test.helpers.decorators import make_snapshot_if_step_fail from system_test.helpers.decorators import make_snapshot_if_step_fail
@ -240,7 +241,8 @@ class PrepareActions(object):
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
class BaseActions(PrepareActions, HealthCheckActions, PluginsActions): class BaseActions(PrepareActions, HealthCheckActions, PluginsActions,
VMwareActions):
"""Basic actions for acceptance cases """Basic actions for acceptance cases
For choosing action order use actions_order variable, set list of actions For choosing action order use actions_order variable, set list of actions
@ -501,7 +503,9 @@ class BaseActions(PrepareActions, HealthCheckActions, PluginsActions):
self._add_node([node]) self._add_node([node])
if node.get('vmware_vcenter'): if node.get('vmware_vcenter'):
nova_computes = node['vmware_vcenter']['nova-compute'] nova_computes = node['vmware_vcenter']['nova-compute']
dvs_settings = node['vmware_dvs']
self.add_vmware_nova_compute(nova_computes) self.add_vmware_nova_compute(nova_computes)
self.update_dvs_plugin_settings(dvs_settings)
elif node['action'] == 'delete': elif node['action'] == 'delete':
self._del_node([node]) self._del_node([node])
if 'compute-vmware' in node['roles']: if 'compute-vmware' in node['roles']:
@ -553,8 +557,9 @@ class BaseActions(PrepareActions, HealthCheckActions, PluginsActions):
0]["nova_computes"] 0]["nova_computes"]
comp_vmware_nodes = self.fuel_web.get_nailgun_cluster_nodes_by_roles( comp_vmware_nodes = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
self.cluster_id, ['compute-vmware'], self.cluster_id, ['compute-vmware'])
role_status='pending_deletion') comp_vmware_nodes = [node for node in comp_vmware_nodes if
node['pending_deletion'] is True]
for node, nova_comp in itertools.product(comp_vmware_nodes, for node, nova_comp in itertools.product(comp_vmware_nodes,
vcenter_data): vcenter_data):

View File

@ -81,3 +81,21 @@ class HealthCheckActions(object):
test_sets=['ha'], test_sets=['ha'],
should_fail=getattr(self, 'ostf_tests_should_failed', 0), should_fail=getattr(self, 'ostf_tests_should_failed', 0),
failed_test_name=getattr(self, 'failed_test_name', None)) failed_test_name=getattr(self, 'failed_test_name', None))
@deferred_decorator([make_snapshot_if_step_fail])
@action
def health_check_platform(self):
"""Run health checker Platform
Skip action if cluster doesn't exist
"""
if self.cluster_id is None:
raise SkipTest(
"The cluster_id is not specified, can not run ostf"
)
self.fuel_web.run_ostf(
cluster_id=self.cluster_id,
test_sets=['tests_platform'],
should_fail=getattr(self, 'ostf_tests_should_failed', 0),
failed_test_name=getattr(self, 'failed_test_name', None))

View File

@ -57,14 +57,20 @@ class VMwareActions(object):
self.plugin_name), self.plugin_name),
msg) msg)
dvs_settings = self.full_config['template']['cluster_template'][
'settings']['vmware_dvs']
self.update_dvs_plugin_settings(dvs_settings)
def update_dvs_plugin_settings(self, dvs_settings):
"""Update plugin settings
:param dvs_settings: dict
"""
options = { options = {
'vmware_dvs_fw_driver/value': self.full_config[ 'vmware_dvs_fw_driver/value': dvs_settings['dvs_fw_driver'],
'template']['cluster_template']['settings']['vmware_dvs'][ 'vmware_dvs_net_maps/value': dvs_settings['dvswitch_name']
'dvs_fw_driver'],
'vmware_dvs_net_maps/value': self.full_config[
'template']['cluster_template']['settings']['vmware_dvs'][
'dvswitch_name']
} }
self.fuel_web.update_plugin_settings( self.fuel_web.update_plugin_settings(
self.cluster_id, self.plugin_name, self.plugin_version, options, self.cluster_id, self.plugin_name, self.plugin_version, options,
enabled=True) enabled=True)

View File

@ -103,9 +103,9 @@ class ScaleWithVMware(ActionTest, BaseActions, VMwareActions):
@testcase(groups=['system_test', @testcase(groups=['system_test',
'system_test.vcenter', 'system_test.vcenter',
'system_test.vcenter.scale_vcenter_dvs_skipsrvcheck']) 'system_test.vcenter.deploy_vcenter_dvs_run_platform_ostf'])
class ScaleWithVMwareSkipSrvCheck(ActionTest, BaseActions, VMwareActions): class DeployWithVMwareRunPlatformOSTF(ActionTest, BaseActions, VMwareActions):
"""Deploy and scale cluster with vCenter and dvs plugin """Deploy cluster with vCenter and dvs plugin. Run platform OSTF.
Scenario: Scenario:
1. Upload plugin to the master node 1. Upload plugin to the master node
@ -114,21 +114,17 @@ class ScaleWithVMwareSkipSrvCheck(ActionTest, BaseActions, VMwareActions):
4. Configure dvs settings (depends on yaml config) 4. Configure dvs settings (depends on yaml config)
5. Add nodes (depends on yaml config) 5. Add nodes (depends on yaml config)
6. Configure vmware settings (depends on yaml config) 6. Configure vmware settings (depends on yaml config)
7. Run network verification 7. Deploy the cluster
8. Deploy the cluster 8. Run OSTF
9. Add/Delete nodes 9. Run OSTF (platform tests)
10. Redeploy cluster
11. Run OSTF
Duration 3h 00min Duration 2h 20min
Snapshot scale_vcenter_dvs Snapshot deploy_vcenter_dvs
""" """
plugin_name = "fuel-plugin-vmware-dvs" plugin_name = "fuel-plugin-vmware-dvs"
plugin_path = DVS_PLUGIN_PATH plugin_path = DVS_PLUGIN_PATH
plugin_version = DVS_PLUGIN_VERSION plugin_version = DVS_PLUGIN_VERSION
ostf_tests_should_failed = 1
failed_test_name = ['Check that required services are running']
actions_order = [ actions_order = [
'prepare_env_with_plugin', 'prepare_env_with_plugin',
@ -138,9 +134,8 @@ class ScaleWithVMwareSkipSrvCheck(ActionTest, BaseActions, VMwareActions):
'configure_vcenter', 'configure_vcenter',
'network_check', 'network_check',
'deploy_cluster', 'deploy_cluster',
'scale_node', 'health_check_sanity_smoke_ha',
'deploy_changes', 'health_check_platform'
'health_check_sanity_smoke_ha'
] ]

View File

@ -44,4 +44,7 @@ template:
- cluster: Cluster2 - cluster: Cluster2
srv_name: srv_cluster2 srv_name: srv_cluster2
datastore: .* datastore: .*
target_node: compute-vmware target_node: compute-vmware
vmware_dvs:
dvswitch_name: !os_env DVS_NAME, Cluster1:dvSwitch;Cluster2:dvSwitch
dvs_fw_driver: false