forked from apache/cassandra-dtest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multidc_putget_test.py
31 lines (21 loc) · 957 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
28
29
30
31
import logging
from dtest import Tester, create_ks, create_cf
from tools.data import putget
logger = logging.getLogger(__name__)
class TestMultiDCPutGet(Tester):
def test_putget_2dc_rf1(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 test_putget_2dc_rf2(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)