svn merge -c 1503976 merging to branch-2 to fix HADOOP-9738. TestDistCh fails. Contributed by Jing Zhao.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1503977 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
17e8683dc1
commit
727acb377e
|
@ -347,6 +347,8 @@ Release 2.1.0-beta - 2013-07-02
|
||||||
HADOOP-9707. Fix register lists for crc32c inline assembly. (todd via
|
HADOOP-9707. Fix register lists for crc32c inline assembly. (todd via
|
||||||
kihwal)
|
kihwal)
|
||||||
|
|
||||||
|
HADOOP-9738. TestDistCh fails. (jing9 via kihwal)
|
||||||
|
|
||||||
BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS
|
BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS
|
||||||
|
|
||||||
HADOOP-8924. Hadoop Common creating package-info.java must not depend on
|
HADOOP-8924. Hadoop Common creating package-info.java must not depend on
|
||||||
|
|
|
@ -24,8 +24,6 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
import javax.security.auth.login.LoginException;
|
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.fs.FileStatus;
|
import org.apache.hadoop.fs.FileStatus;
|
||||||
import org.apache.hadoop.fs.FileSystem;
|
import org.apache.hadoop.fs.FileSystem;
|
||||||
|
@ -47,10 +45,7 @@ import org.apache.hadoop.mapred.OutputCollector;
|
||||||
import org.apache.hadoop.mapred.RecordReader;
|
import org.apache.hadoop.mapred.RecordReader;
|
||||||
import org.apache.hadoop.mapred.Reporter;
|
import org.apache.hadoop.mapred.Reporter;
|
||||||
import org.apache.hadoop.mapred.SequenceFileRecordReader;
|
import org.apache.hadoop.mapred.SequenceFileRecordReader;
|
||||||
import org.apache.hadoop.mapreduce.Job;
|
|
||||||
import org.apache.hadoop.mapreduce.JobSubmissionFiles;
|
import org.apache.hadoop.mapreduce.JobSubmissionFiles;
|
||||||
import org.apache.hadoop.mapreduce.jobhistory.JobSubmittedEvent;
|
|
||||||
import org.apache.hadoop.security.UserGroupInformation;
|
|
||||||
import org.apache.hadoop.util.StringUtils;
|
import org.apache.hadoop.util.StringUtils;
|
||||||
import org.apache.hadoop.util.ToolRunner;
|
import org.apache.hadoop.util.ToolRunner;
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,8 @@ public class TestDistCh extends junit.framework.TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ChPermissionStatus extends PermissionStatus {
|
static class ChPermissionStatus extends PermissionStatus {
|
||||||
|
private final boolean defaultPerm;
|
||||||
|
|
||||||
ChPermissionStatus(FileStatus filestatus) {
|
ChPermissionStatus(FileStatus filestatus) {
|
||||||
this(filestatus, "", "", "");
|
this(filestatus, "", "", "");
|
||||||
}
|
}
|
||||||
|
@ -121,6 +123,7 @@ public class TestDistCh extends junit.framework.TestCase {
|
||||||
super("".equals(owner)? filestatus.getOwner(): owner,
|
super("".equals(owner)? filestatus.getOwner(): owner,
|
||||||
"".equals(group)? filestatus.getGroup(): group,
|
"".equals(group)? filestatus.getGroup(): group,
|
||||||
"".equals(permission)? filestatus.getPermission(): new FsPermission(Short.parseShort(permission, 8)));
|
"".equals(permission)? filestatus.getPermission(): new FsPermission(Short.parseShort(permission, 8)));
|
||||||
|
defaultPerm = permission == null || "".equals(permission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +144,7 @@ public class TestDistCh extends junit.framework.TestCase {
|
||||||
runLsr(shell, tree.root, 0);
|
runLsr(shell, tree.root, 0);
|
||||||
|
|
||||||
final String[] args = new String[NUN_SUBS];
|
final String[] args = new String[NUN_SUBS];
|
||||||
final PermissionStatus[] newstatus = new PermissionStatus[NUN_SUBS];
|
final ChPermissionStatus[] newstatus = new ChPermissionStatus[NUN_SUBS];
|
||||||
|
|
||||||
|
|
||||||
args[0]="/test/testDistCh/sub0:sub1::";
|
args[0]="/test/testDistCh/sub0:sub1::";
|
||||||
|
@ -185,13 +188,11 @@ public class TestDistCh extends junit.framework.TestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void checkFileStatus(ChPermissionStatus expected, FileStatus actual) {
|
||||||
|
|
||||||
static void checkFileStatus(PermissionStatus expected, FileStatus actual) {
|
|
||||||
assertEquals(expected.getUserName(), actual.getOwner());
|
assertEquals(expected.getUserName(), actual.getOwner());
|
||||||
assertEquals(expected.getGroupName(), actual.getGroup());
|
assertEquals(expected.getGroupName(), actual.getGroup());
|
||||||
FsPermission perm = expected.getPermission();
|
FsPermission perm = expected.getPermission();
|
||||||
if (actual.isFile()) {
|
if (actual.isFile() && expected.defaultPerm) {
|
||||||
perm = perm.applyUMask(UMASK);
|
perm = perm.applyUMask(UMASK);
|
||||||
}
|
}
|
||||||
assertEquals(perm, actual.getPermission());
|
assertEquals(perm, actual.getPermission());
|
||||||
|
|
Loading…
Reference in New Issue