fuel-qa/system_test/tests/strength/test_destroy_controllers.py
Dmitry Tyzhnenko 82b392284a Refactoring of system_test classes
Some design of system_test packages:
    - move actions to separate package
    - move core fuctionality to core package

Change-Id: I7b12380a687c9cccbd44d79819f842b1b2470cd5
Implemets blueprint template-based-testcases
2016-02-25 16:53:59 +02:00

124 lines
3.8 KiB
Python

# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE_2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from system_test import testcase
from system_test import deferred_decorator
from system_test import action
from system_test.tests import ActionTest
from system_test.actions import BaseActions
from system_test.actions import StrengthActions
from system_test.helpers.decorators import make_snapshot_if_step_fail
@testcase(groups=['system_test',
'system_test.failover',
'system_test.failover.destroy_controllers',
'system_test.failover.destroy_controllers.first'])
class StrengthDestroyFirstController(ActionTest, BaseActions, StrengthActions):
"""Destroy two controllers and check pacemaker status is correct
Scenario:
1. Create Environment
2. Add nodes to Environment
3. Run network checker
4. Deploy Environment
5. Run network checker
6. Run OSTF
7. Make or use existing snapshot of ready Environment
8. Destroy first controller
9. Check pacemaker status
10. Wait offline status in nailgun
11. Run OSTF
"""
actions_order = [
'setup_master',
'config_release',
'make_slaves',
'revert_slaves',
'create_env',
'add_nodes',
'network_check',
'deploy_cluster',
'network_check',
'health_check',
'save_load_environment',
'destroy_first_controller',
'check_pacemaker_status',
'wait_offline_nodes',
'check_ha_service_ready',
'check_os_services_ready',
'wait_galera_cluster',
'health_check',
]
@deferred_decorator([make_snapshot_if_step_fail])
@action
def destroy_first_controller(self):
"""Destroy first controller"""
self._destroy_controller('slave-01')
@testcase(groups=['system_test',
'system_test.failover',
'system_test.failover.destroy_controllers',
'system_test.failover.destroy_controllers.second'])
class StrengthDestroySecondController(ActionTest, BaseActions,
StrengthActions):
"""Destroy two controllers and check pacemaker status is correct
Scenario:
1. Create Environment
2. Add nodes to Environment
3. Run network checker
4. Deploy Environment
5. Run network checker
6. Run OSTF
7. Make or use existing snapshot of ready Environment
8. Destroy second controller
9. Check pacemaker status
10. Wait offline status in nailgun
11. Run OSTF
"""
actions_order = [
'setup_master',
'config_release',
'make_slaves',
'revert_slaves',
'create_env',
'add_nodes',
'network_check',
'deploy_cluster',
'network_check',
'health_check',
'save_load_environment',
'destroy_second_controller',
'check_pacemaker_status',
'wait_offline_nodes',
'check_ha_service_ready',
'check_os_services_ready',
'wait_galera_cluster',
'health_check',
]
@deferred_decorator([make_snapshot_if_step_fail])
@action
def destroy_second_controller(self):
"""Destroy second controller"""
self._destroy_controller('slave-02')