Ver Fonte

HADOOP-12200. TestCryptoStreamsWithOpensslAesCtrCryptoCodec should be skipped in non-native profile. Contributed by Masatake Iwasaki.

(cherry picked from commit 6b7692c468931215ec0de7e11f0bdf15b80e68ce)
Akira Ajisaka há 10 anos atrás
pai
commit
ee07df688a

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -462,6 +462,9 @@ Release 2.8.0 - UNRELEASED
     HADOOP-12117. Potential NPE from Configuration#loadProperty with
     HADOOP-12117. Potential NPE from Configuration#loadProperty with
     allowNullValueProperties set. (zhihai xu via vinayakumarb)
     allowNullValueProperties set. (zhihai xu via vinayakumarb)
 
 
+    HADOOP-12200. TestCryptoStreamsWithOpensslAesCtrCryptoCodec should be
+    skipped in non-native profile. (Masatake Iwasaki via aajisaka)
+
 Release 2.7.2 - UNRELEASED
 Release 2.7.2 - UNRELEASED
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 3 - 0
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoStreamsWithOpensslAesCtrCryptoCodec.java

@@ -19,16 +19,19 @@ package org.apache.hadoop.crypto;
 
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
 import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
+import org.apache.hadoop.util.NativeCodeLoader;
 import org.junit.BeforeClass;
 import org.junit.BeforeClass;
 
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assume.assumeTrue;
 
 
 public class TestCryptoStreamsWithOpensslAesCtrCryptoCodec 
 public class TestCryptoStreamsWithOpensslAesCtrCryptoCodec 
     extends TestCryptoStreams {
     extends TestCryptoStreams {
   
   
   @BeforeClass
   @BeforeClass
   public static void init() throws Exception {
   public static void init() throws Exception {
+    assumeTrue(NativeCodeLoader.isNativeCodeLoaded());
     Configuration conf = new Configuration();
     Configuration conf = new Configuration();
     conf.set(
     conf.set(
         CommonConfigurationKeysPublic.HADOOP_SECURITY_CRYPTO_CODEC_CLASSES_AES_CTR_NOPADDING_KEY,
         CommonConfigurationKeysPublic.HADOOP_SECURITY_CRYPTO_CODEC_CLASSES_AES_CTR_NOPADDING_KEY,