소스 검색

svn merge -c 1301665 from trunk for HDFS-3104.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1301666 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 13 년 전
부모
커밋
debf136f0d
2개의 변경된 파일38개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
  2. 36 0
      hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml

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

@@ -566,6 +566,8 @@ Release 0.23.2 - UNRELEASED
 
     HDFS-3098. Update and add tests for HADOOP-8173. (Daryn Sharp via szetszwo)
 
+    HDFS-3104. Add tests for HADOOP-8175. (Daryn Sharp via szetszwo)
+
   OPTIMIZATIONS
 
     HDFS-3024. Improve performance of stringification in addStoredBlock (todd)

+ 36 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml

@@ -5719,6 +5719,42 @@
         </comparator>
       </comparators>
     </test>
+
+    <test> <!-- TESTED -->
+      <description>mkdir: Test recreate of existing directory fails</description>
+      <test-commands>
+        <command>-fs NAMENODE -rm -r -f dir0</command>
+        <command>-fs NAMENODE -mkdir dir0/dir1</command>
+        <command>-fs NAMENODE -mkdir dir0/dir1</command>
+      </test-commands>
+      <cleanup-commands>
+        <command>-fs NAMENODE -rm -r dir0</command>
+      </cleanup-commands>
+      <comparators>
+        <comparator>
+          <type>RegexpComparator</type>
+          <expected-output>mkdir: `dir0/dir1': File exists</expected-output>
+        </comparator>
+      </comparators>
+    </test>
+    
+    <test> <!-- TESTED -->
+      <description>mkdir: Test recreate of existing directory with -p succeeds</description>
+      <test-commands>
+        <command>-fs NAMENODE -rm -r -f dir0</command>
+        <command>-fs NAMENODE -mkdir dir0/dir1</command>
+        <command>-fs NAMENODE -mkdir -p dir0/dir1</command>
+      </test-commands>
+      <cleanup-commands>
+        <command>-fs NAMENODE -rm -r dir0</command>
+      </cleanup-commands>
+      <comparators>
+        <comparator>
+          <type>ExactComparator</type>
+          <expected-output></expected-output>
+        </comparator>
+      </comparators>
+    </test>
     
     <!--Tests for setrep-->
     <test> <!-- TESTED -->