From e3c73002250a21a771689081b51764eca1d862a7 Mon Sep 17 00:00:00 2001 From: Jitendra Pandey Date: Thu, 27 Jul 2017 13:23:15 -0700 Subject: [PATCH] HDFS-2319. Add test cases for FSshell -stat. Contributed by XieXianshan and Bharat Viswanadham. --- .../src/test/resources/testHDFSConf.xml | 125 +++++++++++++++++- 1 file changed, 124 insertions(+), 1 deletion(-) 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 9302507482a..ba90efa77eb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml @@ -7203,7 +7203,130 @@ - + + + stat: Test for hdfs:// path - user/group name for directory + + -fs NAMENODE -mkdir hdfs:///dirtest + -fs NAMENODE -chown hadoop:hadoopgrp hdfs:///dirtest + -fs NAMENODE -stat "%u-%g" hdfs:///dirtest + + + -fs NAMENODE -rm -r hdfs:///dirtest + + + + TokenComparator + hadoop-hadoopgrp + + + + + + stat: Test for hdfs:// path - user/group name for file + + -fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///data60bytes + -fs NAMENODE -chown hadoop:hadoopgrp hdfs:////data60bytes + -fs NAMENODE -stat "%u-%g" hdfs:////data60bytes + + + -fs NAMENODE -rm -r hdfs:///data60bytes + + + + TokenComparator + hadoop-hadoopgrp + + + + + + stat: Test for hdfs:// path - user/group name for multiple files + + -fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///data60bytes + -fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///data30bytes + -fs NAMENODE -chown hadoop:hadoopgrp hdfs:///data60bytes + -fs NAMENODE -chown hdfs:hdfs hdfs:///data30bytes + -fs NAMENODE -stat "%u-%g" hdfs:///data* + + + -fs NAMENODE -rm -r hdfs:///data60bytes + -fs NAMENODE -rm -r hdfs:////data30bytes + + + + TokenComparator + hadoop-hadoopgrp + + + TokenComparator + hdfs-hdfs + + + + + + stat: Test for Namenode's path - user/group name for directory + + -fs NAMENODE -mkdir /dir0 + -fs NAMENODE -chown hadoop:hadoopgrp NAMENODE/dir0/ + -fs NAMENODE -stat "%u-%g" NAMENODE/dir0/ + + + -fs NAMENODE -rm -r NAMENODE/dir0 + + + + TokenComparator + hadoop-hadoopgrp + + + + + + stat: Test for Namenode's path - user/group name for file + + -fs NAMENODE -mkdir /dir0 + -fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/data15bytes + -fs NAMENODE -chown hadoop:hadoopgrp NAMENODE/dir0/data15bytes + -fs NAMENODE -stat "%u-%g" NAMENODE/dir0/data15bytes + + + -fs NAMENODE -rm -r NAMENODE/dir0 + + + + TokenComparator + hadoop-hadoopgrp + + + + + + stat: Test for Namenode's path - user/group name for multiple files + + -fs NAMENODE -mkdir /dir0 + -fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/data15bytes + -fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/data30bytes + -fs NAMENODE -chown hadoop:hadoopgrp NAMENODE/dir0/data15bytes + -fs NAMENODE -chown hdfs:hdfs NAMENODE/dir0/data30bytes + -fs NAMENODE -stat "%u-%g" NAMENODE/dir0/data* + + + -fs NAMENODE -rm -r NAMENODE/dir0 + + + + TokenComparator + hadoop-hadoopgrp + + + TokenComparator + hdfs-hdfs + + + + tail: contents of file(absolute path)