anmolanmol1234 commented on code in PR #7272:
URL: https://github.com/apache/hadoop/pull/7272#discussion_r1908444365
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/AbstractAbfsIntegrationTest.java:
##########
@@ -575,4 +590,52 @@ protected void assumeValidAuthConfigsPresent() {
protected boolean isAppendBlobEnabled() {
return getRawConfiguration().getBoolean(FS_AZURE_TEST_APPENDBLOB_ENABLED,
false);
}
+
+ protected AbfsServiceType getAbfsServiceType() {
+ return abfsConfig.getFsConfiguredServiceType();
+ }
+
+ /**
+ * Create directory with implicit parent directory.
+ * @param path path to create. Can be relative or absolute.
+ */
+ protected void createAzCopyFolder(Path path) throws Exception {
+ assumeValidTestConfigPresent(getRawConfiguration(),
FS_AZURE_TEST_FIXED_SAS_TOKEN);
+ String sasToken = getRawConfiguration().get(FS_AZURE_TEST_FIXED_SAS_TOKEN);
+ AzcopyToolHelper azcopyHelper = AzcopyToolHelper.getInstance(sasToken);
+ azcopyHelper.createFolderUsingAzcopy(getAzcopyAbsolutePath(path));
+ }
+
+ /**
+ * Create file with implicit parent directory.
+ * @param path path to create. Can be relative or absolute.
+ */
+ protected void createAzCopyFile(Path path) throws Exception {
+ assumeValidTestConfigPresent(getRawConfiguration(),
FS_AZURE_TEST_FIXED_SAS_TOKEN);
+ String sasToken = getRawConfiguration().get(FS_AZURE_TEST_FIXED_SAS_TOKEN);
+ AzcopyToolHelper azcopyHelper = AzcopyToolHelper.getInstance(sasToken);
+ azcopyHelper.createFileUsingAzcopy(getAzcopyAbsolutePath(path));
+ }
+
+ private String getAzcopyAbsolutePath(Path path) throws IOException {
+ String pathFromContainerRoot =
getFileSystem().makeQualified(path).toUri().getPath();
+ return HTTPS_SCHEME + COLON + FORWARD_SLASH + FORWARD_SLASH
+ + accountName + FORWARD_SLASH + fileSystemName + pathFromContainerRoot;
+ }
+
+ protected void assumeBlobServiceType() {
+ Assume.assumeTrue("Blob service type is required for this test",
+ getAbfsServiceType() == AbfsServiceType.BLOB);
+ }
+
+ /**
+ * Assert that the path contains the expected DNS suffix.
+ * If service type is blob, then path should have blob domain name.
+ * @param path to be asserted.
+ */
+ protected void assertPathDns(Path path) {
Review Comment:
taken
--
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]