forked from thepaul/cassandra-dtest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multidc_putget_test.py
27 lines (19 loc) · 903 Bytes
/
multidc_putget_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
from dtest import Tester, create_ks, create_cf
from tools.data import putget
class TestMultiDCPutGet(Tester):
def putget_2dc_rf1_test(self):
""" Simple put-get test for 2 DC with one node each (RF=1) [catches #3539] """
cluster = self.cluster
cluster.populate([1, 1]).start()
session = self.patient_cql_connection(cluster.nodelist()[0])
create_ks(session, 'ks', {'dc1': 1, 'dc2': 1})
create_cf(session, 'cf')
putget(cluster, session)
def putget_2dc_rf2_test(self):
""" Simple put-get test for 2 DC with 2 node each (RF=2) -- tests cross-DC efficient writes """
cluster = self.cluster
cluster.populate([2, 2]).start()
session = self.patient_cql_connection(cluster.nodelist()[0])
create_ks(session, 'ks', {'dc1': 2, 'dc2': 2})
create_cf(session, 'cf')
putget(cluster, session)