You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ni...@apache.org on 2009/05/07 18:01:45 UTC
svn commit: r772688 [2/3] - in /hadoop/core/trunk: ./
src/test/org/apache/hadoop/cli/ src/test/org/apache/hadoop/cli/util/
Modified: hadoop/core/trunk/src/test/org/apache/hadoop/cli/testHDFSConf.xml
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/cli/testHDFSConf.xml?rev=772688&r1=772687&r2=772688&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/cli/testHDFSConf.xml (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/cli/testHDFSConf.xml Thu May 7 16:01:44 2009
@@ -191,7 +191,239 @@
</comparator>
</comparators>
</test>
-
+
+ <test> <!-- TESTED -->
+ <description>ls: Non-URI input file at Namenode's path</description>
+ <test-commands>
+ <command>-fs NAMENODE -touchz NAMENODE/file1</command>
+ <command>-fs NAMENODE -ls NAMENODE/file1</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rm NAMENODE/file1</command>
+ </cleanup-commands>
+ <comparators>
+ <comparator>
+ <type>TokenComparator</type>
+ <expected-output>Found 1 items</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,}( )*/file1</expected-output>
+ </comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>ls: file at hdfs:// path</description>
+ <test-commands>
+ <command>-fs NAMENODE -touchz hdfs:///file1</command>
+ <command>-fs NAMENODE -ls hdfs:///file1</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rm hdfs:///file1</command>
+ </cleanup-commands>
+ <comparators>
+ <comparator>
+ <type>TokenComparator</type>
+ <expected-output>Found 1 items</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,}( )*/file1</expected-output>
+ </comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>ls: Non-URI input file at Namenode's path using globing</description>
+ <test-commands>
+ <command>-fs NAMENODE -touchz NAMENODE/file1</command>
+ <command>-fs NAMENODE -touchz NAMENODE/file2</command>
+ <command>-fs NAMENODE -touchz NAMENODE/file3</command>
+ <command>-fs NAMENODE -ls NAMENODE/file*</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rm NAMENODE/file*</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,}( )*/file1</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,}( )*/file2</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,}( )*/file3</expected-output>
+ </comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>ls: file at hdfs:// path using globing</description>
+ <test-commands>
+ <command>-fs NAMENODE -touchz hdfs:///file1</command>
+ <command>-fs NAMENODE -touchz hdfs:///file2</command>
+ <command>-fs NAMENODE -touchz hdfs:///file3</command>
+ <command>-fs NAMENODE -ls hdfs:///file*</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rm hdfs:///file*</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,}( )*/file1</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,}( )*/file2</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,}( )*/file3</expected-output>
+ </comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>ls: Non-URI input dir at Namenode's path</description>
+ <test-commands>
+ <command>-fs NAMENODE -mkdir NAMENODE/user/dir1</command>
+ <command>-fs NAMENODE -ls hdfs:///user/</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rm hdfs:///user/dir1</command>
+ </cleanup-commands>
+ <comparators>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>Found [0-9] items</expected-output>
+ </comparator>
+ <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,}( )*/user/dir1</expected-output>
+ </comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>ls: dir at hdfs:// path</description>
+ <test-commands>
+ <command>-fs NAMENODE -mkdir hdfs:///user/dir1</command>
+ <command>-fs NAMENODE -ls hdfs:///user/</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rm hdfs:///user/dir1</command>
+ </cleanup-commands>
+ <comparators>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>Found [0-9] items</expected-output>
+ </comparator>
+ <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,}( )*/user/dir1</expected-output>
+ </comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>ls: Non-URI input dir at Namenode's path using globing</description>
+ <test-commands>
+ <command>-fs NAMENODE -mkdir NAMENODE/user/dir1</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/user/dir2</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/user/dir3</command>
+ <command>-fs NAMENODE -ls hdfs:///user/</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rm hdfs:///user/dir*</command>
+ </cleanup-commands>
+ <comparators>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>Found [0-9] items</expected-output>
+ </comparator>
+ <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,}( )*/user/dir1</expected-output>
+ </comparator>
+ <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,}( )*/user/dir2</expected-output>
+ </comparator>
+ <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,}( )*/user/dir3</expected-output>
+ </comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>ls: dir at hdfs:// path using globing</description>
+ <test-commands>
+ <command>-fs NAMENODE -mkdir hdfs:///user/dir1</command>
+ <command>-fs NAMENODE -mkdir hdfs:///user/dir2</command>
+ <command>-fs NAMENODE -mkdir hdfs:///user/dir3</command>
+ <command>-fs NAMENODE -ls hdfs:///user/</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rm hdfs:///user/dir*</command>
+ </cleanup-commands>
+ <comparators>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>Found [0-9] items</expected-output>
+ </comparator>
+ <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,}( )*/user/dir1</expected-output>
+ </comparator>
+ <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,}( )*/user/dir2</expected-output>
+ </comparator>
+ <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,}( )*/user/dir3</expected-output>
+ </comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>ls: non-existent file/directory at hdfs:// path </description>
+ <test-commands>
+ <command>-fs NAMENODE -ls hdfs:///file1</command>
+ </test-commands>
+ <cleanup-commands>
+ <!-- no cleanup -->
+ </cleanup-commands>
+ <comparators>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^ls: Cannot access hdfs:///file1: No such file or directory.</expected-output>
+ </comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>ls: non-existent file/directory in Namenode's path </description>
+ <test-commands>
+ <command>-fs NAMENODE -ls NAMENODE/file1</command>
+ </test-commands>
+ <cleanup-commands>
+ <!-- no cleanup -->
+ </cleanup-commands>
+ <comparators>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^ls: Cannot access hdfs://localhost[.a-z]*:[0-9]+/file1: No such file or directory.</expected-output>
+ </comparator>
+ </comparators>
+ </test>
+
<!-- Tests for lsr -->
<test> <!-- TESTED -->
<description>lsr: files/directories using absolute path</description>
@@ -489,552 +721,592 @@
</comparators>
</test>
- <!-- Tests for du -->
<test> <!-- TESTED -->
- <description>du: file using absolute path</description>
+ <description>lsr: dir at hdfs:// path</description>
<test-commands>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /data15bytes</command>
- <command>-fs NAMENODE -du /data15bytes</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
+ <command>-fs NAMENODE -touchz hdfs:///file1</command>
+ <command>-fs NAMENODE -touchz hdfs:///dir0/file1</command>
+ <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
+ <command>-fs NAMENODE -lsr hdfs:///</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rm /data15bytes</command>
+ <command>-fs NAMENODE -rm hdfs:///dir0</command>
+ <command>-fs NAMENODE -rm hdfs:///file1</command>
</cleanup-commands>
<comparators>
<comparator>
- <type>TokenComparator</type>
- <expected-output>Found 1 items</expected-output>
+ <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</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data15bytes</expected-output>
+ <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,}( )*/file1</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/file1</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>
</comparator>
</comparators>
</test>
-
+
<test> <!-- TESTED -->
- <description>du: file using relative path</description>
+ <description>lsr: files/directories in hdfs:// path using globbing</description>
<test-commands>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytes</command>
- <command>-fs NAMENODE -du data15bytes</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
+ <command>-fs NAMENODE -touchz hdfs:///dir0/file1</command>
+ <command>-fs NAMENODE -touchz hdfs:///dir0/dir1/file1</command>
+ <command>-fs NAMENODE -lsr hdfs:///dir0/*</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /user</command>
+ <command>-fs NAMENODE -rmr hdfs:///dir0</command>
</cleanup-commands>
<comparators>
<comparator>
- <type>TokenComparator</type>
- <expected-output>Found 1 items</expected-output>
+ <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/file1</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data15bytes</expected-output>
+ <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>
+ </comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>lsr: Non-existent file/directory in hdfs:// path</description>
+ <test-commands>
+ <command>-fs NAMENODE -lsr hdfs:///file1</command>
+ </test-commands>
+ <cleanup-commands>
+ </cleanup-commands>
+ <comparators>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^lsr: Cannot access hdfs:///file1: No such file or directory.</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>du: files using globbing</description>
+ <description>lsr: dir at Namenode's path</description>
<test-commands>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data30bytes data30bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data60bytes data60bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data120bytes data120bytes</command>
- <command>-fs NAMENODE -du data*</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
+ <command>-fs NAMENODE -touchz NAMENODE/file1</command>
+ <command>-fs NAMENODE -touchz NAMENODE/dir0/file1</command>
+ <command>-fs NAMENODE -touchz NAMENODE/dir0/dir1/file1</command>
+ <command>-fs NAMENODE -lsr NAMENODE/</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /user</command>
+ <command>-fs NAMENODE -rm hdfs:///dir0</command>
+ <command>-fs NAMENODE -rm hdfs:///file1</command>
</cleanup-commands>
<comparators>
<comparator>
- <type>TokenComparator</type>
- <expected-output>Found 4 items</expected-output>
+ <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</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data15bytes</expected-output>
+ <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>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data30bytes</expected-output>
+ <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,}( )*/file1</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^60( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data60bytes</expected-output>
+ <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/file1</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^120( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data120bytes</expected-output>
+ <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>
</comparator>
</comparators>
</test>
-
+
<test> <!-- TESTED -->
- <description>du: directory using absolute path</description>
+ <description>lsr: Non-URI input files/directories in Namenode's path </description>
<test-commands>
- <command>-fs NAMENODE -mkdir /dir0</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/data15bytes</command>
- <command>-fs NAMENODE -du /dir0</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
+ <command>-fs NAMENODE -touchz NAMENODE/dir0/file1</command>
+ <command>-fs NAMENODE -touchz NAMENODE/dir0/dir1/file1</command>
+ <command>-fs NAMENODE -lsr NAMENODE/dir0/*</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /dir0</command>
+ <command>-fs NAMENODE -rmr NAMENODE/dir0</command>
</cleanup-commands>
<comparators>
<comparator>
- <type>TokenComparator</type>
- <expected-output>Found 1 items</expected-output>
+ <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/file1</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</expected-output>
+ <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>
</comparator>
</comparators>
</test>
-
+
<test> <!-- TESTED -->
- <description>du: directory using relative path</description>
+ <description>lsr: Non-URI input for non-existent file/directory in Namenode's path </description>
<test-commands>
- <command>-fs NAMENODE -mkdir dir0</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/data15bytes</command>
- <command>-fs NAMENODE -du dir0</command>
+ <command>-fs NAMENODE -lsr NAMENODE/file1</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /user</command>
</cleanup-commands>
<comparators>
<comparator>
- <type>TokenComparator</type>
- <expected-output>Found 1 items</expected-output>
- </comparator>
- <comparator>
<type>RegexpComparator</type>
- <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0/data15bytes</expected-output>
+ <expected-output>^lsr: Cannot access hdfs://localhost[.a-z]*:[0-9]+/file1: No such file or directory.</expected-output>
</comparator>
</comparators>
</test>
-
+
<test> <!-- TESTED -->
- <description>du: directory using globbing</description>
+ <description>lsr: Test for /*/* globbing </description>
<test-commands>
<command>-fs NAMENODE -mkdir /dir0</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/data15bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/data30bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/data60bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/data120bytes</command>
- <command>-fs NAMENODE -du /dir0/*</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir1</command>
+ <command>-fs NAMENODE -touchz /dir0/dir1/file1</command>
+ <command>-fs NAMENODE -lsr /\*/\*</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rmr /dir0</command>
</cleanup-commands>
<comparators>
<comparator>
- <type>TokenComparator</type>
- <expected-output>Found 4 items</expected-output>
- </comparator>
- <comparator>
- <type>RegexpComparator</type>
- <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</expected-output>
- </comparator>
- <comparator>
- <type>RegexpComparator</type>
- <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data30bytes</expected-output>
- </comparator>
- <comparator>
- <type>RegexpComparator</type>
- <expected-output>^60( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data60bytes</expected-output>
- </comparator>
- <comparator>
<type>RegexpComparator</type>
- <expected-output>^120( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data120bytes</expected-output>
+ <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>
</comparator>
</comparators>
</test>
-
- <!-- Tests for dus -->
+
+ <!-- Tests for du -->
<test> <!-- TESTED -->
- <description>dus: directories/files using absolute path</description>
+ <description>du: file using absolute path</description>
<test-commands>
- <command>-fs NAMENODE -mkdir /dir0</command>
- <command>-fs NAMENODE -mkdir /dir0/dir1</command>
- <command>-fs NAMENODE -mkdir /dir0/dir1/dir1</command>
- <command>-fs NAMENODE -mkdir /dir0/dir1/dir2</command>
- <command>-fs NAMENODE -mkdir /dir0/dir2</command>
- <command>-fs NAMENODE -mkdir /dir0/dir2/dir1</command>
- <command>-fs NAMENODE -mkdir /dir0/dir2/dir2</command>
- <command>-fs NAMENODE -touchz /dir0/file0</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir1/data15bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir1/data30bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir2/data15bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir2/data30bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir1/dir1/data60bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir1/dir2/data120bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir2/dir1/data60bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir2/dir2/data120bytes</command>
- <command>-fs NAMENODE -dus /dir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /data15bytes</command>
+ <command>-fs NAMENODE -du /data15bytes</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /dir0</command>
+ <command>-fs NAMENODE -rm /data15bytes</command>
</cleanup-commands>
<comparators>
<comparator>
+ <type>TokenComparator</type>
+ <expected-output>Found 1 items</expected-output>
+ </comparator>
+ <comparator>
<type>RegexpComparator</type>
- <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0( |\t)*450</expected-output>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data15bytes</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>dus: directories/files using relative path</description>
+ <description>du: file using relative path</description>
<test-commands>
- <command>-fs NAMENODE -mkdir dir0</command>
- <command>-fs NAMENODE -mkdir dir0/dir1</command>
- <command>-fs NAMENODE -mkdir dir0/dir1/dir1</command>
- <command>-fs NAMENODE -mkdir dir0/dir1/dir2</command>
- <command>-fs NAMENODE -mkdir dir0/dir2</command>
- <command>-fs NAMENODE -mkdir dir0/dir2/dir1</command>
- <command>-fs NAMENODE -mkdir dir0/dir2/dir2</command>
- <command>-fs NAMENODE -touchz dir0/file0</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/dir1/data15bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data30bytes dir0/dir1/data30bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/dir2/data15bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data30bytes dir0/dir2/data30bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data60bytes dir0/dir1/dir1/data60bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data120bytes dir0/dir1/dir2/data120bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data60bytes dir0/dir2/dir1/data60bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data120bytes dir0/dir2/dir2/data120bytes</command>
- <command>-fs NAMENODE -dus dir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytes</command>
+ <command>-fs NAMENODE -du data15bytes</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rmr /user</command>
</cleanup-commands>
<comparators>
<comparator>
- <type>RegexpComparator</type>
- <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0( |\t)*450</expected-output>
+ <type>TokenComparator</type>
+ <expected-output>Found 1 items</expected-output>
</comparator>
- </comparators>
- </test>
-
- <test> <!-- TESTED -->
- <description>dus: directories/files using globbing</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /dir0</command>
- <command>-fs NAMENODE -mkdir /dir0/dir1</command>
- <command>-fs NAMENODE -mkdir /dir0/dir1/dir1</command>
- <command>-fs NAMENODE -mkdir /dir0/dir1/dir2</command>
- <command>-fs NAMENODE -mkdir /dir0/dir2</command>
- <command>-fs NAMENODE -mkdir /dir0/dir2/dir1</command>
- <command>-fs NAMENODE -mkdir /dir0/dir2/dir2</command>
- <command>-fs NAMENODE -touchz /dir0/file0</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir1/data15bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir1/data30bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir2/data15bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir2/data30bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir1/dir1/data60bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir1/dir2/data120bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir2/dir1/data60bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir2/dir2/data120bytes</command>
- <command>-fs NAMENODE -mkdir /donotcountdir0</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
- <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
- <command>-fs NAMENODE -dus /dir*</command>
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmr /dir0</command>
- <command>-fs NAMENODE -rmr /donotcountdir0</command>
- </cleanup-commands>
- <comparators>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0( |\t)*450</expected-output>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data15bytes</expected-output>
</comparator>
</comparators>
</test>
- <!-- Tests for mv -->
<test> <!-- TESTED -->
- <description>mv: file (absolute path) to file (absolute path)</description>
+ <description>du: files using globbing</description>
<test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
- <command>-fs NAMENODE -mv /file1 /file2</command>
- <command>-fs NAMENODE -ls /file*</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes data120bytes</command>
+ <command>-fs NAMENODE -du data*</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rm /file2</command>
- </cleanup-commands>:
+ <command>-fs NAMENODE -rmr /user</command>
+ </cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
- <expected-output>Found 1 items</expected-output>
+ <expected-output>Found 4 items</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,}( )*/file2</expected-output>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data15bytes</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,}( )*/file[^1]</expected-output>
+ <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data30bytes</expected-output>
</comparator>
- </comparators>
- </test>
-
- <test> <!-- TESTED -->
- <description>mv: file (absolute path) to file (relative path)</description>
- <test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
- <command>-fs NAMENODE -mv /file1 file2</command>
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmr /file1</command>
- </cleanup-commands>
- <comparators>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^mv: Failed to rename hdfs://localhost[.a-z]*:[0-9]*/file1 to file2</expected-output>
+ <expected-output>^60( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data60bytes</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^120( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/data120bytes</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>mv: file (absolute path) to directory (absolute path); keep the same name at the destination</description>
+ <description>du: directory using absolute path</description>
<test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
<command>-fs NAMENODE -mkdir /dir0</command>
- <command>-fs NAMENODE -mv /file1 /dir0</command>
- <command>-fs NAMENODE -lsr /dir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/data15bytes</command>
+ <command>-fs NAMENODE -du /dir0</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rmr /dir0</command>
</cleanup-commands>
<comparators>
<comparator>
+ <type>TokenComparator</type>
+ <expected-output>Found 1 items</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/file1</expected-output>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>mv: file (absolute path) to directory (absolute path); keep the same name at the destination [ TIED to previous test ]</description>
+ <description>du: directory using relative path</description>
<test-commands>
- <command>-fs NAMENODE -ls /file1</command>
+ <command>-fs NAMENODE -mkdir dir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/data15bytes</command>
+ <command>-fs NAMENODE -du dir0</command>
</test-commands>
<cleanup-commands>
+ <command>-fs NAMENODE -rmr /user</command>
</cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
- <expected-output>ls: Cannot access /file1: No such file or directory.</expected-output>
+ <expected-output>Found 1 items</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0/data15bytes</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>mv: file (absolute path) to directory (absolute path); change the name at the destination</description>
+ <description>du: directory using globbing</description>
<test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
<command>-fs NAMENODE -mkdir /dir0</command>
- <command>-fs NAMENODE -mv /file1 /dir0/file2</command>
- <command>-fs NAMENODE -ls /dir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/data120bytes</command>
+ <command>-fs NAMENODE -du /dir0/*</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rmr /dir0</command>
</cleanup-commands>
<comparators>
<comparator>
+ <type>TokenComparator</type>
+ <expected-output>Found 4 items</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/file2</expected-output>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data30bytes</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^60( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data60bytes</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^120( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data120bytes</expected-output>
</comparator>
</comparators>
</test>
-
+
<test> <!-- TESTED -->
- <description>mv: file (absolute path) to directory (absolute path); change the name at the destination [ TIED to previous test ]</description>
+ <description>du: Test for hdfs:// path - file</description>
<test-commands>
- <command>-fs NAMENODE -ls /file1</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///data15bytes</command>
+ <command>-fs NAMENODE -du hdfs:///data15bytes</command>
</test-commands>
<cleanup-commands>
+ <command>-fs NAMENODE -rm hdfs:///data15bytes</command>
</cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
- <expected-output>ls: Cannot access /file1: No such file or directory.</expected-output>
+ <expected-output>Found 1 items</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data15bytes</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>mv: files (absolute path) to directory (absolute path) using globbing</description>
+ <description>du: Test for hdfs:// path - files using globbing</description>
<test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
- <command>-fs NAMENODE -touchz /file2</command>
- <command>-fs NAMENODE -touchz /file3</command>
- <command>-fs NAMENODE -touchz /file4</command>
- <command>-fs NAMENODE -mkdir /dir0</command>
- <command>-fs NAMENODE -mv /file* /dir0</command>
- <command>-fs NAMENODE -lsr /*</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///data120bytes</command>
+ <command>-fs NAMENODE -du hdfs:///data*</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /dir0</command>
+ <command>-fs NAMENODE -rmr hdfs:///*</command>
</cleanup-commands>
<comparators>
<comparator>
+ <type>TokenComparator</type>
+ <expected-output>Found 4 items</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/file1</expected-output>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data15bytes</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/file2</expected-output>
+ <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data30bytes</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/file3</expected-output>
+ <expected-output>^60( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data60bytes</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/file4</expected-output>
+ <expected-output>^120( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data120bytes</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>mv: files (absolute path) to directory (absolute path) using globbing [ TIED to previous test ]</description>
+ <description>du: Test for hdfs:// path - directory</description>
<test-commands>
- <command>-fs NAMENODE -ls /file*</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/data15bytes</command>
+ <command>-fs NAMENODE -du hdfs:///dir0</command>
</test-commands>
<cleanup-commands>
+ <command>-fs NAMENODE -rmr hdfs:///dir0</command>
</cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
- <expected-output>ls: Cannot access /file*: No such file or directory.</expected-output>
+ <expected-output>Found 1 items</expected-output>
</comparator>
- </comparators>
- </test>
-
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</expected-output>
+ </comparator>
+ </comparators>
+ </test>
+
<test> <!-- TESTED -->
- <description>mv: file (relative) to file (relative)</description>
+ <description>du: Test for hdfs:// path - directory using globbing</description>
<test-commands>
- <command>-fs NAMENODE -touchz file1</command>
- <command>-fs NAMENODE -mv file1 file2</command>
- <command>-fs NAMENODE -ls file*</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/data120bytes</command>
+ <command>-fs NAMENODE -du hdfs:///dir0/*</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rm /user</command>
+ <command>-fs NAMENODE -rmr hdfs:///dir0</command>
</cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
- <expected-output>Found 1 items</expected-output>
+ <expected-output>Found 4 items</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,}( )*/user/[a-z]*/file2</expected-output>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</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,}( )*/user/[a-z]*/file[^1]</expected-output>
+ <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data30bytes</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^60( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data60bytes</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^120( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data120bytes</expected-output>
</comparator>
</comparators>
</test>
- <!-- Tests for cp-->
<test> <!-- TESTED -->
- <description>cp: file (absolute path) to file (absolute path)</description>
+ <description>du: Test for Namenode's path - file</description>
<test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
- <command>-fs NAMENODE -cp /file1 /file2</command>
- <command>-fs NAMENODE -ls /file*</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/data15bytes</command>
+ <command>-fs NAMENODE -du NAMENODE/data15bytes</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rm /file*</command>
- </cleanup-commands>:
+ <command>-fs NAMENODE -rm NAMENODE/data15bytes</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,}( )*/file1</expected-output>
+ <type>TokenComparator</type>
+ <expected-output>Found 1 items</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,}( )*/file2</expected-output>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data15bytes</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>cp: file (absolute path) to file (relative path)</description>
+ <description>du: Test for Namenode's path - files using globbing</description>
<test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
- <command>-fs NAMENODE -cp /file1 file2</command>
- <command>-fs NAMENODE -ls /file1 file2</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/data120bytes</command>
+ <command>-fs NAMENODE -du NAMENODE/data*</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /file1 file2</command>
+ <command>-fs NAMENODE -rmr NAMENODE/*</command>
</cleanup-commands>
<comparators>
<comparator>
+ <type>TokenComparator</type>
+ <expected-output>Found 4 items</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,}( )*/file1</expected-output>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data15bytes</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,}( )*/user/[a-z]*/file2</expected-output>
+ <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data30bytes</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^60( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data60bytes</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^120( |\t)*hdfs://localhost[.a-z]*:[0-9]*/data120bytes</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>cp: file (relative path) to file (absolute path)</description>
+ <description>du: Test for Namenode's path - directory</description>
<test-commands>
- <command>-fs NAMENODE -touchz file1</command>
- <command>-fs NAMENODE -cp file1 /file2</command>
- <command>-fs NAMENODE -ls file1 /file2</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/data15bytes</command>
+ <command>-fs NAMENODE -du NAMENODE/dir0</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr file1 /file2</command>
+ <command>-fs NAMENODE -rmr NAMENODE/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,}( )*/user/[a-z]*/file1</expected-output>
+ <type>TokenComparator</type>
+ <expected-output>Found 1 items</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,}( )*/file2</expected-output>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>cp: file (relative path) to file (relative path)</description>
+ <description>du: Test for Namenode's path - directory using globbing</description>
<test-commands>
- <command>-fs NAMENODE -touchz file1</command>
- <command>-fs NAMENODE -cp file1 file2</command>
- <command>-fs NAMENODE -ls file1 file2</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/data120bytes</command>
+ <command>-fs NAMENODE -du NAMENODE/dir0/*</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr file1 file2</command>
+ <command>-fs NAMENODE -rmr NAMENODE/dir0</command>
</cleanup-commands>
<comparators>
<comparator>
+ <type>TokenComparator</type>
+ <expected-output>Found 4 items</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,}( )*/user/[a-z]*/file1</expected-output>
+ <expected-output>^15( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data15bytes</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,}( )*/user/[a-z]*/file2</expected-output>
+ <expected-output>^30( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data30bytes</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^60( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data60bytes</expected-output>
+ </comparator>
+ <comparator>
+ <type>RegexpComparator</type>
+ <expected-output>^120( |\t)*hdfs://localhost[.a-z]*:[0-9]*/dir0/data120bytes</expected-output>
</comparator>
</comparators>
</test>
-
+
+ <!-- Tests for dus -->
<test> <!-- TESTED -->
- <description>cp: file (absolute path) to directory (absolute path); keep the same name at the destination</description>
+ <description>dus: directories/files using absolute path</description>
<test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
<command>-fs NAMENODE -mkdir /dir0</command>
- <command>-fs NAMENODE -cp /file1 /dir0</command>
- <command>-fs NAMENODE -ls /file1 /dir0</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir1</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir1/dir1</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir1/dir2</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir2</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir2/dir1</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir2/dir2</command>
+ <command>-fs NAMENODE -touchz /dir0/file0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir1/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir1/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir2/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir2/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir1/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir1/dir2/data120bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir2/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir2/dir2/data120bytes</command>
+ <command>-fs NAMENODE -dus /dir0</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rmr /dir0</command>
@@ -1042,889 +1314,908 @@
<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,}( )*/file1</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/file1</expected-output>
+ <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0( |\t)*450</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>cp: file (absolute path) to directory (absolute path); change the name at the destination</description>
+ <description>dus: directories/files using relative path</description>
<test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
- <command>-fs NAMENODE -mkdir /dir0</command>
- <command>-fs NAMENODE -cp /file1 /dir0/file2</command>
- <command>-fs NAMENODE -ls /file1 /dir0</command>
+ <command>-fs NAMENODE -mkdir dir0</command>
+ <command>-fs NAMENODE -mkdir dir0/dir1</command>
+ <command>-fs NAMENODE -mkdir dir0/dir1/dir1</command>
+ <command>-fs NAMENODE -mkdir dir0/dir1/dir2</command>
+ <command>-fs NAMENODE -mkdir dir0/dir2</command>
+ <command>-fs NAMENODE -mkdir dir0/dir2/dir1</command>
+ <command>-fs NAMENODE -mkdir dir0/dir2/dir2</command>
+ <command>-fs NAMENODE -touchz dir0/file0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/dir1/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes dir0/dir1/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes dir0/dir2/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes dir0/dir2/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes dir0/dir1/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes dir0/dir1/dir2/data120bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes dir0/dir2/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes dir0/dir2/dir2/data120bytes</command>
+ <command>-fs NAMENODE -dus dir0</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /dir0</command>
+ <command>-fs NAMENODE -rmr /user</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,}( )*/file1</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/file2</expected-output>
+ <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/dir0( |\t)*450</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>cp: files to directory (absolute path) using globbing</description>
+ <description>dus: directories/files using globbing</description>
<test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
- <command>-fs NAMENODE -touchz /file2</command>
- <command>-fs NAMENODE -touchz /file3</command>
- <command>-fs NAMENODE -touchz /file4</command>
<command>-fs NAMENODE -mkdir /dir0</command>
- <command>-fs NAMENODE -cp /file* /dir0</command>
- <command>-fs NAMENODE -lsr /*</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir1</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir1/dir1</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir1/dir2</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir2</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir2/dir1</command>
+ <command>-fs NAMENODE -mkdir /dir0/dir2/dir2</command>
+ <command>-fs NAMENODE -touchz /dir0/file0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir1/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir1/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /dir0/dir2/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes /dir0/dir2/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir1/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir1/dir2/data120bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes /dir0/dir2/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes /dir0/dir2/dir2/data120bytes</command>
+ <command>-fs NAMENODE -mkdir /donotcountdir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -dus /dir*</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rmr /dir0</command>
+ <command>-fs NAMENODE -rmr /donotcountdir0</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,}( )*/file1</expected-output>
+ <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0( |\t)*450</expected-output>
</comparator>
+ </comparators>
+ </test>
+
+ <!-- Tests for dus -->
+ <test> <!-- TESTED -->
+ <description>dus: Test for hdfs:// path - directories/files</description>
+ <test-commands>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1/dir1</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1/dir2</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2/dir1</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2/dir2</command>
+ <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/dir1/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/dir1/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/dir2/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/dir2/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/dir1/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/dir1/dir2/data120bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/dir2/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/dir2/dir2/data120bytes</command>
+ <command>-fs NAMENODE -dus hdfs:///dir0</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rmr hdfs:///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,}( )*/file2</expected-output>
+ <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0( |\t)*450</expected-output>
</comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>dus: Test for hdfs:// path - directories/files using globbing</description>
+ <test-commands>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1/dir1</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir1/dir2</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2/dir1</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0/dir2/dir2</command>
+ <command>-fs NAMENODE -touchz hdfs:///dir0/file0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/dir1/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/dir1/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///dir0/dir2/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///dir0/dir2/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/dir1/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/dir1/dir2/data120bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///dir0/dir2/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes hdfs:///dir0/dir2/dir2/data120bytes</command>
+ <command>-fs NAMENODE -mkdir /donotcountdir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes hdfs:///donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -dus hdfs:///dir*</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rmr hdfs:///dir0</command>
+ <command>-fs NAMENODE -rmr hdfs:///donotcountdir0</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,}( )*/file3</expected-output>
+ <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0( |\t)*450</expected-output>
</comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>dus: Test for Namenode's path - directories/files</description>
+ <test-commands>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1/dir1</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1/dir2</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2/dir1</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2/dir2</command>
+ <command>-fs NAMENODE -touchz NAMENODE/dir0/file0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/dir1/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/dir1/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/dir2/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/dir2/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/dir1/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/dir1/dir2/data120bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/dir2/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/dir2/dir2/data120bytes</command>
+ <command>-fs NAMENODE -dus NAMENODE/dir0</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rmr NAMENODE/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,}( )*/file4</expected-output>
+ <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0( |\t)*450</expected-output>
</comparator>
+ </comparators>
+ </test>
+
+ <test> <!-- TESTED -->
+ <description>dus: Test for Namenode's path - directories/files using globbing</description>
+ <test-commands>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1/dir1</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir1/dir2</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2/dir1</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/dir0/dir2/dir2</command>
+ <command>-fs NAMENODE -touchz NAMENODE/dir0/file0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/dir1/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/dir1/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/dir2/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/dir2/data30bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/dir1/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/dir1/dir2/data120bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data60bytes NAMENODE/dir0/dir2/dir1/data60bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data120bytes NAMENODE/dir0/dir2/dir2/data120bytes</command>
+ <command>-fs NAMENODE -mkdir NAMENODE/donotcountdir0</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/donotcountdir0/data15bytes</command>
+ <command>-fs NAMENODE -dus NAMENODE/dir*</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rmr NAMENODE/dir0</command>
+ <command>-fs NAMENODE -rmr NAMENODE/donotcountdir0</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/file1</expected-output>
+ <expected-output>^hdfs://localhost[.a-z]*:[0-9]*/dir0( |\t)*450</expected-output>
</comparator>
+ </comparators>
+ </test>
+
+ <!-- Tests for mv -->
+ <test> <!-- TESTED -->
+ <description>mv: file (absolute path) to file (absolute path)</description>
+ <test-commands>
+ <command>-fs NAMENODE -touchz /file1</command>
+ <command>-fs NAMENODE -mv /file1 /file2</command>
+ <command>-fs NAMENODE -ls /file*</command>
+ </test-commands>
+ <cleanup-commands>
+ <command>-fs NAMENODE -rm /file2</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/file2</expected-output>
+ <type>TokenComparator</type>
+ <expected-output>Found 1 items</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/file3</expected-output>
+ <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,}( )*/file2</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/file4</expected-output>
+ <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,}( )*/file[^1]</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>cp: files to directory (absolute path) without globbing</description>
+ <description>mv: file (absolute path) to file (relative path)</description>
<test-commands>
<command>-fs NAMENODE -touchz /file1</command>
- <command>-fs NAMENODE -touchz /file2</command>
- <command>-fs NAMENODE -touchz /file3</command>
- <command>-fs NAMENODE -touchz /file4</command>
- <command>-fs NAMENODE -mkdir /dir0</command>
- <command>-fs NAMENODE -cp /file1 /file2 /file3 /file4 /dir0</command>
- <command>-fs NAMENODE -lsr /*</command>
+ <command>-fs NAMENODE -mv /file1 file2</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /dir0</command>
+ <command>-fs NAMENODE -rmr /file1</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,}( )*/file1</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,}( )*/file2</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,}( )*/file3</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,}( )*/file4</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/file1</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/file2</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/file3</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/file4</expected-output>
+ <expected-output>^mv: Failed to rename hdfs://localhost[.a-z]*:[0-9]*/file1 to file2</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>cp: copying non existent file (absolute path)</description>
+ <description>mv: file (absolute path) to directory (absolute path); keep the same name at the destination</description>
<test-commands>
- <command>-fs NAMENODE -cp /file /file1</command>
+ <command>-fs NAMENODE -touchz /file1</command>
+ <command>-fs NAMENODE -mkdir /dir0</command>
+ <command>-fs NAMENODE -mv /file1 /dir0</command>
+ <command>-fs NAMENODE -lsr /dir0</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /user</command>
- </cleanup-commands>:
+ <command>-fs NAMENODE -rmr /dir0</command>
+ </cleanup-commands>
<comparators>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^cp: File does not exist: /file</expected-output>
+ <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/file1</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>cp: copying non existent file (relative path)</description>
+ <description>mv: file (absolute path) to directory (absolute path); keep the same name at the destination [ TIED to previous test ]</description>
<test-commands>
- <command>-fs NAMENODE -cp file1 file2</command>
+ <command>-fs NAMENODE -ls /file1</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /user</command>
- </cleanup-commands>:
+ </cleanup-commands>
<comparators>
<comparator>
- <type>RegexpComparator</type>
- <expected-output>^cp: File does not exist: file1</expected-output>
+ <type>TokenComparator</type>
+ <expected-output>ls: Cannot access /file1: No such file or directory.</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>cp: files to an existent file using globbing</description>
+ <description>mv: file (absolute path) to directory (absolute path); change the name at the destination</description>
<test-commands>
<command>-fs NAMENODE -touchz /file1</command>
- <command>-fs NAMENODE -touchz /file2</command>
- <command>-fs NAMENODE -touchz /file3</command>
- <command>-fs NAMENODE -touchz /file4</command>
- <command>-fs NAMENODE -touchz /file5</command>
- <command>-fs NAMENODE -cp /file* /file5</command>
+ <command>-fs NAMENODE -mkdir /dir0</command>
+ <command>-fs NAMENODE -mv /file1 /dir0/file2</command>
+ <command>-fs NAMENODE -ls /dir0</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /user</command>
+ <command>-fs NAMENODE -rmr /dir0</command>
</cleanup-commands>
<comparators>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^cp: When copying multiple files, destination should be a directory.</expected-output>
+ <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/file2</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>cp: files to an existent file without globbing</description>
+ <description>mv: file (absolute path) to directory (absolute path); change the name at the destination [ TIED to previous test ]</description>
<test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
- <command>-fs NAMENODE -touchz /file2</command>
- <command>-fs NAMENODE -touchz /file3</command>
- <command>-fs NAMENODE -touchz /file4</command>
- <command>-fs NAMENODE -touchz /file5</command>
- <command>-fs NAMENODE -cp /file1 /file2 /file3 /file4 /file5</command>
+ <command>-fs NAMENODE -ls /file1</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /user</command>
</cleanup-commands>
<comparators>
<comparator>
- <type>RegexpComparator</type>
- <expected-output>^cp: When copying multiple files, destination /file5 should be a directory.</expected-output>
+ <type>TokenComparator</type>
+ <expected-output>ls: Cannot access /file1: No such file or directory.</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>cp: files to a non existent directory using globbing</description>
+ <description>mv: files (absolute path) to directory (absolute path) using globbing</description>
<test-commands>
<command>-fs NAMENODE -touchz /file1</command>
<command>-fs NAMENODE -touchz /file2</command>
<command>-fs NAMENODE -touchz /file3</command>
<command>-fs NAMENODE -touchz /file4</command>
- <command>-fs NAMENODE -cp /file* dir</command>
+ <command>-fs NAMENODE -mkdir /dir0</command>
+ <command>-fs NAMENODE -mv /file* /dir0</command>
+ <command>-fs NAMENODE -lsr /*</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rmr /user</command>
+ <command>-fs NAMENODE -rmr /dir0</command>
</cleanup-commands>
<comparators>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^cp: When copying multiple files, destination should be a directory.</expected-output>
+ <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/file1</expected-output>
</comparator>
- </comparators>
- </test>
-
- <test> <!-- TESTED -->
- <description>cp: files to a non existent directory without globbing</description>
- <test-commands>
- <command>-fs NAMENODE -touchz /file1</command>
- <command>-fs NAMENODE -touchz /file2</command>
- <command>-fs NAMENODE -touchz /file3</command>
- <command>-fs NAMENODE -touchz /file4</command>
- <command>-fs NAMENODE -cp /file1 /file2 /file3 /file4 dir</command>
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmr /user</command>
- </cleanup-commands>
- <comparators>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^cp: When copying multiple files, destination dir should be a directory.</expected-output>
+ <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/file2</expected-output>
</comparator>
- </comparators>
- </test>
-
- <!-- Tests for rm -->
- <test> <!-- TESTED -->
- <description>rm: removing a file (absolute path) </description>
- <test-commands>
- <command>-fs NAMENODE -touchz /dir0/file0</command>
- <command>-fs NAMENODE -rm /dir0/file0</command>
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rm /user</command>
- </cleanup-commands>
- <comparators>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0/file0</expected-output>
+ <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/file3</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/file4</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>rm: removing a file (relative path) </description>
+ <description>mv: files (absolute path) to directory (absolute path) using globbing [ TIED to previous test ]</description>
<test-commands>
- <command>-fs NAMENODE -touchz file0</command>
- <command>-fs NAMENODE -rm file0</command>
+ <command>-fs NAMENODE -ls /file*</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rm /user</command>
</cleanup-commands>
<comparators>
<comparator>
- <type>RegexpComparator</type>
- <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file0</expected-output>
+ <type>TokenComparator</type>
+ <expected-output>ls: Cannot access /file*: No such file or directory.</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>rm: removing files by globbing (absolute path) </description>
+ <description>mv: file (relative) to file (relative)</description>
<test-commands>
- <command>-fs NAMENODE -touchz /dir0/file0</command>
- <command>-fs NAMENODE -touchz /dir0/file1</command>
- <command>-fs NAMENODE -touchz /dir0/file2</command>
- <command>-fs NAMENODE -touchz /dir0/file3</command>
- <command>-fs NAMENODE -rm /dir0/file*</command>
+ <command>-fs NAMENODE -touchz file1</command>
+ <command>-fs NAMENODE -mv file1 file2</command>
+ <command>-fs NAMENODE -ls file*</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm /user</command>
</cleanup-commands>
<comparators>
<comparator>
- <type>RegexpComparator</type>
- <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0/file0</expected-output>
- </comparator>
- <comparator>
- <type>RegexpComparator</type>
- <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0/file1</expected-output>
+ <type>TokenComparator</type>
+ <expected-output>Found 1 items</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0/file2</expected-output>
+ <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,}( )*/user/[a-z]*/file2</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/dir0/file3</expected-output>
+ <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,}( )*/user/[a-z]*/file[^1]</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>rm: removing files by globbing (relative path) </description>
+ <description>mv: moving file to file(rename in for hdfs:// path) </description>
<test-commands>
- <command>-fs NAMENODE -touchz file0</command>
- <command>-fs NAMENODE -touchz file1</command>
- <command>-fs NAMENODE -touchz file2</command>
- <command>-fs NAMENODE -touchz file3</command>
- <command>-fs NAMENODE -rm file*</command>
+ <command>-fs NAMENODE -touchz hdfs:///file1</command>
+ <command>-fs NAMENODE -mv hdfs:///file1 hdfs:///file2</command>
+ <command>-fs NAMENODE -ls hdfs:///file*</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rm /user</command>
- </cleanup-commands>
+ <command>-fs NAMENODE -rm hdfs:///file2</command>
+ </cleanup-commands>:
<comparators>
<comparator>
- <type>RegexpComparator</type>
- <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file0</expected-output>
- </comparator>
- <comparator>
- <type>RegexpComparator</type>
- <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file1</expected-output>
+ <type>TokenComparator</type>
+ <expected-output>Found 1 items</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file2</expected-output>
+ <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,}( )*/file2</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^Deleted hdfs://localhost[.a-z]*:[0-9]*/user/[a-z]*/file3</expected-output>
+ <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,}( )*/file[^1]</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
- <description>rm: removing a directory (absolute path) </description>
+ <description>mv: moving file to directory (keep the same name at the destination) in hdfs:// path - </description>
<test-commands>
- <command>-fs NAMENODE mkdir /dir0</command>
- <command>-fs NAMENODE -rm /dir0</command>
+ <command>-fs NAMENODE -touchz hdfs:///file1</command>
+ <command>-fs NAMENODE -mkdir hdfs:///dir0</command>
+ <command>-fs NAMENODE -mv hdfs:///file1 hdfs:///dir0</command>
+ <command>-fs NAMENODE -lsr hdfs:///dir0</command>
</test-commands>
<cleanup-commands>
- <command>-fs NAMENODE -rm /user</command>
+ <command>-fs NAMENODE -rmr hdfs:///dir0</command>
</cleanup-commands>
<comparators>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^rm: Cannot remove directory "hdfs://localhost[.a-z]*:[0-9]*/dir0", use -rmr instead</expected-output>
+ <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/file1</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
[... 15941 lines stripped ...]