[ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186450#comment-13186450 ]
Hudson commented on HADOOP-7974: -------------------------------- Integrated in Hadoop-Common-trunk-Commit #1545 (See [https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1545/]) HADOOP-7974. TestViewFsTrash incorrectly determines the user's home directory. Contributed by Harsh J eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1231640 Files : * /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java > TestViewFsTrash incorrectly determines the user's home directory > ---------------------------------------------------------------- > > Key: HADOOP-7974 > URL: https://issues.apache.org/jira/browse/HADOOP-7974 > Project: Hadoop Common > Issue Type: Bug > Components: fs > Affects Versions: 0.23.1 > Reporter: Eli Collins > Assignee: Harsh J > Fix For: 0.23.1 > > Attachments: HADOOP-7974.patch > > > HADOOP-7284 added a test called TestViewFsTrash which contains the following > code to determine the user's home directory. It only works if the user's > directory is one level deep, and breaks if the home directory is more than > one level deep (eg user hudson, who's home dir might be /usr/lib/hudson > instead of /home/hudson). > {code} > // create a link for home directory so that trash path works > // set up viewfs's home dir root to point to home dir root on target > // But home dir is different on linux, mac etc. > // Figure it out by calling home dir on target > > String homeDir = fsTarget.getHomeDirectory().toUri().getPath(); > int indexOf2ndSlash = homeDir.indexOf('/', 1); > String homeDirRoot = homeDir.substring(0, indexOf2ndSlash); > ConfigUtil.addLink(conf, homeDirRoot, > fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); > ConfigUtil.setHomeDirConf(conf, homeDirRoot); > Log.info("Home dir base " + homeDirRoot); > {code} > Seems like we should instead search from the end of the path for the last > slash and use that as the base, ie ask the home directory for its parent. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira