Merge branch 'cassandra-2.1' into trunk

This commit is contained in:
Mikhail Stepura 2014-05-08 16:21:13 -07:00
commit 70d18cd3e6
3 changed files with 24 additions and 25 deletions

View File

@ -26,7 +26,7 @@ test_keyspace_init = os.path.join(rundir, 'test_keyspace_init.cql')
def get_cassandra_connection(cql_version=None):
if cql_version is None:
cql_version = '3.1.5'
cql_version = '3.1.6'
conn = cql((TEST_HOST,), TEST_PORT, cql_version=cql_version)
# until the cql lib does this for us
conn.cql_version = cql_version
@ -73,7 +73,7 @@ def execute_cql_file(cursor, fname):
return execute_cql_commands(cursor, f.read())
def create_test_db():
with cassandra_cursor(ks=None, cql_version='3.1.5') as c:
with cassandra_cursor(ks=None, cql_version='3.1.6') as c:
k = create_test_keyspace(c)
execute_cql_file(c, test_keyspace_init)
return k

View File

@ -92,7 +92,7 @@ class CqlshCompletionCase(BaseTestCase):
return self.module.CqlRuleSet.replication_strategies
class TestCqlshCompletion(CqlshCompletionCase):
cqlver = '3.1.5'
cqlver = '3.1.6'
module = cqlsh.cql3handling
def test_complete_on_empty_string(self):

View File

@ -200,7 +200,7 @@ class TestCqlshOutput(BaseTestCase):
(1 rows)
nnnnnnnn
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
q = 'select COUNT(*) FROM twenty_rows_composite_table limit 1000000;'
self.assertQueriesGiveColoredOutput((
@ -216,7 +216,7 @@ class TestCqlshOutput(BaseTestCase):
(1 rows)
nnnnnnnn
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
def test_static_cf_output(self):
self.assertCqlverQueriesGiveColoredOutput((
@ -236,7 +236,7 @@ class TestCqlshOutput(BaseTestCase):
(3 rows)
nnnnnnnn
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
self.assertQueriesGiveColoredOutput((
('select * from dynamic_columns;', """
@ -259,14 +259,14 @@ class TestCqlshOutput(BaseTestCase):
(5 rows)
nnnnnnnn
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
def test_empty_cf_output(self):
self.assertCqlverQueriesGiveColoredOutput((
('select * from empty_table;', """
(0 rows)
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
q = 'select * from has_all_types where num = 999;'
@ -275,7 +275,7 @@ class TestCqlshOutput(BaseTestCase):
(q, """
(0 rows)
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
def test_columnless_key_output(self):
q = "select a from twenty_rows_table where a in ('1', '2', '-9192');"
@ -295,7 +295,7 @@ class TestCqlshOutput(BaseTestCase):
(2 rows)
nnnnnnnn
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
def test_numeric_output(self):
self.assertCqlverQueriesGiveColoredOutput((
@ -344,7 +344,7 @@ class TestCqlshOutput(BaseTestCase):
(5 rows)
nnnnnnnn
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
def test_timestamp_output(self):
self.assertQueriesGiveColoredOutput((
@ -397,7 +397,7 @@ class TestCqlshOutput(BaseTestCase):
(4 rows)
nnnnnnnn
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
def test_null_output(self):
# column with metainfo but no values
@ -416,7 +416,7 @@ class TestCqlshOutput(BaseTestCase):
(2 rows)
nnnnnnnn
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
# all-columns, including a metainfo column has no values (cql3)
self.assertQueriesGiveColoredOutput((
@ -434,7 +434,7 @@ class TestCqlshOutput(BaseTestCase):
(2 rows)
nnnnnnnn
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
def test_string_output_ascii(self):
self.assertCqlverQueriesGiveColoredOutput((
@ -458,7 +458,7 @@ class TestCqlshOutput(BaseTestCase):
(5 rows)
nnnnnnnn
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
def test_string_output_utf8(self):
# many of these won't line up visually here, to keep the source code
@ -492,7 +492,7 @@ class TestCqlshOutput(BaseTestCase):
(7 rows)
nnnnnnnn
""".encode('utf-8')),
), cqlver="3.1.5", env={'LANG': 'en_US.UTF-8'})
), cqlver="3.1.6", env={'LANG': 'en_US.UTF-8'})
def test_blob_output(self):
self.assertCqlverQueriesGiveColoredOutput((
@ -514,7 +514,7 @@ class TestCqlshOutput(BaseTestCase):
(4 rows)
nnnnnnnn
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
def test_colname_decoding_errors(self):
# not clear how to achieve this situation in the first place. the
@ -543,7 +543,7 @@ class TestCqlshOutput(BaseTestCase):
Failed to decode value '\x00\xff\x00\xff' (for column 'utf8col') as text: 'utf8' codec can't decode byte 0xff in position 1: invalid start byte
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
def test_key_decoding_errors(self):
self.assertCqlverQueriesGiveColoredOutput((
@ -563,10 +563,10 @@ class TestCqlshOutput(BaseTestCase):
Failed to decode value '\x00\xff\x02\x8f' (for column 'pkey') as text: 'utf8' codec can't decode byte 0xff in position 1: invalid start byte
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
"""),
), cqlver="3.1.5")
), cqlver="3.1.6")
def test_prompt(self):
with testrun_cqlsh(tty=True, keyspace=None, cqlver="3.1.5") as c:
with testrun_cqlsh(tty=True, keyspace=None, cqlver="3.1.6") as c:
self.assertEqual(c.output_header.splitlines()[-1], 'cqlsh> ')
c.send('\n')
@ -594,7 +594,7 @@ class TestCqlshOutput(BaseTestCase):
"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR")
def test_describe_keyspace_output(self):
fullcqlver = '3.1.5'
fullcqlver = '3.1.6'
with testrun_cqlsh(tty=True, cqlver=fullcqlver) as c:
ks = get_test_keyspace()
qks = quote_name(ks)
@ -661,13 +661,12 @@ class TestCqlshOutput(BaseTestCase):
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND populate_io_cache_on_flush = false
AND read_repair_chance = 0.1
AND speculative_retry = '99.0PERCENTILE';
""" % quote_name(get_test_keyspace()))
with testrun_cqlsh(tty=True, cqlver='3.1.5') as c:
with testrun_cqlsh(tty=True, cqlver='3.1.6') as c:
for cmdword in ('describe table', 'desc columnfamily'):
for semicolon in (';', ''):
output = c.cmd_and_response('%s has_all_types%s' % (cmdword, semicolon))
@ -685,7 +684,7 @@ class TestCqlshOutput(BaseTestCase):
ks = get_test_keyspace()
with testrun_cqlsh(tty=True, keyspace=None, cqlver="3.1.5") as c:
with testrun_cqlsh(tty=True, keyspace=None, cqlver="3.1.6") as c:
# when not in a keyspace
for cmdword in ('DESCRIBE COLUMNFAMILIES', 'desc tables'):
@ -737,7 +736,7 @@ class TestCqlshOutput(BaseTestCase):
\n
'''
with testrun_cqlsh(tty=True, keyspace=None, cqlver="3.1.5") as c:
with testrun_cqlsh(tty=True, keyspace=None, cqlver="3.1.6") as c:
# not in a keyspace
for semicolon in ('', ';'):