From 6c6fdbf7005c867dacf0196e991d8c1647b8143f Mon Sep 17 00:00:00 2001 From: ibumarskov Date: Tue, 16 Aug 2016 17:38:02 +0300 Subject: [PATCH] Add test for checking HA after scaling of vCenter enviroment Change-Id: I7a0f3c47e1029894e811bc886c32b04c5773a3de Closes-bug: #1611820 --- system_test/actions/vcenter_actions.py | 11 +++++--- .../tests/vcenter/test_vcenter_failover.py | 25 +++++++++++-------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/system_test/actions/vcenter_actions.py b/system_test/actions/vcenter_actions.py index e70716281..48d2d9cff 100644 --- a/system_test/actions/vcenter_actions.py +++ b/system_test/actions/vcenter_actions.py @@ -664,7 +664,7 @@ class VMwareActions(object): """Return name of controller with VIPs.""" for node in self.env.d_env.nodes().slaves: ng_node = self.env.fuel_web.get_nailgun_node_by_devops_node(node) - if ng_node['online']: + if ng_node['online'] and 'controller' in ng_node['roles']: hosts_vip = self.fuel_web.get_pacemaker_resource_location( ng_node['devops_name'], 'vip__management') logger.info('Now primary controller is ' @@ -753,11 +753,14 @@ class VMwareActions(object): @deferred_decorator([make_snapshot_if_step_fail]) @action - def ostf_with_services_fail(self): + def ostf_with_haproxy_fail(self): """Run OSTF tests (one should fail).""" self.env.fuel_web.run_ostf( - self.cluster_id, should_fail=1, - failed_test_name='Check that required services are running') + self.cluster_id, + test_sets=['sanity', 'smoke', 'ha'], + should_fail=1, + failed_test_name=['Check state of haproxy backends on controllers'] + ) @deferred_decorator([make_snapshot_if_step_fail]) @action diff --git a/system_test/tests/vcenter/test_vcenter_failover.py b/system_test/tests/vcenter/test_vcenter_failover.py index cc82012d3..0f083c9b5 100644 --- a/system_test/tests/vcenter/test_vcenter_failover.py +++ b/system_test/tests/vcenter/test_vcenter_failover.py @@ -84,15 +84,17 @@ class ShutdownPrimaryWithVMware(ActionTest, BaseActions, VMwareActions): 6. Configure vmware settings (depends on yaml config) 7. Deploy the cluster 8. Create instances on Nova and vCenter - 9. Shutdown primary controller - 10. Verify networks - 11. Ensure that VIPs are moved to other controller - 12. Ensure connectivity between VMs - 13. Run OSTF tests (one should fail) - 14. Turn on primary controller - 15. Wait 5-10 minutes - 16. Verify networks - 17. Run OSTF tests + 9. Add nodes (depends on yaml config) + 10 Deploy changes + 11. Shutdown primary controller + 12. Verify networks + 13. Ensure that VIPs are moved to other controller + 14. Ensure connectivity between VMs + 15. Run OSTF tests (one should fail) + 16. Turn on primary controller + 17. Wait 5-10 minutes + 18. Verify networks + 19. Run OSTF tests Duration 3h 00min Snapshot vcenter_shutdown_ctrl @@ -110,13 +112,14 @@ class ShutdownPrimaryWithVMware(ActionTest, BaseActions, VMwareActions): 'configure_vcenter', 'deploy_cluster', 'create_instances', + 'scale_node', + 'deploy_changes', 'shutdown_primary', - 'wait_ha_services', 'network_check', 'check_up_vips', 'check_vm_connect', 'delete_instances', - 'ostf_with_services_fail', + 'ostf_with_haproxy_fail', 'turn_on_primary', 'wait_ha_services', 'network_check',