|
@@ -23,6 +23,7 @@ import static org.apache.hadoop.fs.CreateFlag.OVERWRITE;
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
import static org.junit.Assert.assertSame;
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
+import static org.junit.Assume.assumeTrue;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.io.FileOutputStream;
|
|
@@ -66,6 +67,7 @@ import org.apache.hadoop.fs.FileSystem;
|
|
|
import org.apache.hadoop.fs.LocalDirAllocator;
|
|
|
import org.apache.hadoop.fs.Path;
|
|
|
import org.apache.hadoop.fs.permission.FsPermission;
|
|
|
+import org.apache.hadoop.util.Shell;
|
|
|
import org.apache.hadoop.security.UserGroupInformation;
|
|
|
import org.apache.hadoop.yarn.api.records.LocalResource;
|
|
|
import org.apache.hadoop.yarn.api.records.LocalResourceType;
|
|
@@ -308,6 +310,11 @@ public class TestFSDownload {
|
|
|
FileContext files = FileContext.getLocalFSFileContext(conf);
|
|
|
Path basedir = files.makeQualified(new Path("target",
|
|
|
TestFSDownload.class.getSimpleName()));
|
|
|
+
|
|
|
+ // if test directory doesn't have ancestor permission, skip this test
|
|
|
+ FileSystem f = basedir.getFileSystem(conf);
|
|
|
+ assumeTrue(FSDownload.ancestorsHaveExecutePermissions(f, basedir, null));
|
|
|
+
|
|
|
files.mkdir(basedir, null, true);
|
|
|
conf.setStrings(TestFSDownload.class.getName(), basedir.toString());
|
|
|
|