From ad881214bc5d63c8bdd6a772da1d28d75fa849d0 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Tue, 29 Oct 2019 17:09:26 +0000 Subject: [PATCH] HADOOP-16669. TestRawLocalFileSystemContract.testPermission fails if no native library. Contributed by Steve Loughran. Change-Id: I622e36f17a63c775c5e33e93b8b26e461d0bc451 --- .../org/apache/hadoop/fs/TestRawLocalFileSystemContract.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestRawLocalFileSystemContract.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestRawLocalFileSystemContract.java index ebf9ea75e7f..5b6e50850e4 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestRawLocalFileSystemContract.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestRawLocalFileSystemContract.java @@ -22,12 +22,14 @@ import java.io.File; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.test.GenericTestUtils; import org.apache.hadoop.test.StatUtils; +import org.apache.hadoop.util.NativeCodeLoader; import org.apache.hadoop.util.Shell; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assume.assumeTrue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -91,6 +93,8 @@ public class TestRawLocalFileSystemContract extends FileSystemContractBaseTest { @Test @SuppressWarnings("deprecation") public void testPermission() throws Exception { + assumeTrue("No native library", + NativeCodeLoader.isNativeCodeLoaded()); Path testDir = getTestBaseDir(); String testFilename = "teststat2File"; Path path = new Path(testDir, testFilename);