Repository: hadoop
Updated Branches:
  refs/heads/branch-2 75bd79231 -> 1c847fdd6


HADOOP-11062. CryptoCodec testcases requiring OpenSSL should be run only if 
-Pnative is used. (asuresh via tucu)

Conflicts:
        hadoop-hdfs-project/hadoop-hdfs/pom.xml


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/1c847fdd
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1c847fdd
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1c847fdd

Branch: refs/heads/branch-2
Commit: 1c847fdd61414f7f564de2cc477621edac8164b5
Parents: 75bd792
Author: Alejandro Abdelnur <t...@apache.org>
Authored: Tue Sep 16 23:36:10 2014 -0700
Committer: Alejandro Abdelnur <t...@apache.org>
Committed: Tue Sep 16 23:37:21 2014 -0700

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt   |  3 +++
 hadoop-common-project/hadoop-common/pom.xml       |  3 +++
 .../org/apache/hadoop/crypto/TestCryptoCodec.java | 18 ++++++++++++++++--
 hadoop-hdfs-project/hadoop-hdfs/pom.xml           | 11 +++++++++++
 4 files changed, 33 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/1c847fdd/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt 
b/hadoop-common-project/hadoop-common/CHANGES.txt
index d6b05f7..0fad37d 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -486,6 +486,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

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1c847fdd/hadoop-common-project/hadoop-common/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/pom.xml 
b/hadoop-common-project/hadoop-common/pom.xml
index cb6bafa..4a9fae3 100644
--- a/hadoop-common-project/hadoop-common/pom.xml
+++ b/hadoop-common-project/hadoop-common/pom.xml
@@ -390,6 +390,7 @@
           <systemPropertyVariables>
             <startKdc>${startKdc}</startKdc>
             <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
+            <runningWithNative>${runningWithNative}</runningWithNative>
           </systemPropertyVariables>
         </configuration>
       </plugin>
@@ -528,6 +529,7 @@
         <openssl.lib></openssl.lib>
         <openssl.include></openssl.include>
         <require.openssl>false</require.openssl>
+        <runningWithNative>true</runningWithNative>
       </properties>
       <build>
         <plugins>
@@ -647,6 +649,7 @@
         <openssl.lib></openssl.lib>
         <openssl.include></openssl.include>
         <require.openssl>false</require.openssl>
+        <runningWithNative>true</runningWithNative>
         <bundle.openssl.in.bin>true</bundle.openssl.in.bin>
       </properties>
       <build>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1c847fdd/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoCodec.java
----------------------------------------------------------------------
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 298f4ef..79987ce 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 class TestCryptoCodec {
   
   @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);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1c847fdd/hadoop-hdfs-project/hadoop-hdfs/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml 
b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
index 13b3bfe..b196293 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
@@ -215,6 +215,11 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd";>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
+          <systemPropertyVariables>
+            <startKdc>${startKdc}</startKdc>
+            <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
+            <runningWithNative>${runningWithNative}</runningWithNative>
+          </systemPropertyVariables>
           <properties>
             <property>
               <name>listener</name>
@@ -529,6 +534,9 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd";>
           <family>windows</family>
         </os>
       </activation>
+      <properties>
+        <runningWithNative>true</runningWithNative>
+      </properties>
       <build>
         <plugins>
           <plugin>
@@ -619,6 +627,9 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd";>
       <activation>
         <activeByDefault>false</activeByDefault>
       </activation>
+      <properties>
+        <runningWithNative>true</runningWithNative>
+      </properties>
       <build>
         <plugins>
           <plugin>

Reply via email to