From fb7ea6d8bcc0b7a08cc5c02d4b5aeeeb6b3741e4 Mon Sep 17 00:00:00 2001 From: Konstantin Boudnik Date: Sat, 7 Jun 2014 05:22:34 +0000 Subject: [PATCH] HDFS-6297. Add CLI testcases to reflect new features of dfs and dfsadmin (Contributed by Dasha Boudnik) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1601059 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 + .../src/test/resources/testHDFSConf.xml | 358 ++++++++++++++++++ 2 files changed, 361 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 0d780c8a49b..1c8674e19cb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -479,6 +479,9 @@ Release 2.5.0 - UNRELEASED HDFS-6487. TestStandbyCheckpoint#testSBNCheckpoints is racy. (Mit Desai via wang) + HDFS-6297. Add CLI testcases to reflect new features of dfs and dfsadmin + (Dasha Boudnik via cos) + OPTIMIZATIONS HDFS-6214. Webhdfs has poor throughput for files >2GB (daryn) 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 d816c998e45..3824dd58030 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml @@ -16118,6 +16118,364 @@ + + + appendToFile + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -touchz /user/USERNAME/dir1/file0 + -fs NAMENODE -appendToFile CLITEST_DATA/data15bytes /user/USERNAME/dir1/file0 + -fs NAMENODE -cat /user/USERNAME/dir1/file0 + + + -fs NAMENODE -rm -r /user/USERNAME + + + + RegexpComparator + 12345678901234 + + + + + + text + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -put CLITEST_DATA/data15bytes /user/USERNAME/dir1/file0 + -fs NAMENODE -text /user/USERNAME/dir1/file0 + + + -fs NAMENODE -rm -r /user/USERNAME/dir1 + + + + RegexpComparator + 12345678901234 + + + + + + rmdir + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -rmdir /user/USERNAME/dir1 + -fs NAMENODE -ls /user/USERNAME/ + + + -fs NAMENODE -rm -r /user/USERNAME + + + + ExactComparator + + + + + + + rmdir with ignore-fail-on-non-empty + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -put CLITEST_DATA/data15bytes /user/USERNAME/dir1/file0 + -fs NAMENODE -rmdir --ignore-fail-on-non-empty /user/USERNAME/dir1 + -fs NAMENODE -ls /user/USERNAME/ + + + -fs NAMENODE -rm -r /user/USERNAME + + + + RegexpComparator + Found 1 items + + + RegexpComparator + ^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/user/USERNAME/dir1 + + + + + + df + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -put CLITEST_DATA/data15bytes /user/USERNAME/dir1/file0 + -fs NAMENODE -df /user/USERNAME + + + -fs NAMENODE -rm -r /user/USERNAME + + + + RegexpComparator + Filesystem( )*Size( )*Used( )*Available( )*Use%.* + + + + + + expunge + + -fs NAMENODE -expunge + + + + + + + ExactComparator + + + + + + + getmerge + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -copyFromLocal CLITEST_DATA/data15bytes /user/USERNAME/dir1 + -fs NAMENODE -copyFromLocal CLITEST_DATA/data30bytes /user/USERNAME/dir1 + -fs NAMENODE -getmerge /user/USERNAME/dir1 data + -cat data + + + -fs NAMENODE -rm -r /user/USERNAME + rm data + + + + RegexpComparator + 12345678901234.* + + + + + + + allowSnapshot + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -allowSnapshot /user/USERNAME/dir1 + + + -fs NAMENODE -disallowSnapshot /user/USERNAME/dir1 + -fs NAMENODE -rm -r /user/USERNAME + + + + RegexpComparator + Allowing snaphot on /user/USERNAME/dir1 succeeded + + + + + + disallowSnapshot + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -allowSnapshot /user/USERNAME/dir1 + -fs NAMENODE -disallowSnapshot /user/USERNAME/dir1 + + + -fs NAMENODE -rm -r /user/USERNAME + + + + RegexpComparator + Disallowing snaphot on /user/USERNAME/dir1 succeeded + + + + + + createSnapshot + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -allowSnapshot /user/USERNAME/dir1 + -fs NAMENODE -createSnapshot /user/USERNAME/dir1 snapshot1 + + + -fs NAMENODE -deleteSnapshot /user/USERNAME/dir1 snapshot1 + -fs NAMENODE -disallowSnapshot /user/USERNAME/dir1 + -fs NAMENODE -rm -r /user/USERNAME + + + + RegexpComparator + Created snapshot /user/USERNAME/dir1/.snapshot/snapshot1 + + + + + + renameSnapshot + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -allowSnapshot /user/USERNAME/dir1 + -fs NAMENODE -createSnapshot /user/USERNAME/dir1 snapshot1 + -fs NAMENODE -renameSnapshot /user/USERNAME/dir1 snapshot1 snapshot2 + -fs NAMENODE -ls /user/USERNAME/dir1/.snapshot + + + -fs NAMENODE -deleteSnapshot /user/USERNAME/dir1 snapshot2 + -fs NAMENODE -disallowSnapshot /user/USERNAME/dir1 + -fs NAMENODE -rm -r /user/USERNAME + + + + RegexpComparator + Found 1 items + + + RegexpComparator + ^drwxr-xr-x( )*-( )*USERNAME( )*supergroup( )*0( )*[0-9]{4,}-[0-9]{2,}-[0-9]{2,} [0-9]{2,}:[0-9]{2,}( )*/user/USERNAME/dir1/.snapshot/snapshot2 + + + + + + deleteSnapshot + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -allowSnapshot /user/USERNAME/dir1 + -fs NAMENODE -createSnapshot /user/USERNAME/dir1 snapshot1 + -fs NAMENODE -deleteSnapshot /user/USERNAME/dir1 snapshot1 + -fs NAMENODE -ls /user/USERNAME/dir1/.snapshot + + + -fs NAMENODE -disallowSnapshot /user/USERNAME/dir1 + -fs NAMENODE -rm -r /user/USERNAME + + + + ExactComparator + + + + + + + + refreshUserToGroupsMappings + + -fs NAMENODE -refreshUserToGroupsMappings + + + + + + + ExactComparator + + + + + + + refreshSuperUserGroupsConfiguration + + -fs NAMENODE -refreshSuperUserGroupsConfiguration + + + + + + + ExactComparator + + + + + + + setQuota + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -setQuota 3 /user/USERNAME/dir1 + -fs NAMENODE -count -q /user/USERNAME/dir1 + + + -fs NAMENODE -rm -r /user/USERNAME + + + + RegexpComparator + ( )*3.*/user/USERNAME/dir1 + + + + + + clrQuota + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -setQuota 3 /user/USERNAME/dir1 + -fs NAMENODE -clrQuota /user/USERNAME/dir1 + -fs NAMENODE -count -q /user/USERNAME/dir1 + + + -fs NAMENODE -rm -r /user/USERNAME + + + + RegexpComparator + ( )*none.*/user/USERNAME/dir1 + + + + + + setSpaceQuota + + -fs NAMENODE -mkdir -p /user/USERNAME/dir1 + -fs NAMENODE -setSpaceQuota 1G /user/USERNAME/dir1 + + + -fs NAMENODE -rm -r /user/USERNAME/dir1 + + + + ExactComparator + + + + + + + setBalancerBandwidth + + -fs NAMENODE -setBalancerBandwidth 104857600 + + + + + + + ExactComparator + + + + + + + finalizeUpgrade + + -fs NAMENODE -finalizeUpgrade + + + + + + + ExactComparator + + + + + moveFromLocal: moving non existent file(absolute path)