-
Notifications
You must be signed in to change notification settings - Fork 164
/
test_upgrade.py
68 lines (47 loc) · 1.63 KB
/
test_upgrade.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import logging
import pytest
from ocs_ci.framework.testlib import (
ocs_upgrade,
polarion_id,
)
from ocs_ci.ocs.disruptive_operations import worker_node_shutdown, osd_node_reboot
from ocs_ci.ocs.ocs_upgrade import run_ocs_upgrade
from ocs_ci.utility.reporting import get_polarion_id
log = logging.getLogger(__name__)
@pytest.fixture()
def teardown(request, nodes):
def finalizer():
"""
Make sure all nodes are up again
"""
nodes.restart_nodes_by_stop_and_start_teardown()
request.addfinalizer(finalizer)
@pytest.mark.polarion_id("OCS-1579")
def test_worker_node_abrupt_shutdown(teardown):
"""
Test OCS upgrade with disruption of shutting down worker node,
for 5.5 minutes
"""
log.info("Starting disruptive function: test_worker_node_abrupt_shutdown")
run_ocs_upgrade(operation=worker_node_shutdown, abrupt=True)
@pytest.mark.polarion_id("OCS-1575")
def test_worker_node_permanent_shutdown(teardown):
"""
Test OCS upgrade with disruption of shutting down worker node
"""
log.info("Starting disruptive function: test_worker_node_permanent_shutdown")
run_ocs_upgrade(operation=worker_node_shutdown, abrupt=False)
@pytest.mark.polarion_id("OCS-1558")
def test_osd_reboot(teardown):
"""
OCS Upgrade with node reboot: with 1 OSD going down and back up while upgrade is running
"""
log.info("Starting disruptive function: test_osd_reboot")
run_ocs_upgrade(operation=osd_node_reboot)
@ocs_upgrade
@polarion_id(get_polarion_id(upgrade=True))
def test_upgrade():
"""
Tests upgrade procedure of OCS cluster
"""
run_ocs_upgrade()