anujmodi2021 commented on code in PR #7062:
URL: https://github.com/apache/hadoop/pull/7062#discussion_r1776364962


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestGetNameSpaceEnabled.java:
##########
@@ -271,4 +275,44 @@ private void 
ensureGetAclDetermineHnsStatusAccuratelyInternal(int statusCode,
     Mockito.verify(mockClient, times(1))
         .getAclStatus(anyString(), any(TracingContext.class));
   }
+
+  @Test
+  public void testAccountSpecificConfig() throws Exception {
+    Configuration rawConfig = new Configuration();
+    rawConfig.addResource(TEST_CONFIGURATION_FILE_NAME);
+    rawConfig.unset(FS_AZURE_ACCOUNT_IS_HNS_ENABLED);
+    rawConfig.unset(accountProperty(FS_AZURE_ACCOUNT_IS_HNS_ENABLED,
+        this.getAccountName()));
+    String accountName1 = "account1.dfs.core.windows.net";
+    String accountName2 = "account2.dfs.core.windows.net";
+    String accountName3 = "account3.dfs.core.windows.net";
+    String defaultUri1 = this.getTestUrl().replace(this.getAccountName(), 
accountName1);
+    String defaultUri2 = this.getTestUrl().replace(this.getAccountName(), 
accountName2);
+    String defaultUri3 = this.getTestUrl().replace(this.getAccountName(), 
accountName3);
+
+    // Set account specific config for account 1
+    rawConfig.set(accountProperty(FS_AZURE_ACCOUNT_IS_HNS_ENABLED, 
accountName1), TRUE_STR);
+    rawConfig.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, 
defaultUri1);
+    AzureBlobFileSystem fs1 = (AzureBlobFileSystem) 
FileSystem.newInstance(rawConfig);
+
+    // Set account specific config for account 2
+    rawConfig.set(accountProperty(FS_AZURE_ACCOUNT_IS_HNS_ENABLED, 
accountName2), FALSE_STR);
+    rawConfig.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, 
defaultUri2);
+    AzureBlobFileSystem fs2 = (AzureBlobFileSystem) 
FileSystem.newInstance(rawConfig);
+
+    // Set account agnostic config for account 3
+    rawConfig.set(FS_AZURE_ACCOUNT_IS_HNS_ENABLED, FALSE_STR);
+    rawConfig.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, 
defaultUri3);
+    AzureBlobFileSystem fs3 = (AzureBlobFileSystem) 
FileSystem.newInstance(rawConfig);
+
+    Assertions.assertThat(getIsNamespaceEnabled(fs1)).describedAs(
+        "getIsNamespaceEnabled should return true when the "
+            + "account specific config is set as true").isTrue();
+    Assertions.assertThat(getIsNamespaceEnabled(fs2)).describedAs(
+        "getIsNamespaceEnabled should return true when the "
+            + "account specific config is set as true").isFalse();
+    Assertions.assertThat(getIsNamespaceEnabled(fs3)).describedAs(

Review Comment:
   Not sure if this comment was before my latest commit. So, it might be not 
applicable now.
   But still, we are setting account-agnostic setting here so getAcl won't be 
needed.



-- 
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]

Reply via email to