123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 |
- <?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>
- <description>Test basic usage</description>
- <test-commands>
- <crypto-admin-command></crypto-admin-command>
- </test-commands>
- <cleanup-commands>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>Usage: bin/hdfs crypto [COMMAND]</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test create ez, dir doesn't exist</description>
- <test-commands>
- <command>-fs NAMENODE -ls /test</command>-
- <crypto-admin-command>-createZone -path /test -keyName myKey</crypto-admin-command>
- </test-commands>
- <cleanup-commands>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>cannot find /test</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test failure of creating EZ on an existing EZ</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /foo</command>
- <command>-fs NAMENODE -ls /</command>-
- <crypto-admin-command>-createZone -path /foo -keyName myKey</crypto-admin-command>
- <command>-fs NAMENODE -rmdir /foo/.Trash</command>
- <crypto-admin-command>-createZone -path /foo -keyName myKey</crypto-admin-command>
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmdir /foo</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>Directory /foo is already an encryption zone</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test success of creating an EZ as a subdir of an existing EZ.</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /foo</command>
- <command>-fs NAMENODE -ls /</command>-
- <crypto-admin-command>-createZone -keyName myKey -path /foo</crypto-admin-command>
- <command>-fs NAMENODE -mkdir /foo/bar</command>
- <crypto-admin-command>-createZone -keyName myKey -path /foo/bar</crypto-admin-command>
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmdir /foo/bar/.Trash</command>
- <command>-fs NAMENODE -rmdir /foo/bar</command>
- <command>-fs NAMENODE -rmdir /foo/.Trash</command>
- <command>-fs NAMENODE -rmdir /foo</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>Added encryption zone /foo/bar</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test failure of creating an EZ using a non-empty directory.</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /foo</command>
- <command>-fs NAMENODE -touchz /foo/bar</command>
- <command>-fs NAMENODE -ls /</command>-
- <crypto-admin-command>-createZone -keyName myKey -path /foo</crypto-admin-command>
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rm /foo/bar</command>
- <command>-fs NAMENODE -rmdir /foo</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>Attempt to create an encryption zone for a non-empty directory.</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test failure of creating an EZ passing a key that doesn't exist.</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /foo</command>
- <command>-fs NAMENODE -ls /</command>-
- <crypto-admin-command>-createZone -path /foo -keyName doesntexist</crypto-admin-command>
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmdir /foo</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>Key doesntexist doesn't exist.</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test failure of creating an EZ no path is specified.</description>
- <test-commands>
- <crypto-admin-command>-createZone -keyName blahKey</crypto-admin-command>
- </test-commands>
- <cleanup-commands>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>You must specify a path</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test failure of creating an EZ no key is specified.</description>
- <test-commands>
- <crypto-admin-command>-createZone -path /foo</crypto-admin-command>
- </test-commands>
- <cleanup-commands>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>You must specify a key name</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test success of creating an encryption zone a few levels down.</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /foo</command>
- <command>-fs NAMENODE -mkdir /foo/bar</command>
- <command>-fs NAMENODE -mkdir /foo/bar/baz</command>
- <command>-fs NAMENODE -ls /</command>-
- <crypto-admin-command>-createZone -path /foo/bar/baz -keyName myKey</crypto-admin-command>
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmdir /foo/bar/baz/.Trash</command>
- <command>-fs NAMENODE -rmdir /foo/bar/baz</command>
- <command>-fs NAMENODE -rmdir /foo/bar</command>
- <command>-fs NAMENODE -rmdir /foo/</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>Added encryption zone /foo/bar/baz</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test failure of renaming file cross EZ's</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /src</command>
- <command>-fs NAMENODE -mkdir /dst</command>
- <command>-fs NAMENODE -ls /</command>-
- <crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
- <crypto-admin-command>-createZone -path /dst -keyName myKey</crypto-admin-command>
- <command>-fs NAMENODE -mkdir /src/subdir</command>
- <command>-fs NAMENODE -mv /src/subdir /dst</command>-
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmdir /src/subdir</command>
- <command>-fs NAMENODE -rmdir /src/.Trash</command>
- <command>-fs NAMENODE -rmdir /src</command>
- <command>-fs NAMENODE -rmdir /dst/.Trash</command>
- <command>-fs NAMENODE -rmdir /dst</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>/src/subdir can't be moved from encryption zone /src to encryption zone /dst.</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test failure of renaming a non-EZ file into an EZ</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /src</command>
- <command>-fs NAMENODE -mkdir /dst</command>
- <command>-fs NAMENODE -ls /</command>-
- <crypto-admin-command>-createZone -path /dst -keyName myKey</crypto-admin-command>
- <command>-fs NAMENODE -mv /src /dst</command>-
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmdir /src</command>
- <command>-fs NAMENODE -rmdir /dst/.Trash</command>
- <command>-fs NAMENODE -rmdir /dst</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>/src can't be moved into an encryption zone</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test failure of renaming an EZ file into a non-EZ</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /src</command>
- <command>-fs NAMENODE -mkdir /dst</command>
- <command>-fs NAMENODE -ls /</command>-
- <crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
- <command>-fs NAMENODE -touchz /src/foo</command>
- <command>-fs NAMENODE -mv /src/foo /dst</command>-
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rm /src/foo</command>
- <command>-fs NAMENODE -rmdir /src/.Trash</command>
- <command>-fs NAMENODE -rmdir /src</command>
- <command>-fs NAMENODE -rmdir /dst</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>/src/foo can't be moved from an encryption zone.</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test success of renaming an EZ root</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /src</command>
- <crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
- <command>-fs NAMENODE -mv /src /dst</command>-
- <command>-fs NAMENODE -ls /</command>-
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmdir /src/.Trash</command>
- <command>-fs NAMENODE -rmdir /src</command>
- <command>-fs NAMENODE -rmdir /dst</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>/dst</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test success of renaming file intra-EZ</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /src</command>
- <crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
- <command>-fs NAMENODE -mkdir /src/subdir1</command>
- <command>-fs NAMENODE -mkdir /src/subdir2</command>
- <command>-fs NAMENODE -mv /src/subdir1 /src/subdir2</command>-
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmdir /src/subdir2/subdir1</command>
- <command>-fs NAMENODE -rmdir /src/subdir2</command>
- <command>-fs NAMENODE -rmdir /src/.Trash</command>
- <command>-fs NAMENODE -rmdir /src</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output></expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test failure of provisioning a trash dir if the EZ does not exist</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /src</command>
- <crypto-admin-command>-provisionTrash -path /src</crypto-admin-command>-
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmdir /src</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>/src is not an encryption zone.</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test failure of provisioning a trash dir if .Trash exists</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /src</command>
- <crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
- <crypto-admin-command>-provisionTrash -path /src</crypto-admin-command>-
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rm /src/.Trash</command>
- <command>-fs NAMENODE -rmdir /src</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>Will not provision new trash directory for encryption zone /src. Path already exists.</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test success of provisioning a trash dir</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /src</command>
- <crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
- <command>-fs NAMENODE -rmdir /src/.Trash</command>
- <crypto-admin-command>-provisionTrash -path /src</crypto-admin-command>-
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmdir /src/.Trash</command>
- <command>-fs NAMENODE -rmdir /src</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>Created a trash directory for /src</expected-output>
- </comparator>
- </comparators>
- </test>
- <test>
- <description>Test failure of provisioning a trash dir for incorrect EZ directory</description>
- <test-commands>
- <command>-fs NAMENODE -mkdir /src</command>
- <crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
- <command>-fs NAMENODE -mkdir /src/dir1</command>
- <crypto-admin-command>-provisionTrash -path /src/dir1</crypto-admin-command>-
- </test-commands>
- <cleanup-commands>
- <command>-fs NAMENODE -rmdir /src/dir1</command>
- <command>-fs NAMENODE -rmdir /src/.Trash</command>
- <command>-fs NAMENODE -rmdir /src</command>
- </cleanup-commands>
- <comparators>
- <comparator>
- <type>SubstringComparator</type>
- <expected-output>/src/dir1 is not the root of an encryption zone.</expected-output>
- </comparator>
- </comparators>
- </test>
- </tests>
- </configuration>
|