212 lines
7.7 KiB
XML
212 lines
7.7 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> <!--Tested -->
|
||
|
<description>Testing basic usage</description>
|
||
|
<test-commands>
|
||
|
<cache-admin-command></cache-admin-command>
|
||
|
</test-commands>
|
||
|
<cleanup-commands>
|
||
|
</cleanup-commands>
|
||
|
<comparators>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>Usage: bin/hdfs cacheadmin [COMMAND]</expected-output>
|
||
|
</comparator>
|
||
|
</comparators>
|
||
|
</test>
|
||
|
|
||
|
<test> <!--Tested -->
|
||
|
<description>Testing listing no cache pools</description>
|
||
|
<test-commands>
|
||
|
<cache-admin-command>-listPools</cache-admin-command>
|
||
|
</test-commands>
|
||
|
<cleanup-commands>
|
||
|
</cleanup-commands>
|
||
|
<comparators>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>Found 0 results.</expected-output>
|
||
|
</comparator>
|
||
|
</comparators>
|
||
|
</test>
|
||
|
|
||
|
<test> <!--Tested -->
|
||
|
<description>Testing adding a cache pool</description>
|
||
|
<test-commands>
|
||
|
<cache-admin-command>-addPool foo</cache-admin-command>
|
||
|
</test-commands>
|
||
|
<cleanup-commands>
|
||
|
<cache-admin-command>-removePool foo</cache-admin-command>
|
||
|
</cleanup-commands>
|
||
|
<comparators>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>Successfully added cache pool foo.</expected-output>
|
||
|
</comparator>
|
||
|
</comparators>
|
||
|
</test>
|
||
|
|
||
|
<test> <!--Tested -->
|
||
|
<description>Testing modifying a cache pool</description>
|
||
|
<test-commands>
|
||
|
<cache-admin-command>-addPool poolparty -owner alice -group alicegroup -mode 0000 -weight 50</cache-admin-command>
|
||
|
<cache-admin-command>-modifyPool poolparty -owner bob -group bobgroup -mode 0777 -weight 51</cache-admin-command>
|
||
|
<cache-admin-command>-listPools</cache-admin-command>
|
||
|
</test-commands>
|
||
|
<cleanup-commands>
|
||
|
<cache-admin-command>-removePool poolparty</cache-admin-command>
|
||
|
</cleanup-commands>
|
||
|
<comparators>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>poolparty bob bobgroup rwxrwxrwx 51</expected-output>
|
||
|
</comparator>
|
||
|
</comparators>
|
||
|
</test>
|
||
|
|
||
|
<test> <!--Tested -->
|
||
|
<description>Testing deleting a cache pool</description>
|
||
|
<test-commands>
|
||
|
<cache-admin-command>-addPool foo</cache-admin-command>
|
||
|
<cache-admin-command>-removePool foo</cache-admin-command>
|
||
|
</test-commands>
|
||
|
<cleanup-commands>
|
||
|
</cleanup-commands>
|
||
|
<comparators>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>Successfully removed cache pool foo.</expected-output>
|
||
|
</comparator>
|
||
|
</comparators>
|
||
|
</test>
|
||
|
|
||
|
<test> <!--Tested -->
|
||
|
<description>Testing listing all cache pools</description>
|
||
|
<test-commands>
|
||
|
<cache-admin-command>-addPool foo -owner bob -group bob -mode 0664</cache-admin-command>
|
||
|
<cache-admin-command>-addPool bar -owner alice -group alicegroup -mode 0755</cache-admin-command>
|
||
|
<cache-admin-command>-listPools</cache-admin-command>
|
||
|
</test-commands>
|
||
|
<cleanup-commands>
|
||
|
<cache-admin-command>-removePool foo</cache-admin-command>
|
||
|
<cache-admin-command>-removePool bar</cache-admin-command>
|
||
|
</cleanup-commands>
|
||
|
<comparators>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>Found 2 results.</expected-output>
|
||
|
</comparator>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>bar alice alicegroup rwxr-xr-x 100 </expected-output>
|
||
|
</comparator>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>foo bob bob rw-rw-r-- 100 </expected-output>
|
||
|
</comparator>
|
||
|
</comparators>
|
||
|
</test>
|
||
|
|
||
|
<test> <!--Tested -->
|
||
|
<description>Testing listing a single cache pool</description>
|
||
|
<test-commands>
|
||
|
<cache-admin-command>-addPool foo -owner bob -group bob -mode 0664</cache-admin-command>
|
||
|
<cache-admin-command>-addPool bar -owner alice -group alicegroup -mode 0755</cache-admin-command>
|
||
|
<cache-admin-command>-listPools foo</cache-admin-command>
|
||
|
</test-commands>
|
||
|
<cleanup-commands>
|
||
|
<cache-admin-command>-removePool foo</cache-admin-command>
|
||
|
<cache-admin-command>-removePool bar</cache-admin-command>
|
||
|
</cleanup-commands>
|
||
|
<comparators>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>Found 1 result.</expected-output>
|
||
|
</comparator>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>foo bob bob rw-rw-r-- 100 </expected-output>
|
||
|
</comparator>
|
||
|
</comparators>
|
||
|
</test>
|
||
|
|
||
|
<test> <!--Tested -->
|
||
|
<description>Testing creating cache paths</description>
|
||
|
<test-commands>
|
||
|
<cache-admin-command>-addPool pool1</cache-admin-command>
|
||
|
<cache-admin-command>-addPath -path /foo -pool pool1</cache-admin-command>
|
||
|
<cache-admin-command>-addPath -path /bar -pool pool1</cache-admin-command>
|
||
|
<cache-admin-command>-listPaths -pool pool1</cache-admin-command>
|
||
|
</test-commands>
|
||
|
<cleanup-commands>
|
||
|
<cache-admin-command>-removePool pool1</cache-admin-command>
|
||
|
</cleanup-commands>
|
||
|
<comparators>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>Found 2 entries</expected-output>
|
||
|
</comparator>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>1 pool1 /foo</expected-output>
|
||
|
</comparator>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>2 pool1 /bar</expected-output>
|
||
|
</comparator>
|
||
|
</comparators>
|
||
|
</test>
|
||
|
|
||
|
<test> <!--Tested -->
|
||
|
<description>Testing removing cache paths</description>
|
||
|
<test-commands>
|
||
|
<cache-admin-command>-addPool pool1</cache-admin-command>
|
||
|
<cache-admin-command>-addPath -path /foo -pool pool1</cache-admin-command>
|
||
|
<cache-admin-command>-addPath -path /bar -pool pool1</cache-admin-command>
|
||
|
<cache-admin-command>-removePool pool1</cache-admin-command>
|
||
|
<cache-admin-command>-listPaths -pool pool1</cache-admin-command>
|
||
|
</test-commands>
|
||
|
<cleanup-commands>
|
||
|
</cleanup-commands>
|
||
|
<comparators>
|
||
|
<comparator>
|
||
|
<type>SubstringComparator</type>
|
||
|
<expected-output>Found 0 entries</expected-output>
|
||
|
</comparator>
|
||
|
</comparators>
|
||
|
</test>
|
||
|
|
||
|
</tests>
|
||
|
</configuration>
|