maulin-vasavada commented on code in PR #3985:
URL: https://github.com/apache/cassandra/pull/3985#discussion_r2025964691


##########
test/unit/org/apache/cassandra/tools/LoaderOptionsTest.java:
##########
@@ -85,6 +85,34 @@ public void testEncryptionSettings() throws Exception
         assertEquals("test.jks", options.clientEncOptions.keystore);
     }
 
+    /**
+     * Tests for client_encryption_options override from the command line.
+     */
+    @Test
+    public void testEncryptionSettingsOverride() throws Exception
+    {
+        // Default Cassandra config
+        File config = new File(Paths.get(".", "test", "conf", 
"cassandra-mtls.yaml").normalize());
+        String[] args = { "-d", "127.9.9.1", "-f", config.absolutePath(),
+                          "-ts", "test.jks", "-tspw", "truststorePass1",
+                          "-ks", "test.jks", "-kspw", "testdata1",
+                          "--ssl-ciphers", "TLS_RSA_WITH_AES_256_CBC_SHA",
+                          "--ssl-alg", "SunX509", "--store-type", "JKS", 
"--ssl-protocol", "TLS",
+                          sstableDirName("legacy_sstables", 
"legacy_ma_simple") };
+        LoaderOptions options = 
LoaderOptions.builder().parseArgs(args).build();
+        // Below two lines validating server encryption options is to verify 
that we are loading config from the yaml
+        assertEquals("test/conf/cassandra_ssl_test.keystore", 
options.serverEncOptions.keystore);

Review Comment:
   I agree that in most tests we want to load the config yamls as suggested 
here. However, in this case this is testing `-f` command line argument which 
requires a file path provided to the tool's command line hence couple of lines 
before we are anyway building the absolute path with `File config = new 
File(Paths.get(".", "test", "conf", "cassandra-mtls.yaml").normalize());` Given 
this, we already are hardcoding the parent folder path etc. Hence, I believe 
the current test code should not need change. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to