forked from scylladb/scylla-cluster-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrade_test.py
65 lines (50 loc) · 2.14 KB
/
upgrade_test.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
#!/usr/bin/env python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See LICENSE for more details.
#
# Copyright (c) 2016 ScyllaDB
from avocado import main
from sdcm.tester import ClusterTester
from sdcm.nemesis import UpgradeNemesis
from sdcm.nemesis import RollbackNemesis
class UpgradeTest(ClusterTester):
"""
Test a Scylla cluster upgrade.
:avocado: enable
"""
default_params = {'timeout': 650000}
def test_20_minutes(self):
"""
Run cassandra-stress on a cluster for 20 minutes, together with node upgrades.
"""
self.db_cluster.add_nemesis(nemesis=UpgradeNemesis,
loaders=self.loaders,
monitoring_set=self.monitors)
self.db_cluster.start_nemesis(interval=10)
self.run_stress(stress_cmd=self.params.get('stress_cmd'), duration=20)
def test_20_minutes_rollback(self):
"""
Run cassandra-stress on a cluster for 20 minutes, together with node upgrades.
"""
self.db_cluster.add_nemesis(nemesis=UpgradeNemesis,
loaders=self.loaders,
monitoring_set=self.monitors)
self.db_cluster.start_nemesis(interval=10)
self.db_cluster.stop_nemesis(timeout=None)
self.db_cluster.clean_nemesis()
self.db_cluster.add_nemesis(nemesis=RollbackNemesis,
loaders=self.loaders,
monitoring_set=self.monitors)
self.db_cluster.start_nemesis(interval=10)
self.run_stress(stress_cmd=self.params.get('stress_cmd'),
duration=self.params.get('cassandra_stress_duration', 20))
if __name__ == '__main__':
main()