From 56fcec5fe2365c58fc1aaa9f952ae9dbb63ae2d6 Mon Sep 17 00:00:00 2001 From: Anuj Modi Date: Sat, 4 Jan 2025 05:11:22 -0800 Subject: [PATCH 1/2] Test Fix --- .../azurebfs/ITestAzureBlobFileSystemInitAndCreate.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemInitAndCreate.java b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemInitAndCreate.java index b15f4c997be0e..ba31c0cfd3ed6 100644 --- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemInitAndCreate.java +++ b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemInitAndCreate.java @@ -42,6 +42,8 @@ import static java.net.HttpURLConnection.HTTP_UNAVAILABLE; import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY; import static org.apache.hadoop.fs.azurebfs.constants.ConfigurationKeys.FS_AZURE_ACCOUNT_IS_HNS_ENABLED; +import static org.apache.hadoop.fs.azurebfs.constants.ConfigurationKeys.FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME; +import static org.apache.hadoop.fs.azurebfs.constants.ConfigurationKeys.accountProperty; import static org.apache.hadoop.fs.azurebfs.constants.FileSystemUriSchemes.ABFS_BLOB_DOMAIN_NAME; import static org.apache.hadoop.fs.azurebfs.constants.FileSystemUriSchemes.ABFS_DFS_DOMAIN_NAME; import static org.apache.hadoop.test.LambdaTestUtils.intercept; @@ -115,9 +117,14 @@ public void testNoGetAclCallOnHnsConfigPresence() throws Exception { // TODO: [FnsOverBlob][HADOOP-19179] Remove this test case once Blob Endpoint Support is enabled. @Test - public void testFileSystemInitFailsWithBlobEndpoitUrl() throws Exception { + public void testFileSystemInitFailsWithBlobEndpointUrl() throws Exception { Configuration configuration = getRawConfiguration(); String defaultUri = configuration.get(FS_DEFAULT_NAME_KEY); + String accountKey = configuration.get( + accountProperty(FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME, getAccountName()), + configuration.get(FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME)); + configuration.set(FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME, + accountKey.replace(ABFS_DFS_DOMAIN_NAME, ABFS_BLOB_DOMAIN_NAME)); String blobUri = defaultUri.replace(ABFS_DFS_DOMAIN_NAME, ABFS_BLOB_DOMAIN_NAME); intercept(InvalidConfigurationValueException.class, "Blob Endpoint Support not yet available", () -> From ecb8c1812a7fba0160bb4854aa5ddee8048c3a08 Mon Sep 17 00:00:00 2001 From: Anuj Modi Date: Sat, 4 Jan 2025 05:17:27 -0800 Subject: [PATCH 2/2] Test Fix Followup --- .../fs/azurebfs/ITestAzureBlobFileSystemInitAndCreate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemInitAndCreate.java b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemInitAndCreate.java index ba31c0cfd3ed6..7126cbf42fad8 100644 --- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemInitAndCreate.java +++ b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemInitAndCreate.java @@ -118,7 +118,7 @@ public void testNoGetAclCallOnHnsConfigPresence() throws Exception { // TODO: [FnsOverBlob][HADOOP-19179] Remove this test case once Blob Endpoint Support is enabled. @Test public void testFileSystemInitFailsWithBlobEndpointUrl() throws Exception { - Configuration configuration = getRawConfiguration(); + Configuration configuration = new Configuration(getRawConfiguration()); String defaultUri = configuration.get(FS_DEFAULT_NAME_KEY); String accountKey = configuration.get( accountProperty(FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME, getAccountName()),