Browse Source

svn merge -c 1301295 from trunk for HDFS-3098.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23.2@1301297 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 13 years ago
parent
commit
2b002b4f0b

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -30,6 +30,8 @@ Release 0.23.2 - UNRELEASED
 
     HDFS-2985. Improve logging when replicas are marked as corrupt. (todd)
 
+    HDFS-3098. Update and add tests for HADOOP-8173. (Daryn Sharp via szetszwo)
+
   OPTIMIZATIONS
 
   BUG FIXES

+ 46 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml

@@ -893,7 +893,7 @@
     </test>
 
     <test> <!-- TESTED -->
-      <description>ls: Test for /*/* globbing </description>
+      <description>ls: Negative test for quoted /*/* globbing </description>
       <test-commands>
         <command>-fs NAMENODE -mkdir /dir0</command>
         <command>-fs NAMENODE -mkdir /dir0/dir1</command>
@@ -904,6 +904,51 @@
         <command>-fs NAMENODE -rm -r /dir0</command>
       </cleanup-commands>
       <comparators>
+        <comparator>
+          <type>TokenComparator</type>
+          <expected-output>ls: `/*/*': No such file or directory</expected-output>
+        </comparator>
+      </comparators>
+    </test>
+
+    <test> <!-- TESTED -->
+      <description>ls: Test for quoted globbing </description>
+      <test-commands>
+        <command>-fs NAMENODE -mkdir /dir0</command>
+        <command>-fs NAMENODE -mkdir /dir0/\*</command>
+        <command>-fs NAMENODE -touchz /dir0/\*/file</command>
+        <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
+        <command>-fs NAMENODE -ls -R /dir0/\*</command>
+      </test-commands>
+      <cleanup-commands>
+        <command>-fs NAMENODE -rm -r /dir0</command>
+      </cleanup-commands>
+      <comparators>
+        <comparator>
+          <type>RegexpComparator</type>
+          <expected-output>^-rw-r--r--( )*1( )*[a-z]*( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/\*/file</expected-output>
+        </comparator>
+      </comparators>
+    </test>
+
+    <test> <!-- TESTED -->
+      <description>rm: Test for quoted globbing </description>
+      <test-commands>
+        <command>-fs NAMENODE -mkdir /dir0</command>
+        <command>-fs NAMENODE -mkdir /dir0/\*</command>
+        <command>-fs NAMENODE -touchz /dir0/\*/file</command>
+        <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
+        <command>-fs NAMENODE -rm -r /dir0/\*</command>
+        <command>-fs NAMENODE -ls -R /dir0</command>
+      </test-commands>
+      <cleanup-commands>
+        <command>-fs NAMENODE -rm -r /dir0</command>
+      </cleanup-commands>
+      <comparators>
+        <comparator>
+          <type>RegexpComparator</type>
+          <expected-output>^drwxr-xr-x( )*-( )*[a-z]*( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1</expected-output>
+        </comparator>
         <comparator>
           <type>RegexpComparator</type>
           <expected-output>^-rw-r--r--( )*1( )*[a-z]*( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/dir0/dir1/file1</expected-output>