[
https://issues.apache.org/jira/browse/HADOOP-19444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17934165#comment-17934165
]
ASF GitHub Bot commented on HADOOP-19444:
-----------------------------------------
bhattmanish98 commented on code in PR #7424:
URL: https://github.com/apache/hadoop/pull/7424#discussion_r1988791459
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemInitAndCreate.java:
##########
@@ -108,6 +117,33 @@ public void testNoGetAclCallOnHnsConfigPresence() throws
Exception {
.getAclStatus(Mockito.anyString(), any(TracingContext.class));
}
+ /**
+ * Test to verify that the initialization of the AzureBlobFileSystem fails
+ * when an invalid ingress service type is configured.
+ *
+ * This test sets up a configuration with an invalid ingress service type
+ * (DFS) for a Blob endpoint and expects an
InvalidConfigurationValueException
+ * to be thrown during the initialization of the filesystem.
+ *
+ * @throws Exception if an error occurs during the test execution
+ */
+ @Test
+ public void testFileSystemInitializationFailsForInvalidIngress() throws
Exception {
+ assumeHnsDisabled();
+ 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()),
+ 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));
+ configuration.set(FS_AZURE_INGRESS_SERVICE_TYPE,
AbfsServiceType.DFS.name());
+ String blobUri = defaultUri.replace(ABFS_DFS_DOMAIN_NAME,
ABFS_BLOB_DOMAIN_NAME);
+ intercept(InvalidConfigurationValueException.class,
+ "Ingress Type Cannot be DFS for Blob endpoint configured filesystem",
() ->
Review Comment:
We are using same string at two places, it would be better to define
constant in AbfsError and use it at both the places.
> ABFS: [FnsOverBlob][Tests] Add Tests For Negative Scenarios Identified for
> Ingress Operations
> ---------------------------------------------------------------------------------------------
>
> Key: HADOOP-19444
> URL: https://issues.apache.org/jira/browse/HADOOP-19444
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/azure
> Affects Versions: 3.4.1
> Reporter: Anuj Modi
> Assignee: Anmol Asrani
> Priority: Major
> Labels: pull-request-available
> Attachments: Append_FlushTestScenarios.pdf, CreateTestScenarios.pdf,
> MkdirTestScenarios.pdf
>
>
> We have identified a few scenarios worth adding integration or mocked
> behavior tests for while implementing FNS Support over Blob Endpoint.
> Attached file shows the the scenarios identified for Ingress Related
> operations on blob Endpoint (Create + Append + Flush filesystem calls)
> This Jira tracks implementing these tests.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]