|
@@ -106,6 +106,7 @@ public final class ITestAbfsClient extends AbstractAbfsIntegrationTest {
|
|
|
|
|
|
private static final String ACCOUNT_NAME = "bogusAccountName.dfs.core.windows.net";
|
|
private static final String ACCOUNT_NAME = "bogusAccountName.dfs.core.windows.net";
|
|
private static final String FS_AZURE_USER_AGENT_PREFIX = "Partner Service";
|
|
private static final String FS_AZURE_USER_AGENT_PREFIX = "Partner Service";
|
|
|
|
+ private static final String FNS_BLOB_USER_AGENT_IDENTIFIER = "FNS";
|
|
private static final String HUNDRED_CONTINUE_USER_AGENT = SINGLE_WHITE_SPACE + HUNDRED_CONTINUE + SEMICOLON;
|
|
private static final String HUNDRED_CONTINUE_USER_AGENT = SINGLE_WHITE_SPACE + HUNDRED_CONTINUE + SEMICOLON;
|
|
private static final String TEST_PATH = "/testfile";
|
|
private static final String TEST_PATH = "/testfile";
|
|
public static final int REDUCED_RETRY_COUNT = 2;
|
|
public static final int REDUCED_RETRY_COUNT = 2;
|
|
@@ -355,6 +356,42 @@ public final class ITestAbfsClient extends AbstractAbfsIntegrationTest {
|
|
.contains(DEFAULT_VALUE_UNKNOWN);
|
|
.contains(DEFAULT_VALUE_UNKNOWN);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
+ // Test to verify the unique identifier in user agent string for FNS-Blob accounts
|
|
|
|
+ public void verifyUserAgentForFNSBlob() throws Exception {
|
|
|
|
+ assumeHnsDisabled();
|
|
|
|
+ assumeBlobServiceType();
|
|
|
|
+ final AzureBlobFileSystem fs = getFileSystem();
|
|
|
|
+ final AbfsConfiguration configuration = fs.getAbfsStore()
|
|
|
|
+ .getAbfsConfiguration();
|
|
|
|
+
|
|
|
|
+ String userAgentStr = getUserAgentString(configuration, false);
|
|
|
|
+ verifyBasicInfo(userAgentStr);
|
|
|
|
+ Assertions.assertThat(userAgentStr)
|
|
|
|
+ .describedAs(
|
|
|
|
+ "User-Agent string for FNS accounts on Blob endpoint should contain "
|
|
|
|
+ + FNS_BLOB_USER_AGENT_IDENTIFIER)
|
|
|
|
+ .contains(FNS_BLOB_USER_AGENT_IDENTIFIER);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ // Test to verify that the user agent string for non-FNS-Blob accounts
|
|
|
|
+ // does not contain the FNS identifier.
|
|
|
|
+ public void verifyUserAgentForDFS() throws Exception {
|
|
|
|
+ assumeDfsServiceType();
|
|
|
|
+ final AzureBlobFileSystem fs = getFileSystem();
|
|
|
|
+ final AbfsConfiguration configuration = fs.getAbfsStore()
|
|
|
|
+ .getAbfsConfiguration();
|
|
|
|
+
|
|
|
|
+ String userAgentStr = getUserAgentString(configuration, false);
|
|
|
|
+ verifyBasicInfo(userAgentStr);
|
|
|
|
+ Assertions.assertThat(userAgentStr)
|
|
|
|
+ .describedAs(
|
|
|
|
+ "User-Agent string for non-FNS-Blob accounts should not contain"
|
|
|
|
+ + FNS_BLOB_USER_AGENT_IDENTIFIER)
|
|
|
|
+ .doesNotContain(FNS_BLOB_USER_AGENT_IDENTIFIER);
|
|
|
|
+ }
|
|
|
|
+
|
|
public static AbfsClient createTestClientFromCurrentContext(
|
|
public static AbfsClient createTestClientFromCurrentContext(
|
|
AbfsClient baseAbfsClientInstance,
|
|
AbfsClient baseAbfsClientInstance,
|
|
AbfsConfiguration abfsConfig) throws IOException, URISyntaxException {
|
|
AbfsConfiguration abfsConfig) throws IOException, URISyntaxException {
|