HDFS-2070. Add more unit tests for FsShell getmerge (Daniel Templeton via Colin P. McCabe)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/c006c3a1 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/c006c3a1 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/c006c3a1 Branch: refs/heads/YARN-1197 Commit: c006c3a1e6d3631c5724e1eb0a0b620d9f7c8dcc Parents: 7d6687f Author: Colin Patrick Mccabe <[email protected]> Authored: Wed Sep 2 12:36:14 2015 -0700 Committer: Colin Patrick Mccabe <[email protected]> Committed: Wed Sep 2 12:36:14 2015 -0700 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 + .../src/test/resources/testHDFSConf.xml | 142 ++++++++++++++++--- 2 files changed, 123 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/c006c3a1/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 14a9248..0f2d713 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -874,6 +874,9 @@ Release 2.8.0 - UNRELEASED HDFS-8965. Harden edit log reading code against out of memory errors (cmccabe) + HDFS-2070. Add more unit tests for FsShell getmerge (Daniel Templeton via + Colin P. McCabe) + OPTIMIZATIONS HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than http://git-wip-us.apache.org/repos/asf/hadoop/blob/c006c3a1/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml index 4e25d09..18c68ca 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml @@ -5268,7 +5268,126 @@ </test> <!-- Tests for getmerge --> - <!-- Manual Testing --> + <test> <!-- TESTED --> + <description>getmerge: basic</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p /user/USERNAME/dir1</command> + <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /user/USERNAME/dir1</command> + <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data30bytes /user/USERNAME/dir1</command> + <command>-fs NAMENODE -getmerge /user/USERNAME/dir1 CLITEST_DATA/file</command> + <command>-cat CLITEST_DATA/file</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r /user/USERNAME CLITEST_DATA/file</command> + <command>rm data</command> + </cleanup-commands> + <comparators> + <comparator> + <type>ExactComparator</type> + <expected-output>12345678901234 +12345678901234 +12345678901234 +</expected-output> + </comparator> + </comparators> + </test> + + <test> <!-- TESTED --> + <description>getmerge: with file</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p /user/USERNAME/dir1</command> + <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /user/USERNAME/dir1</command> + <command>-fs NAMENODE -getmerge /user/USERNAME/dir1/data15bytes CLITEST_DATA/file</command> + <command>-cat CLITEST_DATA/file</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r /user/USERNAME CLITEST_DATA/file</command> + <command>rm data</command> + </cleanup-commands> + <comparators> + <comparator> + <type>ExactComparator</type> + <expected-output>12345678901234 +</expected-output> + </comparator> + </comparators> + </test> + + <test> <!-- TESTED --> + <description>getmerge: with multiple files</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p /user/USERNAME/dir1</command> + <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /user/USERNAME/dir1</command> + <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data30bytes /user/USERNAME/dir1</command> + <command>-fs NAMENODE -getmerge /user/USERNAME/dir1/data15bytes /user/USERNAME/dir1/data30bytes CLITEST_DATA/file</command> + <command>-cat CLITEST_DATA/file</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r /user/USERNAME CLITEST_DATA/file</command> + <command>rm data</command> + </cleanup-commands> + <comparators> + <comparator> + <type>ExactComparator</type> + <expected-output>12345678901234 +12345678901234 +12345678901234 +</expected-output> + </comparator> + </comparators> + </test> + + <test> <!-- TESTED --> + <description>getmerge: with newlines</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p /user/USERNAME/dir1</command> + <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /user/USERNAME/dir1</command> + <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data30bytes /user/USERNAME/dir1</command> + <command>-fs NAMENODE -getmerge -nl /user/USERNAME/dir1 CLITEST_DATA/file</command> + <command>-cat CLITEST_DATA/file</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r /user/USERNAME CLITEST_DATA/file</command> + <command>rm data</command> + </cleanup-commands> + <comparators> + <comparator> + <type>ExactComparator</type> + <expected-output>12345678901234 + +12345678901234 +12345678901234 + +</expected-output> + </comparator> + </comparators> + </test> + + <test> <!-- TESTED --> + <description>getmerge: with multiple files and newlines</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p /user/USERNAME/dir1</command> + <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /user/USERNAME/dir1</command> + <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data30bytes /user/USERNAME/dir1</command> + <command>-fs NAMENODE -getmerge -nl /user/USERNAME/dir1/data15bytes /user/USERNAME/dir1/data30bytes CLITEST_DATA/file</command> + <command>-cat CLITEST_DATA/file</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r /user/USERNAME CLITEST_DATA/file</command> + <command>rm data</command> + </cleanup-commands> + <comparators> + <comparator> + <type>ExactComparator</type> + <expected-output>12345678901234 + +12345678901234 +12345678901234 + +</expected-output> + </comparator> + </comparators> + </test> <!-- Tests for cat --> <test> <!-- TESTED --> @@ -16515,27 +16634,6 @@ </comparators> </test> - <test> - <description>getmerge</description> - <test-commands> - <command>-fs NAMENODE -mkdir -p /user/USERNAME/dir1</command> - <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /user/USERNAME/dir1</command> - <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data30bytes /user/USERNAME/dir1</command> - <command>-fs NAMENODE -getmerge /user/USERNAME/dir1 CLITEST_DATA/file</command> - <command>-cat CLITEST_DATA/file</command> - </test-commands> - <cleanup-commands> - <command>-fs NAMENODE -rm -r /user/USERNAME CLITEST_DATA/file</command> - <command>rm data</command> - </cleanup-commands> - <comparators> - <comparator> - <type>RegexpComparator</type> - <expected-output>12345678901234.*</expected-output> - </comparator> - </comparators> - </test> - <!-- Tests for snapshots --> <test> <description>allowSnapshot</description>
