hadoop/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testCryptoConf.xml

739 lines
29 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>
<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 help usage</description>
<test-commands>
<crypto-admin-command>-help</crypto-admin-command>
</test-commands>
<cleanup-commands>
</cleanup-commands>
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>[-createZone -keyName</expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test extra help argument</description>
<test-commands>
<crypto-admin-command>-help arg1 arg2</crypto-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>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 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>
<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 -rm -r /src</command>
<command>-fs NAMENODE -rm -r /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>
<test>
<description>Test success of getFileEncryptionInfo on a EZ file</description>
<test-commands>
<command>-fs NAMENODE -mkdir /src</command>
<crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
<command>-fs NAMENODE -touchz /src/file</command>
<crypto-admin-command>-getFileEncryptionInfo -path /src/file</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r /src</command>
</cleanup-commands>
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>keyName: myKey, ezKeyVersionName: myKey@0</expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test failure of getFileEncryptionInfo on a non-EZ file</description>
<test-commands>
<command>-fs NAMENODE -mkdir /src</command>
<command>-fs NAMENODE -touchz /src/cleartext</command>
<crypto-admin-command>-getFileEncryptionInfo -path /src/cleartext</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r /src</command>
</cleanup-commands>
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>No FileEncryptionInfo found for path</expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test failure of getFileEncryptionInfo on a non-exist file</description>
<test-commands>
<crypto-admin-command>-getFileEncryptionInfo -path /src/file</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r /src</command>
</cleanup-commands>
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>FileNotFoundException:</expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test failure of getFileEncryptionInfo on a EZ dir</description>
<test-commands>
<command>-fs NAMENODE -mkdir /src</command>
<crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
<crypto-admin-command>-getFileEncryptionInfo -path /src</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r /src</command>
</cleanup-commands>
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>No FileEncryptionInfo found for path </expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test failure of getFileEncryptionInfo on a EZ subdir</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/dir</command>
<crypto-admin-command>-getFileEncryptionInfo -path /src/dir</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r /src</command>
</cleanup-commands>
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>No FileEncryptionInfo found for path </expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test list encryption zones when no zone has been deleted</description>
<test-commands>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
<command>-fs NAMENODE -mkdir /test1</command>
<crypto-admin-command>-createZone -path /test1 -keyName myKey</crypto-admin-command>
<crypto-admin-command>-listZones</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r /test1</command>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
</cleanup-commands>
<comparators>
<comparator>
<type>RegexpAcrossOutputComparator</type>
<expected-output>(/test1)\s*(myKey)\s*</expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test adding two zones, then deleting one and listing zones. The deleted zone should still be listed, as it's under user's Trash folder'</description>
<test-commands>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
<command>-fs NAMENODE -mkdir /test1</command>
<command>-fs NAMENODE -mkdir /test2</command>
<crypto-admin-command>-createZone -path /test1 -keyName myKey</crypto-admin-command>
<crypto-admin-command>-createZone -path /test2 -keyName myKey</crypto-admin-command>
<command>-fs NAMENODE -rm -r /test2</command>
<crypto-admin-command>-listZones</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r /test1</command>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
</cleanup-commands>
<comparators>
<comparator>
<type>RegexpAcrossOutputComparator</type>
<expected-output>(/test1)\s*(myKey)\s*(/user/).*(/.Trash/Current/test2)\s*(myKey)\s*</expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test adding two zones, then permanently deleting one and listing zones.</description>
<test-commands>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
<command>-fs NAMENODE -mkdir /test1</command>
<command>-fs NAMENODE -mkdir /test2</command>
<crypto-admin-command>-createZone -path /test1 -keyName myKey</crypto-admin-command>
<crypto-admin-command>-createZone -path /test2 -keyName myKey</crypto-admin-command>
<command>-fs NAMENODE -rm -r /test2</command>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
<crypto-admin-command>-listZones</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r /test1</command>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
</cleanup-commands>
<comparators>
<comparator>
<type>RegexpAcrossOutputComparator</type>
<expected-output>(/test1)\s*(myKey)\s*</expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test adding two zones to a snapshotable directory, take snapshot, permanently delete one of the EZs, then list zones</description>
<test-commands>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
<command>-fs NAMENODE -mkdir /snapshotable</command>
<command>-fs NAMENODE -mkdir /snapshotable/test1</command>
<command>-fs NAMENODE -mkdir /snapshotable/test2</command>
<dfs-admin-command>-fs NAMENODE -allowSnapshot /snapshotable</dfs-admin-command>
<command>-fs NAMENODE -createSnapshot /snapshotable snapshot1</command>
<crypto-admin-command>-createZone -path /snapshotable/test1 -keyName myKey</crypto-admin-command>
<crypto-admin-command>-createZone -path /snapshotable/test2 -keyName myKey</crypto-admin-command>
<command>-fs NAMENODE -rm -r /snapshotable/test2</command>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
<crypto-admin-command>-listZones</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -deleteSnapshot /snapshotable snapshot1</command>
<command>-fs NAMENODE -rm -r /snapshotable</command>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
</cleanup-commands>
<comparators>
<comparator>
<type>RegexpAcrossOutputComparator</type>
<expected-output>(/test1)\s*(myKey)\s*</expected-output>
</comparator>
</comparators>
</test>
<!--More thorough test cases for re-encryption are in TestEncryptionZones-->
<test>
<description>Test success of reencrypt submission on a EZ</description>
<test-commands>
<command>-fs NAMENODE -mkdir /src</command>
<crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
<crypto-admin-command>-reencryptZone -start -path /src</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r -skipTrash /src</command>
</cleanup-commands>
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>successfully submitted for zone: /src action: START</expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test failure of reencrypt submission on a non-EZ</description>
<test-commands>
<command>-fs NAMENODE -mkdir /src</command>
<crypto-admin-command>-reencryptZone -start -path /src</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r -skipTrash /src</command>
</cleanup-commands>
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>not the root of an encryption zone</expected-output>
</comparator>
</comparators>
</test>
<!-- Cannot test successful cancel here, since the submit will finish very quickly.
TestReencryption covers successful cancellations. -->
<test>
<description>Test failure of reencrypt on cancellation a not-being-re-encrypted EZ</description>
<test-commands>
<command>-fs NAMENODE -mkdir /src</command>
<crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
<crypto-admin-command>-reencryptZone -cancel -path /src</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r -skipTrash /src</command>
</cleanup-commands>
<comparators>
<comparator>
<type>SubstringComparator</type>
<expected-output>Zone /src is not under re-encryption</expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test success of list reencrypt status on a EZ</description>
<test-commands>
<command>-fs NAMENODE -mkdir /src</command>
<command>-fs NAMENODE -mkdir /zone2</command>
<crypto-admin-command>-createZone -path /src -keyName myKey</crypto-admin-command>
<crypto-admin-command>-createZone -path /zone2 -keyName myKey</crypto-admin-command>
<crypto-admin-command>-reencryptZone -start -path /src</crypto-admin-command>
<crypto-admin-command>-reencryptZone -start -path /zone2</crypto-admin-command>
<crypto-admin-command>-listReencryptionStatus</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rm -r -skipTrash /src</command>
<command>-fs NAMENODE -rm -r -skipTrash /zone2</command>
</cleanup-commands>
<comparators>
<comparator>
<type>TokenComparator</type>
<expected-output>/src,Completed,false,myKey,zone2</expected-output>
</comparator>
</comparators>
</test>
<test>
<description>Test adding two zones to a snapshotable directory;
The second zone is not a direct child of snapshottable directory;
Take snapshot, permanently delete second EZ, then list zones;</description>
<test-commands>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
<command>-fs NAMENODE -mkdir /snapshotable</command>
<command>-fs NAMENODE -mkdir /snapshotable/test1</command>
<command>-fs NAMENODE -mkdir /snapshotable/test1/test2</command>
<command>-fs NAMENODE -mkdir /snapshotable/test3</command>
<dfs-admin-command>-fs NAMENODE -allowSnapshot /snapshotable</dfs-admin-command>
<crypto-admin-command>-createZone -path /snapshotable/test1/test2 -keyName myKey</crypto-admin-command>
<crypto-admin-command>-createZone -path /snapshotable/test3 -keyName myKey</crypto-admin-command>
<command>-fs NAMENODE -createSnapshot /snapshotable snapshot1</command>
<command>-fs NAMENODE -rm -r /snapshotable/test1</command>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
<crypto-admin-command>-listZones</crypto-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -deleteSnapshot /snapshotable snapshot1</command>
<command>-fs NAMENODE -rm -r /snapshotable</command>
<command>-fs NAMENODE -rm -r .Trash/Current/*</command>
</cleanup-commands>
<comparators>
<comparator>
<type>RegexpAcrossOutputComparator</type>
<expected-output>(/test3)\s*(myKey)\s*</expected-output>
</comparator>
</comparators>
</test>
</tests>
</configuration>