forked from thepaul/cassandra-dtest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nodetool_test.py
31 lines (25 loc) · 999 Bytes
/
nodetool_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
from ccmlib.node import NodetoolError
from dtest import Tester
class TestNodetool(Tester):
def test_decommission_after_drain_is_invalid(self):
"""
@jira_ticket CASSANDRA-8741
Running a decommission after a drain should generate
an unsupported operation message and exit with an error
code (which we receive as a NodetoolError exception).
"""
cluster = self.cluster
cluster.populate([3]).start()
version = cluster.version()
node = cluster.nodelist()[0]
node.drain(block_on_log=True)
try:
node.decommission()
self.assertFalse("Expected nodetool error")
except NodetoolError as e:
if version >= "2.1":
self.assertEqual('', e.stderr)
self.assertTrue('Unsupported operation' in e.stdout)
else:
self.assertEqual('', e.stdout)
self.assertTrue('Unsupported operation' in e.stderr)