Ver código fonte

HADOOP-19603. Fix TestFsShellList.testList on Windows (#7771)

* The test
  `org.apache.hadoop.fs.TestFsShellList#testList`
  creates files with special characters and
  tries to list them using `ls`.
* Filenames with special characters aren't
  allowed on Windows.
* Thus, we need to modify the test to only
  test for non-special characters on Windows
  and include the filenames with special
  characters on non-Windows environments.
Gautham B A 3 dias atrás
pai
commit
729f19f233

+ 5 - 2
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShellList.java

@@ -66,9 +66,12 @@ public class TestFsShellList {
     String[] lsArgv = new String[]{"-ls", testRootDir.toString()};
     assertThat(shell.run(lsArgv)).isEqualTo(0);
 
-    createFile(new Path(testRootDir, "abc\bd\tef"));
+    if (!Path.WINDOWS) {
+      createFile(new Path(testRootDir, "abc\bd\tef"));
+      createFile(new Path(testRootDir, "qq\r123"));
+    }
+
     createFile(new Path(testRootDir, "ghi"));
-    createFile(new Path(testRootDir, "qq\r123"));
     lsArgv = new String[]{"-ls", testRootDir.toString()};
     assertThat(shell.run(lsArgv)).isEqualTo(0);