From 5906268f0dd63a93eb591ddccf70d23b15e5c2ed Mon Sep 17 00:00:00 2001 From: Sahil Takiar Date: Mon, 20 May 2019 19:36:44 -0500 Subject: [PATCH] HADOOP-16321: ITestS3ASSL+TestOpenSSLSocketFactory failing with java.lang.UnsatisfiedLinkErrors --- .../hadoop/security/ssl/TestOpenSSLSocketFactory.java | 8 ++++++-- .../test/java/org/apache/hadoop/fs/s3a/ITestS3ASSL.java | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestOpenSSLSocketFactory.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestOpenSSLSocketFactory.java index ea881e990b9..41ec3e4516f 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestOpenSSLSocketFactory.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestOpenSSLSocketFactory.java @@ -35,7 +35,10 @@ public class TestOpenSSLSocketFactory { @Test public void testOpenSSL() throws IOException { - assumeTrue(NativeCodeLoader.buildSupportsOpenssl()); + assumeTrue("Unable to load native libraries", + NativeCodeLoader.isNativeCodeLoaded()); + assumeTrue("Build was not compiled with support for OpenSSL", + NativeCodeLoader.buildSupportsOpenssl()); OpenSSLSocketFactory.initializeDefaultFactory( OpenSSLSocketFactory.SSLChannelMode.OpenSSL); assertThat(OpenSSLSocketFactory.getDefaultFactory() @@ -44,7 +47,8 @@ public class TestOpenSSLSocketFactory { @Test public void testJSEEJava8() throws IOException { - assumeTrue(System.getProperty("java.version").startsWith("1.8")); + assumeTrue("Not running on Java 8", + System.getProperty("java.version").startsWith("1.8")); OpenSSLSocketFactory.initializeDefaultFactory( OpenSSLSocketFactory.SSLChannelMode.Default_JSSE); assertThat(Arrays.stream(OpenSSLSocketFactory.getDefaultFactory() diff --git a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3ASSL.java b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3ASSL.java index 794bf808266..4232b0f270e 100644 --- a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3ASSL.java +++ b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3ASSL.java @@ -40,7 +40,10 @@ public class ITestS3ASSL extends AbstractS3ATestBase { @Test public void testOpenSSL() throws IOException { - assumeTrue(NativeCodeLoader.buildSupportsOpenssl()); + assumeTrue("Unable to load native libraries", + NativeCodeLoader.isNativeCodeLoaded()); + assumeTrue("Build was not compiled with support for OpenSSL", + NativeCodeLoader.buildSupportsOpenssl()); Configuration conf = new Configuration(getConfiguration()); conf.setEnum(Constants.SSL_CHANNEL_MODE, OpenSSLSocketFactory.SSLChannelMode.OpenSSL);