HDFS-2070. Add more unit tests for FsShell getmerge (Daniel Templeton via Colin P. McCabe)

This commit is contained in:
Colin Patrick Mccabe 2015-09-02 12:36:14 -07:00
parent 7d6687fe76
commit c006c3a1e6
2 changed files with 123 additions and 22 deletions

View File

@ -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

View File

@ -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>