Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
5b6a23d
STAR-564 Check only MODIFY on base when updating table with MV (#17)
jtgrabowski Jun 1, 2021
d343325
STAR-582 fix repair error on one node cluster (#20)
k-rus Jun 11, 2021
9cb21bd
STAR-247: Allow to easily run tests against big or bti sstable format
Apr 2, 2021
d8f24c6
STAR-247: Standalone scrubber should use the same default sstable for…
jacek-lewandowski Jun 23, 2021
a4437f0
STAR-247: Add allowed warning for running scrub test
jacek-lewandowski Jun 23, 2021
a79c67f
STAR-14: Fix expectations to include memtable table parameter
blambov Apr 12, 2021
36bb9e5
STAR-254: add DateRange and Geo tests (#9)
jtgrabowski Apr 20, 2021
3e1ec4d
STAR-452: add EverywhereStrategy smoke test (#10)
jtgrabowski Apr 21, 2021
cd54bab
STAR-431: Add option to prevent any file-I/O from cqlsh
mfleming May 24, 2021
cb827a4
STAR-432: Add tests for consistency level options (#18)
tlasica Jun 1, 2021
7f97a1a
STAR-543: Port guardrail tests and changes (#19)
djatnieks Jun 8, 2021
de48577
STAR-765: Add tests for cloud connection. (#23)
tlasica Jun 16, 2021
0dcf88d
STAR-386: Add logging around failure to get timestamp info (#28)
djatnieks Jun 24, 2021
10727a9
STAR-517. Skip as it is not possible to test it reliably. (#34)
tlasica Jul 2, 2021
d417921
STAR-386 Increase client timeout for test_simultaneous_bootstrap (#37)
djatnieks Jul 2, 2021
d93c07e
STAR-385 Retry cluster stop after exception stopping 'gently' (#36)
djatnieks Jul 2, 2021
ff49254
STAR-13 Run tests for UnifiedCompactionStrategy (#22)
Gerrrr Jul 15, 2021
9156d67
STAR-822: Update test_consistent_repair dtest
jacek-lewandowski Aug 16, 2021
fb67706
STAR-843: Update dtests for ULID based generation ID
jacek-lewandowski Aug 20, 2021
cbdcaa1
STAR-899: Fix merge_schema_failure_4x.btm script to reflect our chang…
jacek-lewandowski Mar 21, 2022
99d4908
STAR-394: Fix various timeouts (#57)
jacek-lewandowski Mar 21, 2022
4b79152
STAR-386: Increase client timeout (#56)
jacek-lewandowski Mar 22, 2022
5f40710
Star 1329 (#61)
mike-tr-adamson Jul 12, 2022
17e093a
STAR-1709: Add 'Small commitlog volume detected' to acceptable error …
jacek-lewandowski Nov 3, 2022
0cdc82b
CNDB-10194 Fix dtests not running in jenkins
djatnieks Jul 16, 2024
0c96b6b
CNDB-10152: Fix Python DTests calls to pytest.fail() and skip() for n…
ekaterinadimitrova2 Jul 16, 2024
bb5f4e7
CNDB-9974: Fix tests for CASSANDRA-18252 - removal of scripted UDFs
ekaterinadimitrova2 Feb 10, 2023
2939e2f
CNDB-9974: Fix test_udf_scripting
ekaterinadimitrova2 Jul 15, 2024
62326dd
CC5 fix jmx_test.py::TestJMX::test_compaction
driftx Jul 22, 2024
be987c8
CC5 fix pushed_notifications
driftx Jul 22, 2024
40e85b5
CC5 fix test_sstablelevelreset
driftx Jul 23, 2024
190d290
CC5 fix secondary_indexes_test::TestPreJoinCallback tests
driftx Jul 23, 2024
93a067f
update deps
jacek-lewandowski Jul 24, 2024
3215641
CC5 fix paging_test and read_failures_test by setting tombstone_warn_…
driftx Jul 24, 2024
990d561
CC5 fix auditlog_test
driftx Jul 24, 2024
daa1854
CC5 fix test_client_warnings
driftx Jul 25, 2024
ff5ce1a
CC5 fix fqltool_test
driftx Jul 25, 2024
97658c7
CC5 fix cqlsh test_unicode_invalid_request_error
driftx Jul 26, 2024
d263039
CC5 fix materialized_views_test.py using CC version of compaction int…
djatnieks Aug 3, 2024
eeb56a8
CC5 fix TestCqlsh.test_describe and TestCqlsh.test_describe_mv, expec…
djatnieks Aug 3, 2024
070c4ad
CC5 fix tracing tests
driftx Sep 4, 2024
1e8840d
CC5 fix test_zerocopy_streaming
driftx Sep 10, 2024
ab62dd0
CNDB-12226 Fix test_atomic_writes that broke after CNDB-11242 (#73)
djatnieks Jan 14, 2025
7e65643
CC5 mark TestCounters::test_counter_leader_with_partial_view as skipped
driftx Jan 28, 2025
5fc3f97
HCD-73: Test jmx reviveEndpoint (#75)
szymon-miezal Mar 6, 2025
3f712e0
CC5: allow sstable_generation_loading_test to handle INDEX_BUILD_IN_P…
driftx Apr 17, 2025
8a82250
HCD-120 Bump upgrade_tests/upgrade_manifest.py versions for C*
michaelsembwever May 27, 2025
679c806
HCD-120 Add upgrade paths to cc4 and cc5, from C* and DSE
michaelsembwever Apr 9, 2025
83bef03
HCD-110 Regression fix (#79)
tiagomlalves Jun 3, 2025
48d8525
CNDB-13838 Fix test_sstableloader_with_failing_2i to work with apache…
djatnieks Jun 11, 2025
282e9b9
Update DSE upgrade test source versions (#83)
szymon-miezal Jun 30, 2025
0816516
CNDB-14554: Fix test_client_warnings to account for a different warni…
ekaterinadimitrova2 Jun 23, 2025
f4dcbcf
CNDB-14554: Fix test_tracing
ekaterinadimitrova2 Jun 23, 2025
abbd51d
CNDB-14554: Fix test_describe_mv to account for different output on d…
ekaterinadimitrova2 Jun 23, 2025
f462f8d
CNDB-14554: Fix test_unicode_invalid_request_error to account for cha…
ekaterinadimitrova2 Jun 27, 2025
8700398
CNDB-14554: Fix test_describe to account for different output on diff…
ekaterinadimitrova2 Jun 27, 2025
5c58ff6
Update upgrade_manifest.py for the DSE 6.9.12 release
bereng Jul 17, 2025
424bfd4
Update to latest DSE 6.9.13 version (#84)
tiagomlalves Aug 25, 2025
645291b
CNDB-15022 Introduce additional guardrail profile for HCD
michaelsembwever Aug 21, 2025
67b6602
Update DSE versions to 6.8.60 and 6.9.14
michaelsembwever Sep 18, 2025
5582209
Update upgrade_manifest.py to DSE 6.9.15
bereng Oct 15, 2025
929eb58
Update DSE upgrade test source versions (#86)
szymon-miezal Nov 14, 2025
fa29ef5
Update DSE version to 6.9.17 (#87)
emerkle826 Dec 16, 2025
8bfabc5
Updates DSE 5.1, 6.8, and 6.9 versions (#88)
tiagomlalves Jan 20, 2026
646cbf1
Fix slow query test in 5.0 after query redaction
driftx Feb 13, 2026
14ae45a
CNDB-16736: add dtest upgrades to CC5 (#89)
driftx Feb 16, 2026
f43b8b3
Update TestSecondaryIndexes.test_failing_manual_rebuild_index to hand…
driftx Feb 16, 2026
f9b3a57
Fix exception logging in upgrade tests
driftx Feb 17, 2026
ce91ef1
Ignore GossipShutdown deser error during upgrade
driftx Feb 18, 2026
2c8db8d
Add current_hcd_1 to indev_cc5, change to regular Cluster
driftx Feb 18, 2026
3cf97fb
CNDB-16554: Fix post CNDB-11242 (while min node in a cluster is NULL_…
ekaterinadimitrova2 Feb 19, 2026
ad436e2
Add downgrade test for indev_CC5 to indev_CC4 (#92)
driftx Mar 2, 2026
659ff17
Default storage_compatibility_mode to NONE
driftx Mar 2, 2026
91d7cce
Add test for nodetool import
driftx Mar 5, 2026
0c23f07
Update DSE version to 6.9.19
alankar-srivastava-ds Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions auditlog_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@

@since('4.0')
class TestAuditlog(Tester):

@pytest.fixture(autouse=True)
def fixture_add_additional_log_patterns(self, fixture_dtest_setup):
fixture_dtest_setup.ignore_log_patterns = (
r'deprecated RollCycle',
)

def test_archiving(self):
cluster = self.cluster
log_dir = tempfile.mkdtemp('logs')
Expand Down
72 changes: 51 additions & 21 deletions auth_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,16 @@ def test_materialized_views_auth(self):
* Create a new user, 'cathy', with no permissions
* Create a ks, table
* Connect as cathy
*
* Try CREATE MV without ALTER permission on base table, assert throws Unauthorized
* Grant cathy ALTER permissions, then CREATE MV successfully
*
* Try to MODIFY base without WRITE permission on base, assert throws Unauthorized
* Grant cathy WRITE permissions on base, and modify base successfully
*
* Try to SELECT from the mv, assert throws Unauthorized
* Grant cathy SELECT permissions, and read from the MV successfully
* Grant cathy SELECT permissions on base, and read from the MV successfully
*
* Revoke cathy's ALTER permissions, assert DROP MV throws Unauthorized
* Restore cathy's ALTER permissions, DROP MV successfully
"""
Expand All @@ -602,12 +608,36 @@ def test_materialized_views_auth(self):
cassandra.execute("GRANT ALTER ON ks.cf TO cathy")
cathy.execute(create_mv)

# TRY SELECT MV without SELECT permission on base table
assert_unauthorized(cathy, "SELECT * FROM ks.mv1", "User cathy has no SELECT permission on <table ks.cf> or any of its parents")
# Try MODIFY base without WRITE permission on base
assert_unauthorized(cathy, "INSERT INTO ks.cf(id, value) VALUES(1, '1')", "User cathy has no MODIFY permission on <table ks.cf> or any of its parents")

# Grant SELECT permission and CREATE MV
cassandra.execute("GRANT SELECT ON ks.cf TO cathy")
cathy.execute("SELECT * FROM ks.mv1")
if self.cluster.version() >= LooseVersion('4.0'):
# From 4.0 onward, only base MODIFY permission is required to update base with MV
# Grant WRITE permission on Base
cassandra.execute("GRANT MODIFY ON ks.cf TO cathy")
cathy.execute("INSERT INTO ks.cf(id, value) VALUES(1, '1')")

# TRY SELECT MV without SELECT permission on base table
assert_unauthorized(cathy, "SELECT * FROM ks.cf", "User cathy has no SELECT permission on <table ks.cf> or any of its parents")
assert_unauthorized(cathy, "SELECT * FROM ks.mv1", "User cathy has no SELECT permission on <table ks.cf> or any of its parents")

# Grant SELECT permission
cassandra.execute("GRANT SELECT ON ks.cf TO cathy")
assert_one(cathy, "SELECT * FROM ks.cf", [1, '1'])
assert_one(cathy, "SELECT * FROM ks.mv1", ['1', 1])
else:
# Before 4.0, MODIFY on MV is required to insert to base
# Grant WRITE permission on Base
cassandra.execute("GRANT MODIFY ON ks.cf TO cathy")
assert_unauthorized(cathy, "INSERT INTO ks.cf(id, value) VALUES(1, '1')", "User cathy has no SELECT permission on <table ks.cf> or any of its parents")
cassandra.execute("GRANT SELECT ON ks.cf TO cathy")
assert_unauthorized(cathy, "INSERT INTO ks.cf(id, value) VALUES(1, '1')", "User cathy has no MODIFY permission on <table ks.mv1> or any of its parents")

# Grant WRITE permission on MV
cassandra.execute("GRANT MODIFY ON ks.mv1 TO cathy")
cathy.execute("INSERT INTO ks.cf(id, value) VALUES(1, '1')")
assert_one(cathy, "SELECT * FROM ks.cf", [1, '1'])
assert_one(cathy, "SELECT * FROM ks.mv1", ['1', 1])

# Revoke ALTER permission and try DROP MV
cassandra.execute("REVOKE ALTER ON ks.cf FROM cathy")
Expand Down Expand Up @@ -1199,7 +1229,7 @@ def fixture_dtest_setup_overrides(self, dtest_config):
@jira_ticket CASSANDRA-7653
"""
dtest_setup_overrides = DTestSetupOverrides()
if '3.0' <= dtest_config.cassandra_version_from_build < '4.2':
if '3.0' <= dtest_config.cassandra_version_from_build < '4.0':
dtest_setup_overrides.cluster_options = ImmutableMapping({'enable_user_defined_functions': 'true',
'enable_scripted_user_defined_functions': 'true'})
else:
Expand Down Expand Up @@ -1371,7 +1401,7 @@ def test_creator_of_db_resource_granted_all_permissions(self):
as_mike.execute("CREATE KEYSPACE ks WITH replication = {'class':'SimpleStrategy', 'replication_factor':1}")
as_mike.execute("CREATE TABLE ks.cf (id int primary key, val int)")
as_mike.execute("CREATE ROLE role1 WITH PASSWORD = '11111' AND SUPERUSER = false AND LOGIN = true")
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
as_mike.execute("""CREATE FUNCTION ks.state_function_1(a int, b int)
CALLED ON NULL INPUT
RETURNS int
Expand Down Expand Up @@ -1668,7 +1698,7 @@ def test_filter_granted_permissions_by_resource_type(self):
self.superuser.execute("CREATE TABLE ks.cf (id int primary key, val int)")
self.superuser.execute("CREATE ROLE mike WITH PASSWORD = '12345' AND SUPERUSER = false AND LOGIN = true")
self.superuser.execute("CREATE ROLE role1 WITH SUPERUSER = false AND LOGIN = false")
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
self.superuser.execute("CREATE FUNCTION ks.state_func(a int, b int) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'a+b'")
else:
self.superuser.execute("CREATE FUNCTION ks.state_func(a int, b int) CALLED ON NULL INPUT RETURNS int LANGUAGE java AS ' return a+b;'")
Expand Down Expand Up @@ -2150,7 +2180,7 @@ def test_grant_revoke_udf_permissions(self):
"""
self.setup_table()
self.superuser.execute("CREATE ROLE mike WITH PASSWORD = '12345' AND LOGIN = true")
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'")
self.superuser.execute("CREATE FUNCTION ks.\"plusOne\" ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'")
else:
Expand Down Expand Up @@ -2199,7 +2229,7 @@ def test_grant_revoke_are_idempotent(self):
"""
self.setup_table()
self.superuser.execute("CREATE ROLE mike")
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'")
else:
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE java AS 'return input + 1;'")
Expand Down Expand Up @@ -2230,7 +2260,7 @@ def test_function_resource_hierarchy_permissions(self):
self.superuser.execute("INSERT INTO ks.t1 (k,v) values (1,1)")
self.superuser.execute("CREATE ROLE mike WITH PASSWORD = '12345' AND LOGIN = true")
self.superuser.execute("GRANT SELECT ON ks.t1 TO mike")
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
self.superuser.execute("CREATE FUNCTION ks.func_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'")
self.superuser.execute("CREATE FUNCTION ks.func_two ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'")
else:
Expand Down Expand Up @@ -2289,15 +2319,15 @@ def test_udf_permissions_validation(self):
* Verify mike can create a new UDF iff he has the CREATE permission
"""
self.setup_table()
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'")
else:
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE java AS 'return input + 1;'")
self.superuser.execute("CREATE ROLE mike WITH PASSWORD = '12345' AND LOGIN = true")
as_mike = self.get_session(user='mike', password='12345')

# can't replace an existing function without ALTER permission on the parent ks
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
cql = "CREATE OR REPLACE FUNCTION ks.plus_one( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript as '1 + input'"
else:
cql = "CREATE OR REPLACE FUNCTION ks.plus_one( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE java as 'return 1 + input;'"
Expand Down Expand Up @@ -2340,7 +2370,7 @@ def test_udf_permissions_validation(self):
InvalidRequest)

# can't create a new function without CREATE on the parent keyspace's collection of functions
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
cql = "CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'"
else:
cql = "CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE java AS 'return input + 1;'"
Expand All @@ -2360,7 +2390,7 @@ def test_drop_role_cleans_up_udf_permissions(self):
"""
self.setup_table()
self.superuser.execute("CREATE ROLE mike WITH PASSWORD = '12345' AND LOGIN = true")
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'")
else:
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE java AS 'return input + 1;'")
Expand Down Expand Up @@ -2391,7 +2421,7 @@ def test_drop_function_and_keyspace_cleans_up_udf_permissions(self):
"""
self.setup_table()
self.superuser.execute("CREATE ROLE mike WITH PASSWORD = '12345' AND LOGIN = true")
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'")
else:
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE java AS 'return input + 1;'")
Expand Down Expand Up @@ -2422,7 +2452,7 @@ def test_udf_with_overloads_permissions(self):
"""
self.setup_table()
self.superuser.execute("CREATE ROLE mike WITH PASSWORD = '12345' AND LOGIN = true")
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'")
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input double ) CALLED ON NULL INPUT RETURNS double LANGUAGE javascript AS 'input + 1'")
else:
Expand Down Expand Up @@ -2469,7 +2499,7 @@ def test_drop_keyspace_cleans_up_function_level_permissions(self):
"""
self.setup_table()
self.superuser.execute("CREATE ROLE mike WITH PASSWORD = '12345' AND LOGIN = true")
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
self.superuser.execute("CREATE FUNCTION ks.state_func (a int, b int) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'a + b'")
else:
self.superuser.execute("CREATE FUNCTION ks.state_func (a int, b int) CALLED ON NULL INPUT RETURNS int LANGUAGE java AS 'return a + b;'")
Expand Down Expand Up @@ -2525,7 +2555,7 @@ def verify_udf_permissions(self, cql):
@param cql The statement to verify. Should contain the UDF ks.plus_one
"""
self.setup_table()
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'")
else:
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE java AS 'return input + 1;'")
Expand All @@ -2549,7 +2579,7 @@ def test_inheritence_of_udf_permissions(self):
self.setup_table()
self.superuser.execute("CREATE ROLE function_user")
self.superuser.execute("GRANT EXECUTE ON ALL FUNCTIONS IN KEYSPACE ks TO function_user")
if self.cluster.version() < LooseVersion('4.2'):
if self.cluster.version() < LooseVersion('4.0'):
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE javascript AS 'input + 1'")
else:
self.superuser.execute("CREATE FUNCTION ks.plus_one ( input int ) CALLED ON NULL INPUT RETURNS int LANGUAGE java AS 'return input + 1;'")
Expand Down
78 changes: 68 additions & 10 deletions bootstrap_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,13 +735,7 @@ def test_decommissioned_wiped_node_can_gossip_to_single_seed(self):
node2.stop(wait_other_notice=False)

# Wipe its data
for data_dir in node2.data_directories():
logger.debug("Deleting {}".format(data_dir))
shutil.rmtree(data_dir)

commitlog_dir = os.path.join(node2.get_path(), 'commitlogs')
logger.debug("Deleting {}".format(commitlog_dir))
shutil.rmtree(commitlog_dir)
self._cleanup(node2)

# Now start it, it should be allowed to join
mark = node2.mark_log()
Expand Down Expand Up @@ -895,6 +889,12 @@ def test_simultaneous_bootstrap(self):
" cannot bootstrap while cassandra.consistent.rangemovement is true"

cluster = self.cluster
configuration_options = {
'request_timeout_in_ms': 120000,
'read_request_timeout_in_ms': 120000,
'range_request_timeout_in_ms': 120000
}
cluster.set_configuration_options(configuration_options)
cluster.set_environment_variable('CASSANDRA_TOKEN_PREGENERATION_DISABLED', 'True')
cluster.populate(1)
cluster.start()
Expand Down Expand Up @@ -930,7 +930,10 @@ def test_simultaneous_bootstrap(self):
# bugs like 9484, where count(*) fails at higher
# data loads.
for _ in range(5):
assert_one(session, "SELECT count(*) from keyspace1.standard1", [500000], cl=ConsistencyLevel.ONE)
logger.info("Querying: SELECT count(*) from keyspace1.standard1")
# Improve reliability for slower/loaded test systems by using larger client timeout
assert_one(session, "SELECT count(*) from keyspace1.standard1", [500000], cl=ConsistencyLevel.ONE, timeout=180)
logger.info("Querying completed")

def test_cleanup(self):
"""
Expand Down Expand Up @@ -979,6 +982,11 @@ def _cleanup(self, node):
logger.debug("Deleting {}".format(data_dir))
shutil.rmtree(data_dir)
shutil.rmtree(commitlog_dir)
metadata_dir = os.path.join(node.get_path(), 'metadata')
if os.path.exists(metadata_dir):
logger.debug("Deleting {}".format(metadata_dir))
shutil.rmtree(metadata_dir)


@since('2.2')
@pytest.mark.ported_to_in_jvm # see org.apache.cassandra.distributed.test.BootstrapBinaryDisabledTest
Expand Down Expand Up @@ -1027,7 +1035,7 @@ def test_bootstrap_binary_disabled(self):

try:
node2.nodetool('join')
pytest.fail('nodetool should have errored and failed to join ring')
pytest.fail(reason='nodetool should have errored and failed to join ring')
except ToolError as t:
assert "Cannot join the ring until bootstrap completes" in t.stdout

Expand All @@ -1052,7 +1060,7 @@ def test_bootstrap_binary_disabled(self):

try:
node3.nodetool('join')
pytest.fail('nodetool should have errored and failed to join ring')
pytest.fail(reason='nodetool should have errored and failed to join ring')
except ToolError as t:
assert "Cannot join the ring until bootstrap completes" in t.stdout

Expand All @@ -1076,6 +1084,56 @@ def nodetool_resume_command(cluster):
nt_resume_cmd += ' -f'
return nt_resume_cmd

@since('4.0')
@pytest.mark.no_vnodes
def test_simple_bootstrap_with_everywhere_strategy(self):
cluster = self.cluster
tokens = cluster.balanced_tokens(2)
cluster.set_configuration_options(values={'num_tokens': 1})

logger.debug("[node1, node2] tokens: %r" % (tokens,))

keys = 10000

# Create a single node cluster
cluster.populate(1)
node1 = cluster.nodelist()[0]
node1.set_configuration_options(values={'initial_token': tokens[0]})
cluster.start()

session = self.patient_cql_connection(node1)
create_ks(session, 'ks', 'EverywhereStrategy')
create_cf(session, 'cf', columns={'c1': 'text', 'c2': 'text'})

insert_statement = session.prepare("INSERT INTO ks.cf (key, c1, c2) VALUES (?, 'value1', 'value2')")
execute_concurrent_with_args(session, insert_statement, [['k%d' % k] for k in range(keys)])

node1.flush()
node1.compact()

# Reads inserted data all during the bootstrap process. We shouldn't
# get any error
query_c1c2(session, random.randint(0, keys - 1), ConsistencyLevel.ONE)
session.shutdown()

# Bootstrapping a new node in the current version
node2 = new_node(cluster)
node2.set_configuration_options(values={'initial_token': tokens[1]})
node2.start(wait_for_binary_proto=True)
node2.compact()

node1.cleanup()
logger.debug("node1 size for ks.cf after cleanup: %s" % float(data_size(node1,'ks','cf')))
node1.compact()
logger.debug("node1 size for ks.cf after compacting: %s" % float(data_size(node1,'ks','cf')))

logger.debug("node2 size for ks.cf after compacting: %s" % float(data_size(node2,'ks','cf')))

size1 = float(data_size(node1,'ks','cf'))
size2 = float(data_size(node2,'ks','cf'))
assert_almost_equal(size1, size2, error=0.3)

assert_bootstrap_state(self, node2, 'COMPLETED')

class TestBootstrap(BootstrapTester):
"""
Expand Down
8 changes: 8 additions & 0 deletions byteman/guardrails/disk_usage_full.btm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
RULE return FULL disk usage
CLASS org.apache.cassandra.service.disk.usage.DiskUsageMonitor
METHOD getState
AT EXIT
IF TRUE
DO
return org.apache.cassandra.service.disk.usage.DiskUsageState.FULL;
ENDRULE
8 changes: 8 additions & 0 deletions byteman/guardrails/disk_usage_stuffed.btm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
RULE return STUFFED disk usage
CLASS org.apache.cassandra.service.disk.usage.DiskUsageMonitor
METHOD getState
AT EXIT
IF TRUE
DO
return org.apache.cassandra.service.disk.usage.DiskUsageState.STUFFED;
ENDRULE
2 changes: 1 addition & 1 deletion byteman/merge_schema_failure_4x.btm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
RULE inject node failure on merge schema exit
CLASS org.apache.cassandra.schema.Schema
METHOD merge
METHOD mergeAndUpdateVersion
AT EXIT
# set flag to only run this rule once.
IF TRUE
Expand Down
Loading