forked from thepaul/cassandra-dtest
-
Notifications
You must be signed in to change notification settings - Fork 2
/
multidc_putget_test.py
27 lines (20 loc) · 946 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
from tools import putget
from ccmlib.cluster import Cluster
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()
cursor = self.patient_cql_connection(cluster.nodelist()[0]).cursor()
self.create_ks(cursor, 'ks', { 'dc1' : 1, 'dc2' : 1})
self.create_cf(cursor, 'cf')
putget(cluster, cursor)
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()
cursor = self.patient_cql_connection(cluster.nodelist()[0]).cursor()
self.create_ks(cursor, 'ks', { 'dc1' : 2, 'dc2' : 2})
self.create_cf(cursor, 'cf')
putget(cluster, cursor)