This is an automated email from the ASF dual-hosted git repository.

brandonwilliams pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 3729999  Add test for unclean FQL dir
3729999 is described below

commit 3729999ace6d8a5b7f4ab3d768e691f5176e7d9f
Author: Brandon Williams <brandonwilli...@apache.org>
AuthorDate: Mon Dec 6 13:19:03 2021 -0600

    Add test for unclean FQL dir
    
    Patch by brandonwilliams; reviewed by bereng for CASSANDRA-17136
---
 fqltool_test.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/fqltool_test.py b/fqltool_test.py
index f7e7c1a..cfe590c 100644
--- a/fqltool_test.py
+++ b/fqltool_test.py
@@ -160,6 +160,27 @@ class TestFQLTool(Tester):
             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
+        """
+        self.cluster.populate(1).start()
+        node1 = self.cluster.nodelist()[0]
+
+        with tempfile.TemporaryDirectory() as temp_dir:
+            fqldir = tempfile.mkdtemp(dir=temp_dir)
+            baddir = os.path.join(fqldir, 'baddir')
+            os.mkdir(baddir)
+            badfile = os.path.join(baddir, 'badfile')
+            with open(os.path.join(badfile), 'w')  as f:
+                    f.write('bad')
+            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)]

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to