From b73956fdad87e03e9875a96465579a1a3b17c498 Mon Sep 17 00:00:00 2001 From: Konstantin V Shvachko Date: Mon, 9 Feb 2015 21:26:59 -0800 Subject: [PATCH] HDFS-7058. Tests for truncate CLI. Contributed by Dasha Boudnik. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../src/test/resources/testHDFSConf.xml | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 1ca2263df5..59d498d641 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -606,6 +606,8 @@ Release 2.7.0 - UNRELEASED HDFS-7743. Code cleanup of BlockInfo and rename BlockInfo to BlockInfoContiguous. (jing9) + HDFS-7058. Tests for truncate CLI. (Dasha Boudnik via shv) + OPTIMIZATIONS HDFS-7454. Reduce memory footprint for AclEntries in NameNode. 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 8b221d6180..05546a2553 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml @@ -17266,5 +17266,41 @@ $ + + truncate to 5 bytes after waiting for block recovery to complete + + -fs NAMENODE -mkdir -p /user/USERNAME/dir0 + -fs NAMENODE -put CLITEST_DATA/data120bytes /user/USERNAME/dir0 + -fs NAMENODE -truncate -w 5 /user/USERNAME/dir0/data120bytes + -fs NAMENODE -cat /user/USERNAME/dir0/data120bytes + + + -fs NAMENODE -rm -r /user/USERNAME/dir0 + + + + RegexpComparator + 12345 + + + + + truncate to greater length than length of file + + -fs NAMENODE -mkdir /user/USERNAME/dir0 + -fs NAMENODE -put CLITEST_DATA/data15bytes /user/USERNAME/dir0 + -fs NAMENODE -truncate -w 50 /user/USERNAME/dir0/data15bytes + -fs NAMENODE -cat /user/USERNAME/dir0/data15bytes + + + -fs NAMENODE -rm -r /user/USERNAME/dir0 + + + + RegexpComparator + 12345678901234 + + +