Author: jeagles Date: Fri Aug 23 15:56:26 2013 New Revision: 1516908 URL: http://svn.apache.org/r1516908 Log: HDFS-4329. DFSShell issues with directories with spaces in name (Cristina L. Abad via jeagles)
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1516908&r1=1516907&r2=1516908&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Fri Aug 23 15:56:26 2013 @@ -3265,6 +3265,9 @@ Release 0.23.10 - UNRELEASED HDFS-4998. TestUnderReplicatedBlocks fails intermittently (kihwal) + HDFS-4329. DFSShell issues with directories with spaces in name (Cristina + L. Abad via jeagles) + Release 0.23.9 - 2013-07-08 INCOMPATIBLE CHANGES Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml?rev=1516908&r1=1516907&r2=1516908&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml Fri Aug 23 15:56:26 2013 @@ -443,6 +443,153 @@ </comparators> </test> + <test> <!-- TESTED --> + <description>ls: whitespaces in an absolute path to a file</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p "/a path with/whitespaces in directories"</command> + <command>-fs NAMENODE -touchz "/a path with/whitespaces in directories/and file names"</command> + <command>-fs NAMENODE -ls "/a path with/whitespaces in directories"</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r "/a path with"</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,}( )*/a path with/whitespaces in directories/and file names</expected-output> + </comparator> + </comparators> + </test> + + <test> <!-- TESTED --> + <description>ls: whitespaces in a relative path to a file</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p "a path with/whitespaces in directories"</command> + <command>-fs NAMENODE -touchz "a path with/whitespaces in directories/and file names"</command> + <command>-fs NAMENODE -ls "a path with/whitespaces in directories"</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r "a path with"</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,}( )*a path with/whitespaces in directories/and file names</expected-output> + </comparator> + </comparators> + </test> + + <test> <!-- TESTED --> + <description>ls: whitespaces in a scheme-qualified path to a file</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p "NAMENODE/a path with/whitespaces in directories"</command> + <command>-fs NAMENODE -touchz "NAMENODE/a path with/whitespaces in directories/and file names"</command> + <command>-fs NAMENODE -ls "NAMENODE/a path with/whitespaces in directories"</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r "NAMENODE/a path with"</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,}( )*NAMENODE/a path with/whitespaces in directories/and file names</expected-output> + </comparator> + </comparators> + </test> + + <test> <!-- TESTED --> + <description>ls: whitespaces in an absolute path to a file, using globbing</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p "/a path with/whitespaces in directories"</command> + <command>-fs NAMENODE -touchz "/a path with/whitespaces in directories/and file names"</command> + <command>-fs NAMENODE -touchz "/a path with/whitespaces in directories/and file names 2"</command> + <command>-fs NAMENODE -ls "/a*/w*"</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r "/a path with"</command> + </cleanup-commands> + <comparators> + <comparator> + <type>TokenComparator</type> + <expected-output>Found 2 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,}( )*/a path with/whitespaces in directories/and file names</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,}( )*/a path with/whitespaces in directories/and file names 2</expected-output> + </comparator> + </comparators> + </test> + + <test> <!-- TESTED --> + <description>ls: whitespaces in a relative path to a file, using globbing</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p "a path with/whitespaces in directories"</command> + <command>-fs NAMENODE -touchz "a path with/whitespaces in directories/and file names"</command> + <command>-fs NAMENODE -touchz "a path with/whitespaces in directories/and file names 2"</command> + <command>-fs NAMENODE -ls "a*/w*"</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r "a path with"</command> + </cleanup-commands> + <comparators> + <comparator> + <type>TokenComparator</type> + <expected-output>Found 2 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,}( )*a path with/whitespaces in directories/and file names</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,}( )*a path with/whitespaces in directories/and file names 2</expected-output> + </comparator> + </comparators> + </test> + + <test> <!-- TESTED --> + <description>ls: whitespaces in a scheme-qualified path to a file, using globbing</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p "NAMENODE/a path with/whitespaces in directories"</command> + <command>-fs NAMENODE -touchz "NAMENODE/a path with/whitespaces in directories/and file names"</command> + <command>-fs NAMENODE -touchz "NAMENODE/a path with/whitespaces in directories/and file names 2"</command> + <command>-fs NAMENODE -ls "NAMENODE/a*/w*"</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r "NAMENODE/a path with"</command> + </cleanup-commands> + <comparators> + <comparator> + <type>TokenComparator</type> + <expected-output>Found 2 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,}( )*NAMENODE/a path with/whitespaces in directories/and file names</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,}( )*NAMENODE/a path with/whitespaces in directories/and file names 2</expected-output> + </comparator> + </comparators> + </test> + <!-- Tests for ls -R --> <test> <!-- TESTED --> <description>ls: files/directories using absolute path</description> @@ -6503,23 +6650,23 @@ <comparators> <comparator> <type>TokenComparator</type> - <expected-output>"data15bytes-15"</expected-output> + <expected-output>data15bytes-15</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data30bytes-30"</expected-output> + <expected-output>data30bytes-30</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data60bytes-60"</expected-output> + <expected-output>data60bytes-60</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data120bytes-120"</expected-output> + <expected-output>data120bytes-120</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"datadir-0"</expected-output> + <expected-output>datadir-0</expected-output> </comparator> </comparators> </test> @@ -6542,23 +6689,23 @@ <comparators> <comparator> <type>TokenComparator</type> - <expected-output>"data15bytes-15"</expected-output> + <expected-output>data15bytes-15</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data30bytes-30"</expected-output> + <expected-output>data30bytes-30</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data60bytes-60"</expected-output> + <expected-output>data60bytes-60</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data120bytes-120"</expected-output> + <expected-output>data120bytes-120</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"datadir-0"</expected-output> + <expected-output>datadir-0</expected-output> </comparator> </comparators> </test> @@ -6644,23 +6791,23 @@ <comparators> <comparator> <type>TokenComparator</type> - <expected-output>"data15bytes-15"</expected-output> + <expected-output>data15bytes-15</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data30bytes-30"</expected-output> + <expected-output>data30bytes-30</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data60bytes-60"</expected-output> + <expected-output>data60bytes-60</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data120bytes-120"</expected-output> + <expected-output>data120bytes-120</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"datadir-0"</expected-output> + <expected-output>datadir-0</expected-output> </comparator> </comparators> </test> @@ -6731,23 +6878,23 @@ <comparators> <comparator> <type>TokenComparator</type> - <expected-output>"data15bytes-15"</expected-output> + <expected-output>data15bytes-15</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data30bytes-30"</expected-output> + <expected-output>data30bytes-30</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data60bytes-60"</expected-output> + <expected-output>data60bytes-60</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"data120bytes-120"</expected-output> + <expected-output>data120bytes-120</expected-output> </comparator> <comparator> <type>TokenComparator</type> - <expected-output>"datadir-0"</expected-output> + <expected-output>datadir-0</expected-output> </comparator> </comparators> </test>