HADOOP-18465. Fix S3A SSE test skip when encryption is disabled (#4925)
Contributed by Daniel Carl Jones
This commit is contained in:
parent
1675a28e5a
commit
7ec762a5fd
|
@ -78,8 +78,16 @@ public abstract class AbstractTestS3AEncryption extends AbstractS3ATestBase {
|
||||||
0, 1, 2, 3, 4, 5, 254, 255, 256, 257, 2 ^ 12 - 1
|
0, 1, 2, 3, 4, 5, 254, 255, 256, 257, 2 ^ 12 - 1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skips the tests if encryption is not enabled in configuration.
|
||||||
|
*
|
||||||
|
* @implNote We can use {@link #createConfiguration()} here since
|
||||||
|
* it does not depend on any per-bucket based configuration.
|
||||||
|
* Otherwise, we would need to grab the configuration from an
|
||||||
|
* instance of {@link S3AFileSystem}.
|
||||||
|
*/
|
||||||
protected void requireEncryptedFileSystem() {
|
protected void requireEncryptedFileSystem() {
|
||||||
skipIfEncryptionTestsDisabled(getFileSystem().getConf());
|
skipIfEncryptionTestsDisabled(createConfiguration());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -91,8 +99,8 @@ public abstract class AbstractTestS3AEncryption extends AbstractS3ATestBase {
|
||||||
@Override
|
@Override
|
||||||
public void setup() throws Exception {
|
public void setup() throws Exception {
|
||||||
try {
|
try {
|
||||||
super.setup();
|
|
||||||
requireEncryptedFileSystem();
|
requireEncryptedFileSystem();
|
||||||
|
super.setup();
|
||||||
} catch (AccessDeniedException e) {
|
} catch (AccessDeniedException e) {
|
||||||
skip("Bucket does not allow " + getSSEAlgorithm() + " encryption method");
|
skip("Bucket does not allow " + getSSEAlgorithm() + " encryption method");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue