steveloughran commented on code in PR #6752:
URL: https://github.com/apache/hadoop/pull/6752#discussion_r1611784761
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsCustomEncryption.java:
##########
@@ -390,9 +386,34 @@ private AzureBlobFileSystem getCPKEnabledFS() throws
IOException {
conf.set(FS_AZURE_ENCRYPTION_ENCODED_CLIENT_PROVIDED_KEY_SHA + "."
+ getAccountName(), cpkEncodedSHA);
conf.unset(FS_AZURE_ENCRYPTION_CONTEXT_PROVIDER_TYPE);
- AzureBlobFileSystem fs = (AzureBlobFileSystem)
FileSystem.newInstance(conf);
- fileSystemsOpenedInTest.add(fs);
- return fs;
+ return getAzureBlobFileSystem(conf);
+ }
+
+ private AzureBlobFileSystem getAzureBlobFileSystem(final Configuration conf)
{
+ try {
+ AzureBlobFileSystem fs = (AzureBlobFileSystem) FileSystem.newInstance(
+ conf);
+ fileSystemsOpenedInTest.add(fs);
+ Assertions.assertThat(
+
getConfiguration().getBoolean(FS_AZURE_TEST_NAMESPACE_ENABLED_ACCOUNT,
+ false))
+ .describedAs("Encryption tests should run only on namespace enabled
account")
+ .isTrue();
+ return fs;
+ } catch (IOException ex) {
+ Assertions.assertThat(ex.getMessage())
Review Comment:
use GenericTestUtils.assertExceptionContains
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsCustomEncryption.java:
##########
@@ -184,8 +182,8 @@ public void testCustomEncryptionCombinations() throws
Exception {
AzureBlobFileSystem fs = getOrCreateFS();
Path testPath = path("/testFile");
String relativePath = fs.getAbfsStore().getRelativePath(testPath);
- MockEncryptionContextProvider ecp =
- (MockEncryptionContextProvider) createEncryptedFile(testPath);
+ MockEncryptionContextProvider ecp
Review Comment:
revert
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/constants/AbfsHttpConstants.java:
##########
@@ -165,5 +165,8 @@ public static ApiVersion getCurrentVersion() {
*/
public static final Integer HTTP_STATUS_CATEGORY_QUOTIENT = 100;
+ public static final String CPK_IN_NON_HNS_ACCOUNT_ERROR_MESSAGE =
+ "Non HNS account can not have CPK configs enabled.";
Review Comment:
1. please use Client Provided Keys, maybe Non Hierarchical Storage too. We
cannot assume users know these acronyms.
2. please add a javadoc with an {@value} clause for IDE assistance
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsCustomEncryption.java:
##########
@@ -390,9 +386,34 @@ private AzureBlobFileSystem getCPKEnabledFS() throws
IOException {
conf.set(FS_AZURE_ENCRYPTION_ENCODED_CLIENT_PROVIDED_KEY_SHA + "."
+ getAccountName(), cpkEncodedSHA);
conf.unset(FS_AZURE_ENCRYPTION_CONTEXT_PROVIDER_TYPE);
- AzureBlobFileSystem fs = (AzureBlobFileSystem)
FileSystem.newInstance(conf);
- fileSystemsOpenedInTest.add(fs);
- return fs;
+ return getAzureBlobFileSystem(conf);
+ }
+
+ private AzureBlobFileSystem getAzureBlobFileSystem(final Configuration conf)
{
+ try {
+ AzureBlobFileSystem fs = (AzureBlobFileSystem) FileSystem.newInstance(
Review Comment:
this needs to be closed on any failure
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]