diff --git a/sdk/storage/assets.json b/sdk/storage/assets.json index 379319bbec..3aa2e6a886 100644 --- a/sdk/storage/assets.json +++ b/sdk/storage/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "cpp", "TagPrefix": "cpp/storage", - "Tag": "cpp/storage_81cefdec1b" + "Tag": "cpp/storage_4783f09bdf" } diff --git a/sdk/storage/azure-storage-blobs/test/ut/append_blob_client_test.cpp b/sdk/storage/azure-storage-blobs/test/ut/append_blob_client_test.cpp index f2c849a9da..e87536f5ed 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/append_blob_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/ut/append_blob_client_test.cpp @@ -468,7 +468,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_EQ(blobContent.size(), properties.BlobSize); } - TEST_F(AppendBlobClientTest, OAuthAppendBlockFromUri_SourceFileShare_PLAYBACKONLY_) + TEST_F(AppendBlobClientTest, OAuthAppendBlockFromUri_SourceFileShare) { auto shareClientOptions = InitStorageClientOptions(); shareClientOptions.ShareTokenIntent = Files::Shares::Models::ShareTokenIntent::Backup; diff --git a/sdk/storage/azure-storage-blobs/test/ut/blob_container_client_test.cpp b/sdk/storage/azure-storage-blobs/test/ut/blob_container_client_test.cpp index 1cdd78ea2c..c1c8f38f85 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/blob_container_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/ut/blob_container_client_test.cpp @@ -645,7 +645,7 @@ namespace Azure { namespace Storage { namespace Test { containerClient.DeleteIfExists(); } - TEST_F(BlobContainerClientTest, AclAndAccountInfoOAuth_PLAYBACKONLY_) + TEST_F(BlobContainerClientTest, AclAndAccountInfoOAuth) { auto credential = GetTestCredential(); auto clientOptions = InitStorageClientOptions(); diff --git a/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp b/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp index 15d91e29ad..9b6dcd69c5 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp @@ -492,7 +492,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_FALSE(blobItem.Details.IncrementalCopyDestinationSnapshot.HasValue()); } - TEST_F(BlockBlobClientTest, OAuthCopyFromUri_SourceFileShare_PLAYBACKONLY_) + TEST_F(BlockBlobClientTest, OAuthCopyFromUri_SourceFileShare) { auto shareClientOptions = InitStorageClientOptions(); shareClientOptions.ShareTokenIntent = Files::Shares::Models::ShareTokenIntent::Backup; diff --git a/sdk/storage/azure-storage-blobs/test/ut/page_blob_client_test.cpp b/sdk/storage/azure-storage-blobs/test/ut/page_blob_client_test.cpp index 5ac37a2fd0..2e53d688ac 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/page_blob_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/ut/page_blob_client_test.cpp @@ -302,7 +302,7 @@ namespace Azure { namespace Storage { namespace Test { pageBlobClient.Download().Value.BodyStream->ReadToEnd()); } - TEST_F(PageBlobClientTest, OAuthUploadFromUri_SourceFileShare_PLAYBACKONLY_) + TEST_F(PageBlobClientTest, OAuthUploadFromUri_SourceFileShare) { auto shareClientOptions = InitStorageClientOptions(); shareClientOptions.ShareTokenIntent = Files::Shares::Models::ShareTokenIntent::Backup; diff --git a/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_system_client_test.cpp b/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_system_client_test.cpp index d446572350..954c0af81f 100644 --- a/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_system_client_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_system_client_test.cpp @@ -806,7 +806,7 @@ namespace Azure { namespace Storage { namespace Test { } } - TEST_F(DataLakeFileSystemClientTest, AclOAuth_PLAYBACKONLY_) + TEST_F(DataLakeFileSystemClientTest, AclOAuth) { auto credential = GetTestCredential(); auto clientOptions = InitStorageClientOptions(); diff --git a/sdk/storage/azure-storage-files-datalake/test/ut/datalake_service_client_test.cpp b/sdk/storage/azure-storage-files-datalake/test/ut/datalake_service_client_test.cpp index 7ae9ec365e..f6452e3799 100644 --- a/sdk/storage/azure-storage-files-datalake/test/ut/datalake_service_client_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/ut/datalake_service_client_test.cpp @@ -144,7 +144,7 @@ namespace Azure { namespace Storage { namespace Test { } } - TEST_F(DataLakeServiceClientTest, ListSystemFileSystems_PLAYBACKONLY_) + TEST_F(DataLakeServiceClientTest, ListSystemFileSystems) { // Disabled temporarily because the test account on the pipeline hasn't system fileSystems. // List system type FileSystems diff --git a/sdk/storage/azure-storage-files-shares/test/ut/share_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/ut/share_client_test.cpp index 82fdc341f1..b60bae5e09 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/share_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/ut/share_client_test.cpp @@ -649,7 +649,7 @@ namespace Azure { namespace Storage { namespace Test { } } - TEST_F(FileShareClientTest, OAuth_PLAYBACKONLY_) + TEST_F(FileShareClientTest, OAuth) { auto credential = GetTestCredential(); auto options = InitStorageClientOptions(); @@ -735,7 +735,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_TRUE(client1.GetUrl().find("snapshot=" + timestamp2) == std::string::npos); } - TEST_F(FileShareClientTest, Audience_PLAYBACKONLY_) + TEST_F(FileShareClientTest, Audience) { auto credential = GetTestCredential(); auto clientOptions = InitStorageClientOptions(); @@ -764,7 +764,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_THROW(shareClient.GetPermission(created.FilePermissionKey), StorageException); } - TEST_F(FileShareClientTest, EnableSnapshotVirtualDirectoryAccess_PLAYBACKONLY_) + TEST_F(FileShareClientTest, EnableSnapshotVirtualDirectoryAccess) { std::string shareName = LowercaseRandomString(); auto shareClient = GetPremiumShareClientForTest(shareName); @@ -790,7 +790,7 @@ namespace Azure { namespace Storage { namespace Test { && !properties.EnableSnapshotVirtualDirectoryAccess.Value()); } - TEST_F(FileShareClientTest, FilePermissionFormat_PLAYBACKONLY_) + TEST_F(FileShareClientTest, FilePermissionFormat) { auto sddlPermission = "O:S-1-5-21-2127521184-1604012920-1887927527-21560751G:S-1-5-21-2127521184-1604012920-" diff --git a/sdk/storage/azure-storage-files-shares/test/ut/share_directory_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/ut/share_directory_client_test.cpp index d9fdd094ae..5f671370b5 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/share_directory_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/ut/share_directory_client_test.cpp @@ -1098,7 +1098,7 @@ namespace Azure { namespace Storage { namespace Test { testTrailingDot(false, false); } - TEST_F(FileShareDirectoryClientTest, OAuth_PLAYBACKONLY_) + TEST_F(FileShareDirectoryClientTest, OAuth) { const std::string directoryName = RandomString(); @@ -1232,7 +1232,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_THROW(directoryClient.GetProperties(), StorageException); } - TEST_F(FileShareDirectoryClientTest, FilePermissionFormat_PLAYBACKONLY_) + TEST_F(FileShareDirectoryClientTest, FilePermissionFormat) { auto sddlPermission = "O:S-1-5-21-2127521184-1604012920-1887927527-21560751G:S-1-5-21-2127521184-1604012920-" @@ -1378,7 +1378,7 @@ namespace Azure { namespace Storage { namespace Test { } } - TEST_F(FileShareDirectoryClientTest, PremiumNfsProperties_PLAYBACKONLY_) + TEST_F(FileShareDirectoryClientTest, PremiumNfsProperties) { auto shareServiceClient = *m_premiumShareServiceClient; diff --git a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp index 0a6a7995de..9493966448 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp @@ -1740,7 +1740,7 @@ namespace Azure { namespace Storage { namespace Test { testTrailingDot(false); } - TEST_F(FileShareFileClientTest, OAuth_PLAYBACKONLY_) + TEST_F(FileShareFileClientTest, OAuth) { const std::string fileName = RandomString(); @@ -1824,7 +1824,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_NO_THROW(fileClient1.GetProperties()); } - TEST_F(FileShareFileClientTest, OAuthCopy_PLAYBACKONLY_) + TEST_F(FileShareFileClientTest, OAuthCopy) { const std::string fileName = RandomString(); @@ -1911,7 +1911,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_TRUE(client1.GetUrl().find("snapshot=" + timestamp2) == std::string::npos); } - TEST_F(FileShareFileClientTest, Audience_PLAYBACKONLY_) + TEST_F(FileShareFileClientTest, Audience) { auto credential = GetTestCredential(); auto clientOptions = InitStorageClientOptions(); @@ -1987,7 +1987,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_EQ(xorAccessRights, accessRightsA ^ accessRightsB); } - TEST_F(FileShareFileClientTest, FilePermissionFormat_PLAYBACKONLY_) + TEST_F(FileShareFileClientTest, FilePermissionFormat) { auto sddlPermission = "O:S-1-5-21-2127521184-1604012920-1887927527-21560751G:S-1-5-21-2127521184-1604012920-" @@ -2117,7 +2117,7 @@ namespace Azure { namespace Storage { namespace Test { } } - TEST_F(FileShareFileClientTest, FilePermissionFormatForCopy_PLAYBACKONLY_) + TEST_F(FileShareFileClientTest, FilePermissionFormatForCopy) { auto sddlPermission = "O:S-1-5-21-2127521184-1604012920-1887927527-21560751G:S-1-5-21-2127521184-1604012920-" @@ -2211,7 +2211,7 @@ namespace Azure { namespace Storage { namespace Test { } } - TEST_F(FileShareFileClientTest, PremiumPosixProperties_PLAYBACKONLY_) + TEST_F(FileShareFileClientTest, PremiumPosixProperties) { auto shareServiceClient = *m_premiumShareServiceClient; @@ -2467,7 +2467,7 @@ namespace Azure { namespace Storage { namespace Test { Files::Shares::Models::NfsFileType::Regular); } - TEST_F(FileShareFileClientTest, PremiumPosixPropertiesForCopy_PLAYBACKONLY_) + TEST_F(FileShareFileClientTest, PremiumPosixPropertiesForCopy) { auto shareServiceClient = *m_premiumShareServiceClient; diff --git a/sdk/storage/azure-storage-files-shares/test/ut/share_service_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/ut/share_service_client_test.cpp index f8fee6658a..f2ff8c2a8b 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/share_service_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/ut/share_service_client_test.cpp @@ -35,6 +35,12 @@ namespace Azure { namespace Storage { namespace Test { } // Most APIs don't work for premium shares + if (m_useTokenCredentialByDefault) + { + m_premiumShareServiceClient = std::make_shared( + GetPremiumShareServiceUrl(), GetTestCredential(), options); + } + else { std::string premiumConnectionString; try @@ -58,11 +64,26 @@ namespace Azure { namespace Storage { namespace Test { Files::Shares::ShareClientOptions clientOptions) { InitStorageClientOptions(clientOptions); - auto shareClient = Files::Shares::ShareClient::CreateFromConnectionString( - PremiumFileConnectionString(), shareName, clientOptions); - m_resourceCleanupFunctions.push_back([shareClient]() { shareClient.DeleteIfExists(); }); - - return shareClient; + if (m_useTokenCredentialByDefault) + { + if (!clientOptions.ShareTokenIntent.HasValue()) + { + clientOptions.ShareTokenIntent + = Azure::Storage::Files::Shares::Models::ShareTokenIntent::Backup; + } + auto shareServiceClient = std::make_shared( + GetPremiumShareServiceUrl(), GetTestCredential(), clientOptions); + auto shareClient = shareServiceClient->GetShareClient(shareName); + m_resourceCleanupFunctions.push_back([shareClient]() { shareClient.DeleteIfExists(); }); + return shareClient; + } + else + { + auto shareClient = Files::Shares::ShareClient::CreateFromConnectionString( + PremiumFileConnectionString(), shareName, clientOptions); + m_resourceCleanupFunctions.push_back([shareClient]() { shareClient.DeleteIfExists(); }); + return shareClient; + } } TEST_F(FileShareServiceClientTest, Constructors_LIVEONLY_) @@ -171,7 +192,7 @@ namespace Azure { namespace Storage { namespace Test { } } - TEST_F(FileShareServiceClientTest, ListSharesEnableSnapshotVirtualDirectoryAccess_PLAYBACKONLY_) + TEST_F(FileShareServiceClientTest, ListSharesEnableSnapshotVirtualDirectoryAccess) { auto premiumFileShareServiceClient = *m_premiumShareServiceClient; std::string shareName1 = LowercaseRandomString(); @@ -419,7 +440,7 @@ namespace Azure { namespace Storage { namespace Test { premiumFileShareServiceClient.SetProperties(originalProperties); } - TEST_F(FileShareServiceClientTest, OAuth_PLAYBACKONLY_) + TEST_F(FileShareServiceClientTest, OAuth) { auto credential = GetTestCredential(); auto options = InitStorageClientOptions(); diff --git a/sdk/storage/azure-storage-queues/test/ut/queue_client_test.cpp b/sdk/storage/azure-storage-queues/test/ut/queue_client_test.cpp index aef3b6e71e..67315ed90b 100644 --- a/sdk/storage/azure-storage-queues/test/ut/queue_client_test.cpp +++ b/sdk/storage/azure-storage-queues/test/ut/queue_client_test.cpp @@ -268,7 +268,7 @@ namespace Azure { namespace Storage { namespace Test { queueClient.Delete(); } - TEST_F(QueueClientTest, AclOAuth_PLAYBACKONLY_) + TEST_F(QueueClientTest, AclOAuth) { auto credential = GetTestCredential(); auto clientOptions = InitStorageClientOptions();