[ 
https://issues.apache.org/jira/browse/HDFS-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12985874#action_12985874
 ] 

Po Cheung commented on HDFS-1084:
---------------------------------

testFilePermissions has the same failure on Windows because chmod in cygwin 
work with POSIX paths only, not Windows paths.  Proposed fix is to convert 
Windows paths to POSIX paths using the cygpath utility in 
RawLocalFileSystem.execCommand:

{noformat}
--- src/java/org/apache/hadoop/fs/RawLocalFileSystem.java       (revision 
1061025)
+++ src/java/org/apache/hadoop/fs/RawLocalFileSystem.java       (working copy)
@@ -562,8 +562,10 @@
     String[] args = new String[cmd.length + 1];
     System.arraycopy(cmd, 0, args, 0, cmd.length);
     args[cmd.length] = f.getCanonicalPath();
+    if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) {
+       args[cmd.length] = Shell.execCommand("cygpath", f.getCanonicalPath());
+    }
     String output = Shell.execCommand(args);
     return output;
   }
{noformat}

> TestDFSShell fails in trunk.
> ----------------------------
>
>                 Key: HDFS-1084
>                 URL: https://issues.apache.org/jira/browse/HDFS-1084
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Shvachko
>            Priority: Blocker
>             Fix For: 0.22.0
>
>
> {{TestDFSShell.testFilePermissions()}} fails on an assert attached below. I 
> see it on my Linux box. Don't see it failing with Hudson, and the same test 
> runs fine in 0.21 branch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to