HADOOP-7974. TestViewFsTrash incorrectly determines the user's home directory. Contributed by Harsh J

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1231640 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2012-01-15 08:51:48 +00:00
parent 69290d383c
commit aee1bb81c6
2 changed files with 12 additions and 10 deletions

View File

@ -271,6 +271,9 @@ Release 0.23.1 - Unreleased
HADOOP-7964. Deadlock in NetUtils and SecurityUtil class initialization. HADOOP-7964. Deadlock in NetUtils and SecurityUtil class initialization.
(Daryn Sharp via suresh) (Daryn Sharp via suresh)
HADOOP-7974. TestViewFsTrash incorrectly determines the user's home
directory. (harsh via eli)
Release 0.23.0 - 2011-11-01 Release 0.23.0 - 2011-11-01
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -79,9 +79,8 @@ public void setUp() throws Exception {
// But home dir is different on linux, mac etc. // But home dir is different on linux, mac etc.
// Figure it out by calling home dir on target // Figure it out by calling home dir on target
String homeDir = fsTarget.getHomeDirectory().toUri().getPath(); String homeDirRoot = fsTarget.getHomeDirectory()
int indexOf2ndSlash = homeDir.indexOf('/', 1); .getParent().toUri().getPath();
String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
ConfigUtil.addLink(conf, homeDirRoot, ConfigUtil.addLink(conf, homeDirRoot,
fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); fsTarget.makeQualified(new Path(homeDirRoot)).toUri());
ConfigUtil.setHomeDirConf(conf, homeDirRoot); ConfigUtil.setHomeDirConf(conf, homeDirRoot);