Skip to content
Browse files
Add test for unclean FQL dir
Patch by brandonwilliams; reviewed by bereng for CASSANDRA-17136
  • Loading branch information
driftx committed Dec 9, 2021
1 parent e215a72 commit 3729999ace6d8a5b7f4ab3d768e691f5176e7d9f
Showing 1 changed file with 21 additions and 0 deletions.
@@ -160,6 +160,27 @@ def test_jvmdtest(self):
rs = session.execute("SELECT * FROM fql_ks.fql_table;")
assert(len(list(rs)) == 1)

def test_unclean_enable(self):
test that fql can be enabled on a dirty directory
@jira_ticket CASSANDRA-17136
node1 = self.cluster.nodelist()[0]

with tempfile.TemporaryDirectory() as temp_dir:
fqldir = tempfile.mkdtemp(dir=temp_dir)
baddir = os.path.join(fqldir, 'baddir')
badfile = os.path.join(baddir, 'badfile')
with open(os.path.join(badfile), 'w') as f:
os.chmod(badfile, 0o000)
os.chmod(baddir, 0o000)
node1.nodetool("enablefullquerylog --path={}".format(fqldir))
# so teardown doesn't fail
os.chmod(baddir, 0o777)

def _run_fqltool_replay(self, node, logdirs, target, queries, results, replay_ddl_statements=False):
fqltool = self.fqltool(node)
args = [fqltool, "replay", "--target {}".format(target)]

0 comments on commit 3729999

Please sign in to comment.