478 lines
17 KiB
XML
478 lines
17 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?xml-stylesheet type="text/xsl" href="testConf.xsl"?>
|
|
|
|
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
this work for additional information regarding copyright ownership.
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
(the "License"); you may not use this file except in compliance with
|
|
the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
|
|
<configuration>
|
|
<!-- Normal mode is test. To run just the commands and dump the output
|
|
to the log, set it to nocompare -->
|
|
<mode>test</mode>
|
|
|
|
<!-- Comparator types:
|
|
ExactComparator
|
|
SubstringComparator
|
|
RegexpComparator
|
|
TokenComparator
|
|
-->
|
|
<tests>
|
|
|
|
<!-- Test usage options -->
|
|
<test>
|
|
<description>usage: help for erasure coding command</description>
|
|
<test-commands>
|
|
<ec-admin-command>-usage</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Can't understand command '-usage'</expected-output>
|
|
</comparator>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Usage: bin/hdfs ec [COMMAND]</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<!-- Test help options -->
|
|
<test>
|
|
<description>help: help for erasure coding command</description>
|
|
<test-commands>
|
|
<ec-admin-command>-help</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>[-listPolicies]</expected-output>
|
|
</comparator>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>[-unsetPolicy -path</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>help: help with extra argument</description>
|
|
<test-commands>
|
|
<ec-admin-command>-help arg1 arg2</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>You must give exactly one argument to -help.</expected-output>
|
|
<expected-exit-code>1</expected-exit-code>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>help: setPolicy command</description>
|
|
<test-commands>
|
|
<ec-admin-command>-fs NAMENODE -help setPolicy</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Set the erasure coding policy for a file/directory.</expected-output>
|
|
</comparator>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>[-setPolicy -path <path> -policy <policy>]</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>help: getPolicy command</description>
|
|
<test-commands>
|
|
<ec-admin-command>-fs NAMENODE -help getPolicy</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Get the erasure coding policy of a file/directory</expected-output>
|
|
</comparator>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>[-getPolicy -path <path>]</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>help: listPolicies command</description>
|
|
<test-commands>
|
|
<ec-admin-command>-fs NAMENODE -help listPolicies</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Get the list of enabled erasure coding policies</expected-output>
|
|
</comparator>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>[-listPolicies]</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<!-- Test erasure code commands -->
|
|
<test>
|
|
<description>setPolicy : set erasure coding policy on a directory to encode files</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -policy RS-6-3-64k -path /ecdir</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Set erasure coding policy RS-6-3-64k on /ecdir</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>setPolicy : set a policy twice</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -policy RS-6-3-64k -path /ecdir</ec-admin-command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -policy RS-6-3-64k -path /ecdir</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Set erasure coding policy RS-6-3-64k on /ecdir</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>unsetPolicy : unset policy and get</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -policy RS-6-3-64k -path /ecdir</ec-admin-command>
|
|
<ec-admin-command>-fs NAMENODE -unsetPolicy -path /ecdir</ec-admin-command>
|
|
<ec-admin-command>-fs NAMENODE -getPolicy -path /ecdir</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>is unspecified</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>setPolicy : change different policy and get</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -policy RS-6-3-64k -path /ecdir</ec-admin-command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -policy RS-3-2-64k -path /ecdir</ec-admin-command>
|
|
<ec-admin-command>-fs NAMENODE -getPolicy -path /ecdir</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>RS-3-2-64k</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>unsetPolicy : unset inherited EC policy, has no effect</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<command>-fs NAMENODE -mkdir /ecdir/child</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -policy RS-6-3-64k -path /ecdir</ec-admin-command>
|
|
<ec-admin-command>-fs NAMENODE -unsetPolicy -path /ecdir/child</ec-admin-command>
|
|
<command>-fs NAMENODE -touchz /ecdir/child/ecfile</command>
|
|
<ec-admin-command>-fs NAMENODE -getPolicy -path /ecdir/child/ecfile</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rm /ecdir/child/ecfile</command>
|
|
<command>-fs NAMENODE -rmdir /ecdir/child</command>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>RS-6-3-64k</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>getPolicy : get EC policy information at specified path, which doesn't have an EC policy</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /noec</command>
|
|
<ec-admin-command>-fs NAMENODE -getPolicy -path /noec</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rmdir /noec</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>is unspecified</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>getPolicy : get EC policy information at specified path, which doesn't have an EC policy</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -policy RS-6-3-64k -path /ecdir</ec-admin-command>
|
|
<ec-admin-command>-fs NAMENODE -getPolicy -path /ecdir</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>RS-6-3-64k</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>getPolicy : get EC policy information at specified path, which doesn't have an EC policy</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -policy RS-6-3-64k -path /ecdir</ec-admin-command>
|
|
<command>-fs NAMENODE -touchz /ecdir/ecfile</command>
|
|
<ec-admin-command>-fs NAMENODE -getPolicy -path /ecdir/ecfile</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rm /ecdir/ecfile</command>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>RS-6-3-64k</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>listPolicies : get the list of ECPolicies supported</description>
|
|
<test-commands>
|
|
<ec-admin-command>-fs NAMENODE -listPolicies</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>RS-6-3</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<!-- Test illegal parameters -->
|
|
<test>
|
|
<description>setPolicy : illegal parameters - path is missing</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Please specify the path for setting the EC policy.</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>setPolicy : illegal parameters - policy name is missing</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -path</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>option -path requires 1 argument</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>setPolicy : illegal parameters - too many arguments</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -path /ecdir1 -policy RS-3-2-64k /ecdir2</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>-setPolicy: Too many arguments</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>setPolicy : illegal parameters - invalidpolicy</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -policy invalidpolicy -path /ecdir</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Policy 'invalidpolicy' does not match any enabled erasure coding policies</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>setPolicy : illegal parameters - RS-10-4-64k</description>
|
|
<test-commands>
|
|
<command>-fs NAMENODE -mkdir /ecdir</command>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -policy RS-10-4-64k -path /ecdir</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rmdir /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Policy 'RS-10-4-64k' does not match any enabled erasure coding policies</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>setPolicy : illegal parameters - no such file</description>
|
|
<test-commands>
|
|
<ec-admin-command>-fs NAMENODE -setPolicy -path /ecdir -policy RS-3-2-64k</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Path not found: /ecdir</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>getPolicy : illegal parameters - path is missing</description>
|
|
<test-commands>
|
|
<ec-admin-command>-fs NAMENODE -getPolicy </ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Please specify the path with -path</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>getPolicy : illegal parameters - too many arguments</description>
|
|
<test-commands>
|
|
<ec-admin-command>-fs NAMENODE -getPolicy -path /ecdir /ecdir</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
<command>-fs NAMENODE -rm /ecdir</command>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>-getPolicy: Too many arguments</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>getPolicy : illegal parameters - no such file</description>
|
|
<test-commands>
|
|
<ec-admin-command>-fs NAMENODE -getPolicy -path /ecdir</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>Path not found: /ecdir</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
<test>
|
|
<description>listPolicies : illegal parameters - too many parameters</description>
|
|
<test-commands>
|
|
<ec-admin-command>-fs NAMENODE -listPolicies /ecdir</ec-admin-command>
|
|
</test-commands>
|
|
<cleanup-commands>
|
|
</cleanup-commands>
|
|
<comparators>
|
|
<comparator>
|
|
<type>SubstringComparator</type>
|
|
<expected-output>-listPolicies: Too many arguments</expected-output>
|
|
</comparator>
|
|
</comparators>
|
|
</test>
|
|
|
|
</tests>
|
|
</configuration>
|