Skip to content

Commit 7eeec00

Browse files
committed
HADOOP-19719. Wildfly Followup: TestDelegatingSSLSocketFactory
Downgrade to a skipped tests if the OS doesn't have GLIBC_2.34. The branch-3.4 version of the patch doesn't delete testJSEENoGCMJava8() and uses classic junit assumeTrue() calls.
1 parent 4cbe0ac commit 7eeec00

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestDelegatingSSLSocketFactory.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import org.apache.hadoop.util.NativeCodeLoader;
2727

28+
import static org.apache.hadoop.test.GenericTestUtils.assertExceptionContains;
2829
import static org.assertj.core.api.Assertions.assertThat;
2930
import static org.junit.Assume.assumeTrue;
3031

@@ -34,15 +35,21 @@
3435
public class TestDelegatingSSLSocketFactory {
3536

3637
@Test
37-
public void testOpenSSL() throws IOException {
38+
public void testOpenSSL() {
3839
assumeTrue("Unable to load native libraries",
3940
NativeCodeLoader.isNativeCodeLoaded());
4041
assumeTrue("Build was not compiled with support for OpenSSL",
4142
NativeCodeLoader.buildSupportsOpenssl());
42-
DelegatingSSLSocketFactory.initializeDefaultFactory(
43-
DelegatingSSLSocketFactory.SSLChannelMode.OpenSSL);
44-
assertThat(DelegatingSSLSocketFactory.getDefaultFactory()
45-
.getProviderName()).contains("openssl");
43+
try {
44+
DelegatingSSLSocketFactory.initializeDefaultFactory(
45+
DelegatingSSLSocketFactory.SSLChannelMode.OpenSSL);
46+
assertThat(DelegatingSSLSocketFactory.getDefaultFactory()
47+
.getProviderName()).contains("openssl");
48+
} catch (IOException e) {
49+
// if this is caused by a wildfly version error, downgrade to an assume
50+
assertExceptionContains("GLIBC_2.34", e);
51+
assumeTrue("wildfly library not compatible with this OS version", false);
52+
}
4653
}
4754

4855
@Test

0 commit comments

Comments
 (0)