From c8075a0a5be4e59d400f62b15e9186ab02a4e1a9 Mon Sep 17 00:00:00 2001 From: Jinming Hu Date: Wed, 4 Mar 2026 16:37:20 +1100 Subject: [PATCH 1/5] Enable some test cases --- .../test/ut/append_blob_client_test.cpp | 2 +- .../test/ut/blob_container_client_test.cpp | 2 +- .../test/ut/block_blob_client_test.cpp | 2 +- .../test/ut/page_blob_client_test.cpp | 2 +- .../ut/datalake_file_system_client_test.cpp | 2 +- .../test/ut/datalake_service_client_test.cpp | 2 +- .../test/ut/share_client_test.cpp | 8 ++--- .../test/ut/share_directory_client_test.cpp | 6 ++-- .../test/ut/share_file_client_test.cpp | 14 ++++---- .../test/ut/share_service_client_test.cpp | 36 +++++++++++++++---- .../test/ut/queue_client_test.cpp | 2 +- 11 files changed, 50 insertions(+), 28 deletions(-) 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..d96356ff1e 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,27 @@ 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 = m_premiumShareServiceClient + = 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 +193,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 +441,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(); From 09f0a80824887afc2c4a3e60c5bad376e0780dc8 Mon Sep 17 00:00:00 2001 From: Jinming Hu Date: Fri, 5 Jun 2026 19:38:10 +1000 Subject: [PATCH 2/5] Update recording --- sdk/storage/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/assets.json b/sdk/storage/assets.json index 379319bbec..7b6126413c 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_5834f9dd66" } From 4ddc736b74d53d9e0c6ca4af21ae76b483732945 Mon Sep 17 00:00:00 2001 From: Jinming Hu Date: Fri, 5 Jun 2026 22:11:41 +1000 Subject: [PATCH 3/5] Update recording --- sdk/storage/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/assets.json b/sdk/storage/assets.json index 7b6126413c..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_5834f9dd66" + "Tag": "cpp/storage_4783f09bdf" } From e3c3fb3012edfe2b5cb2791e475467045791c306 Mon Sep 17 00:00:00 2001 From: Jinming Hu Date: Sat, 6 Jun 2026 10:15:39 +1000 Subject: [PATCH 4/5] fix --- .../test/ut/share_service_client_test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 d96356ff1e..8efee4125a 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 @@ -71,8 +71,7 @@ namespace Azure { namespace Storage { namespace Test { clientOptions.ShareTokenIntent = Azure::Storage::Files::Shares::Models::ShareTokenIntent::Backup; } - auto shareServiceClient = m_premiumShareServiceClient - = std::make_shared( + auto shareServiceClient = std::make_shared( GetPremiumShareServiceUrl(), GetTestCredential(), clientOptions); auto shareClient = shareServiceClient->GetShareClient(shareName); m_resourceCleanupFunctions.push_back([shareClient]() { shareClient.DeleteIfExists(); }); From 132fcf119d34c2c4f2a86642102eb4aa825cbbb5 Mon Sep 17 00:00:00 2001 From: Jinming Hu Date: Sat, 6 Jun 2026 11:09:45 +1000 Subject: [PATCH 5/5] fix clang-format --- .../test/ut/share_service_client_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8efee4125a..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 @@ -72,7 +72,7 @@ namespace Azure { namespace Storage { namespace Test { = Azure::Storage::Files::Shares::Models::ShareTokenIntent::Backup; } auto shareServiceClient = std::make_shared( - GetPremiumShareServiceUrl(), GetTestCredential(), clientOptions); + GetPremiumShareServiceUrl(), GetTestCredential(), clientOptions); auto shareClient = shareServiceClient->GetShareClient(shareName); m_resourceCleanupFunctions.push_back([shareClient]() { shareClient.DeleteIfExists(); }); return shareClient;