Repository: bigtop Updated Branches: refs/heads/master 37b0bf1ec -> 217c313a5
BIGTOP-1325. Update TestHDFSCLI to include tests from upstream Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/217c313a Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/217c313a Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/217c313a Branch: refs/heads/master Commit: 217c313a5bf136b089d1a20c44a6cbe9f4c363a2 Parents: 37b0bf1 Author: Dasha <[email protected]> Authored: Wed Jan 28 21:18:09 2015 -0800 Committer: Dasha <[email protected]> Committed: Wed Jan 28 21:18:09 2015 -0800 ---------------------------------------------------------------------- .../bigtop/itest/hadoop/hcfs/TestCLI.java | 3 +- .../resources/clitest_data/testHDFSConf.xml | 133 +++++++++++++++++++ 2 files changed, 135 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/217c313a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hcfs/TestCLI.java ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hcfs/TestCLI.java b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hcfs/TestCLI.java index 1b4dcd7..df24e69 100644 --- a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hcfs/TestCLI.java +++ b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hcfs/TestCLI.java @@ -59,6 +59,7 @@ public class TestCLI extends CLITestHelper { supergroup = System.getProperty("hcfs.root.groupname", conf.get(DFSConfigKeys.DFS_PERMISSIONS_SUPERUSERGROUP_KEY)); namenode = conf.get(CommonConfigurationKeys.FS_DEFAULT_NAME_KEY); + username = System.getProperty("user.name"); conf.setBoolean(CommonConfigurationKeys.HADOOP_SECURITY_AUTHORIZATION, true); // Many of the tests expect a replication value of 1 in the output @@ -138,7 +139,7 @@ public class TestCLI extends CLITestHelper { expCmd = expCmd.replaceAll("TEST_DIR_ABSOLUTE", TEST_DIR_ABSOLUTE); expCmd = expCmd.replaceAll("supergroup", supergroup); expCmd = expCmd.replaceAll("NAMENODE", namenode); - expCmd = expCmd.replaceAll("USER_NAME", System.getProperty("user.name")); + expCmd = expCmd.replaceAll("USER_NAME", username); expCmd = expCmd.replaceAll("HCFS_SCHEME", HCFS_SCHEME); expCmd = expCmd.replaceAll("HCFS_DIRSIZE", HCFS_DIRSIZE); expCmd = expCmd.replaceAll("HCFS_NNMATCH", HCFS_NNMATCH); http://git-wip-us.apache.org/repos/asf/bigtop/blob/217c313a/bigtop-tests/test-artifacts/hadoop/src/main/resources/clitest_data/testHDFSConf.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/hadoop/src/main/resources/clitest_data/testHDFSConf.xml b/bigtop-tests/test-artifacts/hadoop/src/main/resources/clitest_data/testHDFSConf.xml index b4358c5..b36ed8a 100644 --- a/bigtop-tests/test-artifacts/hadoop/src/main/resources/clitest_data/testHDFSConf.xml +++ b/bigtop-tests/test-artifacts/hadoop/src/main/resources/clitest_data/testHDFSConf.xml @@ -293,5 +293,138 @@ </comparators> </test> + <test> + <description>appendToFile</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p /user/USER_NAME/dir1</command> + <command>-fs NAMENODE -touchz /user/USER_NAME/dir1/file0</command> + <command>-fs NAMENODE -appendToFile CLITEST_DATA/data15bytes /user/USER_NAME/dir1/file0</command> + <command>-fs NAMENODE -cat /user/USER_NAME/dir1/file0</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r /user/USER_NAME/dir1</command> + </cleanup-commands> + <comparators> + <comparator> + <type>RegexpComparator</type> + <expected-output>12345678901234</expected-output> + </comparator> + </comparators> + </test> + + <test> + <description>text</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p /user/USER_NAME/dir1</command> + <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /user/USER_NAME/dir1/file0</command> + <command>-fs NAMENODE -text /user/USER_NAME/dir1/file0</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r /user/USER_NAME/dir1</command> + </cleanup-commands> + <comparators> + <comparator> + <type>RegexpComparator</type> + <expected-output>12345678901234</expected-output> + </comparator> + </comparators> + </test> + + <test> + <description>rmdir</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p /user/USER_NAME/dir1/dir2</command> + <command>-fs NAMENODE -rmdir /user/USER_NAME/dir1/dir2</command> + <command>-fs NAMENODE -ls /user/USER_NAME/dir1</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r /user/USER_NAME/dir1</command> + </cleanup-commands> + <comparators> + <comparator> + <type>ExactComparator</type> + <expected-output></expected-output> + </comparator> + </comparators> + </test> + + <test> + <description>rmdir with ignore-fail-on-non-empty</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p /user/USER_NAME/dir1/dir2</command> + <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /user/USER_NAME/dir1/dir2/file0</command> + <command>-fs NAMENODE -rmdir --ignore-fail-on-non-empty /user/USER_NAME/dir1/dir2</command> + <command>-fs NAMENODE -ls /user/USER_NAME/dir1</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r /user/USER_NAME/dir1</command> + </cleanup-commands> + <comparators> + <comparator> + <type>RegexpComparator</type> + <expected-output>Found 1 items</expected-output> + </comparator> + <comparator> + <type>RegexpComparator</type> + <expected-output>^drwxr-xr-x( )*-( )*USER_NAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/user/USER_NAME/dir1/dir2</expected-output> + </comparator> + </comparators> + </test> + + <test> + <description>df</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p /user/USER_NAME/dir1</command> + <command>-fs NAMENODE -put CLITEST_DATA/data15bytes /user/USER_NAME/dir1/file0</command> + <command>-fs NAMENODE -df /user/USER_NAME</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r /user/USER_NAME/dir1</command> + </cleanup-commands> + <comparators> + <comparator> + <type>RegexpComparator</type> + <expected-output>Filesystem( )*Size( )*Used( )*Available( )*Use%.*</expected-output> + </comparator> + </comparators> + </test> + + <test> + <description>expunge</description> + <test-commands> + <command>-fs NAMENODE -expunge</command> + </test-commands> + <cleanup-commands> + <command></command> + </cleanup-commands> + <comparators> + <comparator> + <type>ExactComparator</type> + <expected-output></expected-output> + </comparator> + </comparators> + </test> + + <test> + <description>getmerge</description> + <test-commands> + <command>-fs NAMENODE -mkdir -p /user/USER_NAME/dir1</command> + <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /user/USER_NAME/dir1</command> + <command>-fs NAMENODE -copyFromLocal CLITEST_DATA/data30bytes /user/USER_NAME/dir1</command> + <command>-fs NAMENODE -getmerge /user/USER_NAME/dir1 data</command> + <command>-fs NAMENODE -copyFromLocal data /user/USER_NAME/dir1</command> + <command>-fs NAMENODE -cat /user/USER_NAME/dir1/data</command> + </test-commands> + <cleanup-commands> + <command>-fs NAMENODE -rm -r /user/USER_NAME/dir1</command> + </cleanup-commands> + <comparators> + <comparator> + <type>RegexpComparator</type> + <expected-output>12345678901234.*</expected-output> + </comparator> + </comparators> + </test> + </tests> </configuration>
