steveloughran commented on a change in pull request #1394: Hadoop-16438 ADLS Gen1 OpenSSL config control URL: https://github.com/apache/hadoop/pull/1394#discussion_r320264926
########## File path: hadoop-tools/hadoop-azure-datalake/src/test/java/org/apache/hadoop/fs/adl/live/TestAdlSdkConfiguration.java ########## @@ -74,4 +75,67 @@ public void testDefaultTimeout() throws IOException { // The default value may vary by SDK, so that value is not tested here. } + + @Test + public void testSSLChannelMode() throws IOException { + AdlFileSystem fs = null; + Configuration conf = null; + + conf = AdlStorageConfiguration.getConfiguration(); + conf.set(ADL_SSL_CHANNEL_MODE, "OpenSSl"); + try { + fs = (AdlFileSystem) + (AdlStorageConfiguration.createStorageConnector(conf)); + } catch (URISyntaxException e) { + throw new IllegalStateException("ADL FileSystem initialization failed. " + + "Please check test.fs.adl.name property.", e); + } + + SSLChannelMode sslChannelMode = fs.getAdlClient().getSSLChannelMode(); + Assert.assertTrue("Channel mode needs to be OpenSSL", + sslChannelMode == SSLChannelMode.OpenSSL); + + conf = AdlStorageConfiguration.getConfiguration(); + conf.set(ADL_SSL_CHANNEL_MODE, "Default_JSE"); + try { + fs = (AdlFileSystem) + (AdlStorageConfiguration.createStorageConnector(conf)); + } catch (URISyntaxException e) { + throw new IllegalStateException("Can not initialize ADL FileSystem. " + + "Please check test.fs.adl.name property.", e); + } + + sslChannelMode = fs.getAdlClient().getSSLChannelMode(); + Assert.assertTrue("Channel mode needs to be Default_JSE", + sslChannelMode == SSLChannelMode.Default_JSE); + + conf = AdlStorageConfiguration.getConfiguration(); + conf.set(ADL_SSL_CHANNEL_MODE, "Default"); + try { + fs = (AdlFileSystem) + (AdlStorageConfiguration.createStorageConnector(conf)); + } catch (URISyntaxException e) { + throw new IllegalStateException("Can not initialize ADL FileSystem. " + + "Please check test.fs.adl.name property.", e); + } + + sslChannelMode = fs.getAdlClient().getSSLChannelMode(); + Assert.assertTrue("Channel mode needs to be Default", + sslChannelMode == SSLChannelMode.Default); + + conf = AdlStorageConfiguration.getConfiguration(); + conf.set(ADL_SSL_CHANNEL_MODE, "Invalid"); + try { + fs = (AdlFileSystem) + (AdlStorageConfiguration.createStorageConnector(conf)); + } catch (URISyntaxException e) { + throw new IllegalStateException("Can not initialize ADL FileSystem. " + + "Please check test.fs.adl.name property.", e); + } + + sslChannelMode = fs.getAdlClient().getSSLChannelMode(); + Assert.assertTrue("Channel mode needs to be Default when adl.ssl" Review comment: assertEquals for the detailed exception message ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org