From e6ca80d89934ee3e7fe4550f295d323a0ba57ec4 Mon Sep 17 00:00:00 2001 From: Jinming Hu Date: Mon, 29 Aug 2022 14:37:20 +0800 Subject: [PATCH 1/4] Empty file or existing file won't be created/overwritten if the blob to be downloaded doesn't exist. --- sdk/storage/azure-storage-blobs/CHANGELOG.md | 2 ++ sdk/storage/azure-storage-blobs/src/blob_client.cpp | 3 +-- .../test/ut/block_blob_client_test.cpp | 8 ++++++++ sdk/storage/azure-storage-files-datalake/CHANGELOG.md | 1 + .../test/ut/datalake_file_client_test.cpp | 9 +++++++++ sdk/storage/azure-storage-files-shares/CHANGELOG.md | 2 ++ .../azure-storage-files-shares/src/share_file_client.cpp | 3 +-- .../test/ut/share_file_client_test.cpp | 9 +++++++++ 8 files changed, 33 insertions(+), 4 deletions(-) diff --git a/sdk/storage/azure-storage-blobs/CHANGELOG.md b/sdk/storage/azure-storage-blobs/CHANGELOG.md index 09af321dd0..7077a2d600 100644 --- a/sdk/storage/azure-storage-blobs/CHANGELOG.md +++ b/sdk/storage/azure-storage-blobs/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +- Empty file or existing file won't be created/overwritten if the blob to be downloaded doesn't exist. + ### Other Changes ## 12.6.0-beta.1 (2022-08-09) diff --git a/sdk/storage/azure-storage-blobs/src/blob_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_client.cpp index e391f3e376..9ee05b2c7f 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_client.cpp @@ -419,8 +419,6 @@ namespace Azure { namespace Storage { namespace Blobs { firstChunkOptions.Range.Value().Length = firstChunkLength; } - _internal::FileWriter fileWriter(fileName); - auto firstChunk = Download(firstChunkOptions, context); const Azure::ETag eTag = firstChunk.Value.Details.ETag; @@ -461,6 +459,7 @@ namespace Azure { namespace Storage { namespace Blobs { } }; + _internal::FileWriter fileWriter(fileName); bodyStreamToFile(*(firstChunk.Value.BodyStream), fileWriter, 0, firstChunkLength, context); firstChunk.Value.BodyStream.reset(); 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 5e7b2e28f1..ee19bf332a 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 @@ -1387,6 +1387,14 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_TRUE(exceptionCaught); } + TEST_F(BlockBlobClientTest, DownloadNonExistingToFile) { + const auto testName(GetTestName()); + auto blockBlobClient = GetBlockBlobClient(testName); + + EXPECT_THROW(blockBlobClient.DownloadTo(testName), StorageException); + EXPECT_THROW(ReadFile(testName), std::runtime_error); + } + TEST_F(BlockBlobClientTest, DeleteIfExists) { auto const testName(GetTestName()); diff --git a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md index bb58111746..befcee05ce 100644 --- a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md @@ -9,6 +9,7 @@ ### Bugs Fixed - Fixed a bug where file/directory renaming cannot be authenticated with SAS. +- Empty file or existing file won't be created/overwritten if the file to be downloaded doesn't exist. ### Other Changes diff --git a/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_client_test.cpp b/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_client_test.cpp index abceb5f32b..099135cd54 100644 --- a/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_client_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_client_test.cpp @@ -349,6 +349,15 @@ namespace Azure { namespace Storage { namespace Test { fileClient.Delete(); } + TEST_F(DataLakeFileClientTest, DownloadNonExistingToFile) + { + const auto testName(GetTestName()); + auto fileClient = m_fileSystemClient->GetFileClient(testName); + + EXPECT_THROW(fileClient.DownloadTo(testName), StorageException); + EXPECT_THROW(ReadFile(testName), std::runtime_error); + } + TEST_F(DataLakeFileClientTest, ScheduleForDeletion) { { diff --git a/sdk/storage/azure-storage-files-shares/CHANGELOG.md b/sdk/storage/azure-storage-files-shares/CHANGELOG.md index ee6a9fc9d7..fa72d5c64a 100644 --- a/sdk/storage/azure-storage-files-shares/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-shares/CHANGELOG.md @@ -18,6 +18,8 @@ ### Bugs Fixed +- Empty file or existing file won't be created/overwritten if the file to be downloaded doesn't exist. + ### Other Changes ## 12.2.1 (2022-03-09) diff --git a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp index a220d22078..766b0778a0 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp @@ -801,8 +801,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { firstChunkOptions.Range.Value().Length = firstChunkLength; } - _internal::FileWriter fileWriter(fileName); - auto firstChunk = Download(firstChunkOptions, context); const Azure::ETag etag = firstChunk.Value.Details.ETag; @@ -845,6 +843,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } }; + _internal::FileWriter fileWriter(fileName); bodyStreamToFile(*(firstChunk.Value.BodyStream), fileWriter, 0, firstChunkLength, context); firstChunk.Value.BodyStream.reset(); 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 c20c46b17d..eae7c2a7ca 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 @@ -111,6 +111,15 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_NO_THROW(fileClient.DownloadTo(buff.data(), 0)); } + TEST_F(FileShareFileClientTest, DownloadNonExistingToFile) + { + const auto testName(GetTestName()); + auto fileClient = m_fileShareDirectoryClient->GetFileClient(m_testName); + + EXPECT_THROW(fileClient.DownloadTo(testName), StorageException); + EXPECT_THROW(ReadFile(testName), std::runtime_error); + } + TEST_F(FileShareFileClientTest, FileMetadata) { auto metadata1 = GetMetadata(); From 3cf7507ea614562b5c092292e471c1024007835a Mon Sep 17 00:00:00 2001 From: Jinming Hu Date: Mon, 29 Aug 2022 18:42:01 +0800 Subject: [PATCH 2/4] recordings --- ...bClientTest.DownloadNonExistingToFile.json | 69 +++++++ ...eClientTest.DownloadNonExistingToFile.json | 111 ++++++++++++ ...eClientTest.DownloadNonExistingToFile.json | 169 ++++++++++++++++++ 3 files changed, 349 insertions(+) create mode 100644 sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.DownloadNonExistingToFile.json create mode 100644 sdk/storage/azure-storage-files-datalake/test/ut/recordings/DataLakeFileClientTest.DownloadNonExistingToFile.json create mode 100644 sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.DownloadNonExistingToFile.json diff --git a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.DownloadNonExistingToFile.json b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.DownloadNonExistingToFile.json new file mode 100644 index 0000000000..8cee2024bb --- /dev/null +++ b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.DownloadNonExistingToFile.json @@ -0,0 +1,69 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "6a753b0a-bcac-4076-6909-4141c56901df", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:41:39 GMT", + "etag": "\"0x8DA89AB0E7605FE\"", + "last-modified": "Mon, 29 Aug 2022 10:41:40 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6a753b0a-bcac-4076-6909-4141c56901df", + "x-ms-request-id": "0a7e509f-001e-0034-4d93-bbe90a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestdownloadnonexistingtofile?restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "3b4bb7fa-3c30-4c2c-5fb9-693daa5a8fa2", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "BlobNotFoundThe specified blob does not exist.\nRequestId:0a7e5112-001e-0034-2c93-bbe90a000000\nTime:2022-08-29T10:41:41.1529398Z", + "REASON_PHRASE": "The specified blob does not exist.", + "STATUS_CODE": "404", + "content-length": "215", + "content-type": "application/xml", + "date": "Mon, 29 Aug 2022 10:41:40 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-client-request-id": "3b4bb7fa-3c30-4c2c-5fb9-693daa5a8fa2", + "x-ms-error-code": "BlobNotFound", + "x-ms-request-id": "0a7e5112-001e-0034-2c93-bbe90a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestdownloadnonexistingtofile/DownloadNonExistingToFile" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "fbed990d-4365-423a-718f-b1d64df6aa49", + "x-ms-version": "2021-04-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:41:40 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "fbed990d-4365-423a-718f-b1d64df6aa49", + "x-ms-request-id": "0a7e52c7-001e-0034-2993-bbe90a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestdownloadnonexistingtofile?restype=container" + } + ] +} diff --git a/sdk/storage/azure-storage-files-datalake/test/ut/recordings/DataLakeFileClientTest.DownloadNonExistingToFile.json b/sdk/storage/azure-storage-files-datalake/test/ut/recordings/DataLakeFileClientTest.DownloadNonExistingToFile.json new file mode 100644 index 0000000000..924992437a --- /dev/null +++ b/sdk/storage/azure-storage-files-datalake/test/ut/recordings/DataLakeFileClientTest.DownloadNonExistingToFile.json @@ -0,0 +1,111 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "22f683cd-fbdf-4223-51dd-a86271428dfc", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:59 GMT", + "etag": "\"0x8DA89AAF65783FA\"", + "last-modified": "Mon, 29 Aug 2022 10:40:59 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "22f683cd-fbdf-4223-51dd-a86271428dfc", + "x-ms-request-id": "30e6f346-101e-0047-3093-bb26fb000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/datalakefileclienttestdownloadnonexistingtofile?restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-datalake/12.4.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "88ef55a1-2b5f-41a6-74eb-54a5bdfe93cf", + "x-ms-version": "2020-02-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:41:00 GMT", + "etag": "\"0x8DA89AAF74A9F21\"", + "last-modified": "Mon, 29 Aug 2022 10:41:01 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "88ef55a1-2b5f-41a6-74eb-54a5bdfe93cf", + "x-ms-request-id": "774068d3-e01f-0021-5e93-bb69db000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2020-02-10" + }, + "Url": "https://REDACTED.dfs.core.windows.net/datalakefileclienttestdownloadnonexistingtofile/datalakefileclienttestdownloadnonexistingtofile?resource=file" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "b096b2d7-898d-4e0b-4595-0d12d95f44cb", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "BlobNotFoundThe specified blob does not exist.\nRequestId:30e6f409-101e-0047-5193-bb26fb000000\nTime:2022-08-29T10:41:01.6071578Z", + "REASON_PHRASE": "The specified blob does not exist.", + "STATUS_CODE": "404", + "content-length": "215", + "content-type": "application/xml", + "date": "Mon, 29 Aug 2022 10:41:01 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b096b2d7-898d-4e0b-4595-0d12d95f44cb", + "x-ms-error-code": "BlobNotFound", + "x-ms-request-id": "30e6f409-101e-0047-5193-bb26fb000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/datalakefileclienttestdownloadnonexistingtofile/DownloadNonExistingToFile" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-datalake/12.4.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "b55f5684-ae63-4d44-6556-b675337f7d74", + "x-ms-version": "2020-02-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:41:01 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b55f5684-ae63-4d44-6556-b675337f7d74", + "x-ms-request-id": "7740698c-e01f-0021-1693-bb69db000000", + "x-ms-version": "2020-02-10" + }, + "Url": "https://REDACTED.dfs.core.windows.net/datalakefileclienttestdownloadnonexistingtofile/datalakefileclienttestdownloadnonexistingtofile" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "6dae38d5-428b-49c8-6de2-bfea67acb620", + "x-ms-version": "2021-04-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:41:01 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6dae38d5-428b-49c8-6de2-bfea67acb620", + "x-ms-request-id": "30e6f436-101e-0047-7c93-bb26fb000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/datalakefileclienttestdownloadnonexistingtofile?restype=container" + } + ] +} diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.DownloadNonExistingToFile.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.DownloadNonExistingToFile.json new file mode 100644 index 0000000000..54adbde038 --- /dev/null +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.DownloadNonExistingToFile.json @@ -0,0 +1,169 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "6edfef4b-894f-4b59-40b3-8207f3ba4b4c", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:09 GMT", + "etag": "\"0x8DA89AAD8AFFAF7\"", + "last-modified": "Mon, 29 Aug 2022 10:40:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6edfef4b-894f-4b59-40b3-8207f3ba4b4c", + "x-ms-request-id": "2c18eab3-401a-0078-5593-bb793a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "9ad657f0-6082-467c-4455-e9b75aa48941", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:09 GMT", + "etag": "\"0x8DA89AAD8E06427\"", + "last-modified": "Mon, 29 Aug 2022 10:40:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "9ad657f0-6082-467c-4455-e9b75aa48941", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-29T10:40:10.2376487Z", + "x-ms-file-creation-time": "2022-08-29T10:40:10.2376487Z", + "x-ms-file-id": "13835128424026341376", + "x-ms-file-last-write-time": "2022-08-29T10:40:10.2376487Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "14799134079974362488*11941910252504767217", + "x-ms-request-id": "2c18eaca-401a-0078-6993-bb793a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile/DownloadNonExistingToFilebase?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "f062410c-713f-470d-426f-990d3f03ff74", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:10 GMT", + "etag": "\"0x8DA89AAD90D6101\"", + "last-modified": "Mon, 29 Aug 2022 10:40:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "f062410c-713f-470d-426f-990d3f03ff74", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-29T10:40:10.5324801Z", + "x-ms-file-creation-time": "2022-08-29T10:40:10.5324801Z", + "x-ms-file-id": "11529285414812647424", + "x-ms-file-last-write-time": "2022-08-29T10:40:10.5324801Z", + "x-ms-file-parent-id": "13835128424026341376", + "x-ms-file-permission-key": "944304957241799295*11941910252504767217", + "x-ms-request-id": "2c18eade-401a-0078-7c93-bb793a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile/DownloadNonExistingToFilebase/DownloadNonExistingToFilebasefile" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "92d10ba7-5cce-4bf5-4ec3-f2242990b412", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "ResourceNotFoundThe specified resource does not exist.\nRequestId:2c18eae2-401a-0078-8093-bb793a000000\nTime:2022-08-29T10:40:10.7988819Z", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "content-length": "223", + "content-type": "application/xml", + "date": "Mon, 29 Aug 2022 10:40:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-client-request-id": "92d10ba7-5cce-4bf5-4ec3-f2242990b412", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "2c18eae2-401a-0078-8093-bb793a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile/DownloadNonExistingToFilebase/DownloadNonExistingToFile" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "b9b912c5-3a77-4008-4ef4-daedeafc4f8a", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b9b912c5-3a77-4008-4ef4-daedeafc4f8a", + "x-ms-request-id": "2c18eae5-401a-0078-0393-bb793a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "3996664f-a9c3-4e5d-5cd7-25f8cfa58215", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "3996664f-a9c3-4e5d-5cd7-25f8cfa58215", + "x-ms-request-id": "2c18eae9-401a-0078-0693-bb793a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "b4aa936b-5d9e-445c-4a86-914acb77413b", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:11 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b4aa936b-5d9e-445c-4a86-914acb77413b", + "x-ms-request-id": "2c18eaec-401a-0078-0893-bb793a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile?restype=share" + } + ] +} From 2ecd208c551918dc427e9ddc6e2d467d9819b86d Mon Sep 17 00:00:00 2001 From: Jinming Hu Date: Tue, 30 Aug 2022 09:41:57 +0800 Subject: [PATCH 3/4] clang-format --- .../test/ut/block_blob_client_test.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 ee19bf332a..33fb259e63 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 @@ -715,12 +715,10 @@ namespace Azure { namespace Storage { namespace Test { class DownloadBlockBlob : public BlockBlobClientTest, - public ::testing::WithParamInterface { - }; + public ::testing::WithParamInterface {}; class UploadBlockBlob : public BlockBlobClientTest, - public ::testing::WithParamInterface { - }; + public ::testing::WithParamInterface {}; #define APPEND_IF_NOT_NULL(value, suffix, destination) \ if (value) \ @@ -1387,7 +1385,8 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_TRUE(exceptionCaught); } - TEST_F(BlockBlobClientTest, DownloadNonExistingToFile) { + TEST_F(BlockBlobClientTest, DownloadNonExistingToFile) + { const auto testName(GetTestName()); auto blockBlobClient = GetBlockBlobClient(testName); From f39c0f5da84b61e3f9ae30cb189f1d1e52fef717 Mon Sep 17 00:00:00 2001 From: Jinming Hu Date: Tue, 30 Aug 2022 12:35:18 +0800 Subject: [PATCH 4/4] clang-format --- .../azure-storage-blobs/test/ut/block_blob_client_test.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 33fb259e63..2caf96652e 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 @@ -715,10 +715,12 @@ namespace Azure { namespace Storage { namespace Test { class DownloadBlockBlob : public BlockBlobClientTest, - public ::testing::WithParamInterface {}; + public ::testing::WithParamInterface { + }; class UploadBlockBlob : public BlockBlobClientTest, - public ::testing::WithParamInterface {}; + public ::testing::WithParamInterface { + }; #define APPEND_IF_NOT_NULL(value, suffix, destination) \ if (value) \