YARN-2270. Made TestFSDownload#testDownloadPublicWithStatCache be skipped when there’s no ancestor permissions. Contributed by Akira Ajisaka.
svn merge --ignore-ancestry -c 1612460 ../../trunk/ git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.5@1612462 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8dbe1b4d2c
commit
24f813aa20
|
@ -328,6 +328,9 @@ Release 2.5.0 - UNRELEASED
|
||||||
YARN-2158. Improved assertion messages of TestRMWebServicesAppsModification.
|
YARN-2158. Improved assertion messages of TestRMWebServicesAppsModification.
|
||||||
(Varun Vasudev via zjshen)
|
(Varun Vasudev via zjshen)
|
||||||
|
|
||||||
|
YARN-2270. Made TestFSDownload#testDownloadPublicWithStatCache be skipped
|
||||||
|
when there’s no ancestor permissions. (Akira Ajisaka via zjshen)
|
||||||
|
|
||||||
Release 2.4.1 - 2014-06-23
|
Release 2.4.1 - 2014-06-23
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -177,9 +177,10 @@ public class FSDownload implements Callable<Path> {
|
||||||
/**
|
/**
|
||||||
* Returns true if all ancestors of the specified path have the 'execute'
|
* Returns true if all ancestors of the specified path have the 'execute'
|
||||||
* permission set for all users (i.e. that other users can traverse
|
* permission set for all users (i.e. that other users can traverse
|
||||||
* the directory heirarchy to the given path)
|
* the directory hierarchy to the given path)
|
||||||
*/
|
*/
|
||||||
private static boolean ancestorsHaveExecutePermissions(FileSystem fs,
|
@VisibleForTesting
|
||||||
|
static boolean ancestorsHaveExecutePermissions(FileSystem fs,
|
||||||
Path path, LoadingCache<Path,Future<FileStatus>> statCache)
|
Path path, LoadingCache<Path,Future<FileStatus>> statCache)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Path current = path;
|
Path current = path;
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static org.apache.hadoop.fs.CreateFlag.OVERWRITE;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertSame;
|
import static org.junit.Assert.assertSame;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
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.LocalDirAllocator;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.fs.permission.FsPermission;
|
import org.apache.hadoop.fs.permission.FsPermission;
|
||||||
|
import org.apache.hadoop.util.Shell;
|
||||||
import org.apache.hadoop.security.UserGroupInformation;
|
import org.apache.hadoop.security.UserGroupInformation;
|
||||||
import org.apache.hadoop.yarn.api.records.LocalResource;
|
import org.apache.hadoop.yarn.api.records.LocalResource;
|
||||||
import org.apache.hadoop.yarn.api.records.LocalResourceType;
|
import org.apache.hadoop.yarn.api.records.LocalResourceType;
|
||||||
|
@ -308,6 +310,11 @@ public class TestFSDownload {
|
||||||
FileContext files = FileContext.getLocalFSFileContext(conf);
|
FileContext files = FileContext.getLocalFSFileContext(conf);
|
||||||
Path basedir = files.makeQualified(new Path("target",
|
Path basedir = files.makeQualified(new Path("target",
|
||||||
TestFSDownload.class.getSimpleName()));
|
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);
|
files.mkdir(basedir, null, true);
|
||||||
conf.setStrings(TestFSDownload.class.getName(), basedir.toString());
|
conf.setStrings(TestFSDownload.class.getName(), basedir.toString());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue