From c0c7e6fabd573df85791d7ec4c536fd48280883f Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Tue, 16 Sep 2014 23:36:10 -0700 Subject: [PATCH] HADOOP-11062. CryptoCodec testcases requiring OpenSSL should be run only if -Pnative is used. (asuresh via tucu) --- .../hadoop-common/CHANGES.txt | 3 +++ hadoop-common-project/hadoop-common/pom.xml | 3 +++ .../apache/hadoop/crypto/TestCryptoCodec.java | 18 ++++++++++++++++-- hadoop-hdfs-project/hadoop-hdfs/pom.xml | 7 +++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 11151f0223..f0fcab5580 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -821,6 +821,9 @@ Release 2.6.0 - UNRELEASED HADOOP-11097. kms docs say proxyusers, not proxyuser for config params. (clamb via tucu) + HADOOP-11062. CryptoCodec testcases requiring OpenSSL should be run + only if -Pnative is used. (asuresh via tucu) + Release 2.5.1 - 2014-09-05 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/pom.xml b/hadoop-common-project/hadoop-common/pom.xml index ae495be0e6..0183e292c8 100644 --- a/hadoop-common-project/hadoop-common/pom.xml +++ b/hadoop-common-project/hadoop-common/pom.xml @@ -375,6 +375,7 @@ ${startKdc} ${kdc.resource.dir} + ${runningWithNative} @@ -507,6 +508,7 @@ false + true @@ -626,6 +628,7 @@ false + true true diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoCodec.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoCodec.java index 298f4ef8b0..79987cec37 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoCodec.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoCodec.java @@ -59,7 +59,14 @@ public class TestCryptoCodec { @Test(timeout=120000) public void testJceAesCtrCryptoCodec() throws Exception { - Assume.assumeTrue(NativeCodeLoader.buildSupportsOpenssl()); + if (!"true".equalsIgnoreCase(System.getProperty("runningWithNative"))) { + LOG.warn("Skipping since test was not run with -Pnative flag"); + Assume.assumeTrue(false); + } + if (!NativeCodeLoader.buildSupportsOpenssl()) { + LOG.warn("Skipping test since openSSL library not loaded"); + Assume.assumeTrue(false); + } Assert.assertEquals(null, OpensslCipher.getLoadingFailureReason()); cryptoCodecTest(conf, seed, 0, jceCodecClass, jceCodecClass); cryptoCodecTest(conf, seed, count, jceCodecClass, jceCodecClass); @@ -68,7 +75,14 @@ public void testJceAesCtrCryptoCodec() throws Exception { @Test(timeout=120000) public void testOpensslAesCtrCryptoCodec() throws Exception { - Assume.assumeTrue(NativeCodeLoader.buildSupportsOpenssl()); + if (!"true".equalsIgnoreCase(System.getProperty("runningWithNative"))) { + LOG.warn("Skipping since test was not run with -Pnative flag"); + Assume.assumeTrue(false); + } + if (!NativeCodeLoader.buildSupportsOpenssl()) { + LOG.warn("Skipping test since openSSL library not loaded"); + Assume.assumeTrue(false); + } Assert.assertEquals(null, OpensslCipher.getLoadingFailureReason()); cryptoCodecTest(conf, seed, 0, opensslCodecClass, opensslCodecClass); cryptoCodecTest(conf, seed, count, opensslCodecClass, opensslCodecClass); diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml b/hadoop-hdfs-project/hadoop-hdfs/pom.xml index b1707fef00..dade77d734 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml @@ -209,6 +209,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> ${startKdc} ${kdc.resource.dir} + ${runningWithNative} @@ -386,6 +387,9 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> windows + + true + @@ -476,6 +480,9 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> false + + true +