HADOOP-16669. TestRawLocalFileSystemContract.testPermission fails if no native library.

Contributed by Steve Loughran.

Change-Id: I622e36f17a63c775c5e33e93b8b26e461d0bc451
This commit is contained in:
Steve Loughran 2019-10-29 17:09:26 +00:00
parent e32ab5e179
commit bd498bac86
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0

View File

@ -24,12 +24,14 @@
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.test.GenericTestUtils; import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.StatUtils; import org.apache.hadoop.test.StatUtils;
import org.apache.hadoop.util.NativeCodeLoader;
import org.apache.hadoop.util.Shell; import org.apache.hadoop.util.Shell;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assume.assumeTrue;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -127,6 +129,8 @@ protected boolean filesystemIsCaseSensitive() {
@Test @Test
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public void testPermission() throws Exception { public void testPermission() throws Exception {
assumeTrue("No native library",
NativeCodeLoader.isNativeCodeLoaded());
Path testDir = getTestBaseDir(); Path testDir = getTestBaseDir();
String testFilename = "teststat2File"; String testFilename = "teststat2File";
Path path = new Path(testDir, testFilename); Path path = new Path(testDir, testFilename);