HDFS-2319. Add test cases for FSshell -stat. Contributed by XieXianshan and Bharat Viswanadham.

This commit is contained in:
Jitendra Pandey 2017-07-27 13:23:15 -07:00
parent 5f4808ce73
commit e3c7300225
1 changed files with 124 additions and 1 deletions

View File

@ -7204,6 +7204,129 @@
</comparators>
</test>
<test> <!-- TESTED -->
<description>stat: Test for hdfs:// path - user/group name for directory</description>
<test-commands>
<command>-fs NAMENODE -mkdir hdfs:///dirtest</command>
<command>-fs NAMENODE -chown hadoop:hadoopgrp hdfs:///dirtest</command>
<command>-fs NAMENODE -stat "%u-%g" hdfs:///dirtest</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r hdfs:///dirtest</command>
</cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
<expected-output>hadoop-hadoopgrp</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
<description>stat: Test for hdfs:// path - user/group name for file</description>
<test-commands>
<command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///data60bytes</command>
<command>-fs NAMENODE -chown hadoop:hadoopgrp hdfs:////data60bytes</command>
<command>-fs NAMENODE -stat "%u-%g" hdfs:////data60bytes</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r hdfs:///data60bytes</command>
</cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
<expected-output>hadoop-hadoopgrp</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
<description>stat: Test for hdfs:// path - user/group name for multiple files</description>
<test-commands>
<command>-fs NAMENODE -put CLITEST_DATA/data60bytes hdfs:///data60bytes</command>
<command>-fs NAMENODE -put CLITEST_DATA/data30bytes hdfs:///data30bytes</command>
<command>-fs NAMENODE -chown hadoop:hadoopgrp hdfs:///data60bytes</command>
<command>-fs NAMENODE -chown hdfs:hdfs hdfs:///data30bytes</command>
<command>-fs NAMENODE -stat "%u-%g" hdfs:///data*</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r hdfs:///data60bytes</command>
<command>-fs NAMENODE -rm -r hdfs:////data30bytes</command>
</cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
<expected-output>hadoop-hadoopgrp</expected-output>
</comparator>
<comparator>
<type>TokenComparator</type>
<expected-output>hdfs-hdfs</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
<description>stat: Test for Namenode's path - user/group name for directory</description>
<test-commands>
<command>-fs NAMENODE -mkdir /dir0</command>
<command>-fs NAMENODE -chown hadoop:hadoopgrp NAMENODE/dir0/</command>
<command>-fs NAMENODE -stat "%u-%g" NAMENODE/dir0/</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
</cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
<expected-output>hadoop-hadoopgrp</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
<description>stat: Test for Namenode's path - user/group name for file </description>
<test-commands>
<command>-fs NAMENODE -mkdir /dir0</command>
<command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/data15bytes</command>
<command>-fs NAMENODE -chown hadoop:hadoopgrp NAMENODE/dir0/data15bytes</command>
<command>-fs NAMENODE -stat "%u-%g" NAMENODE/dir0/data15bytes</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
</cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
<expected-output>hadoop-hadoopgrp</expected-output>
</comparator>
</comparators>
</test>
<test> <!-- TESTED -->
<description>stat: Test for Namenode's path - user/group name for multiple files </description>
<test-commands>
<command>-fs NAMENODE -mkdir /dir0</command>
<command>-fs NAMENODE -put CLITEST_DATA/data15bytes NAMENODE/dir0/data15bytes</command>
<command>-fs NAMENODE -put CLITEST_DATA/data30bytes NAMENODE/dir0/data30bytes</command>
<command>-fs NAMENODE -chown hadoop:hadoopgrp NAMENODE/dir0/data15bytes</command>
<command>-fs NAMENODE -chown hdfs:hdfs NAMENODE/dir0/data30bytes</command>
<command>-fs NAMENODE -stat "%u-%g" NAMENODE/dir0/data*</command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r NAMENODE/dir0</command>
</cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
<expected-output>hadoop-hadoopgrp</expected-output>
</comparator>
<comparator>
<type>TokenComparator</type>
<expected-output>hdfs-hdfs</expected-output>
</comparator>
</comparators>
</test>
<!-- Tests for tail -->
<test> <!-- TESTED -->
<description>tail: contents of file(absolute path)</description>