Skip to content

Commit d2200c6

Browse files
[Storage][DataMovement] Fix preserving FileChangedOn during transfers (Azure#48009)
1 parent 5c54016 commit d2200c6

18 files changed

+165
-164
lines changed

sdk/storage/Azure.Storage.DataMovement.Blobs/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "net",
44
"TagPrefix": "net/storage/Azure.Storage.DataMovement.Blobs",
5-
"Tag": "net/storage/Azure.Storage.DataMovement.Blobs_ce7e1f61c3"
5+
"Tag": "net/storage/Azure.Storage.DataMovement.Blobs_148b875701"
66
}

sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobStartTransferCopyTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class AppendBlobStartTransferCopyTests : StartTransferCopyTestBase
3636
StorageTestEnvironment>
3737
{
3838
private readonly AccessTier _defaultAccessTier = AccessTier.Cold;
39-
private const string _defaultContentType = "application/octet-stream";
39+
private const string _defaultContentType = "image/jpeg";
4040
private const string _defaultContentLanguage = "en-US";
4141
private const string _defaultContentDisposition = "inline";
4242
private const string _defaultCacheControl = "no-cache";
@@ -233,6 +233,7 @@ protected override async Task VerifyPropertiesCopyAsync(
233233
Assert.IsNull(destinationProperties.ContentDisposition);
234234
Assert.IsNull(destinationProperties.ContentLanguage);
235235
Assert.IsNull(destinationProperties.CacheControl);
236+
Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType));
236237

237238
GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(cancellationToken: cancellationToken);
238239
Assert.IsEmpty(destinationTags.Tags);

sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobToBlockBlobTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class AppendBlobToBlockBlobTests : StartTransferCopyTestBase
3636
StorageTestEnvironment>
3737
{
3838
private readonly AccessTier _defaultAccessTier = AccessTier.Cold;
39-
private const string _defaultContentType = "text/plain";
39+
private const string _defaultContentType = "image/jpeg";
4040
private const string _defaultContentLanguage = "en-US";
4141
private const string _defaultContentDisposition = "inline";
4242
private const string _defaultCacheControl = "no-cache";
@@ -229,6 +229,7 @@ protected override async Task VerifyPropertiesCopyAsync(
229229
Assert.IsNull(destinationProperties.ContentDisposition);
230230
Assert.IsNull(destinationProperties.ContentLanguage);
231231
Assert.IsNull(destinationProperties.CacheControl);
232+
Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType));
232233

233234
GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(cancellationToken: cancellationToken);
234235
Assert.IsEmpty(destinationTags.Tags);

sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobToPageBlobTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class AppendBlobToPageBlobTests : StartTransferCopyTestBase
3636
StorageTestEnvironment>
3737
{
3838
private readonly AccessTier _defaultAccessTier = AccessTier.Cold;
39-
private const string _defaultContentType = "text/plain";
39+
private const string _defaultContentType = "image/jpeg";
4040
private const string _defaultContentLanguage = "en-US";
4141
private const string _defaultContentDisposition = "inline";
4242
private const string _defaultCacheControl = "no-cache";
@@ -248,6 +248,7 @@ protected override async Task VerifyPropertiesCopyAsync(
248248
Assert.IsNull(destinationProperties.ContentDisposition);
249249
Assert.IsNull(destinationProperties.ContentLanguage);
250250
Assert.IsNull(destinationProperties.CacheControl);
251+
Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType));
251252

252253
GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(cancellationToken: cancellationToken);
253254
Assert.IsEmpty(destinationTags.Tags);

sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobStartTransferCopyTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class BlockBlobStartTransferCopyTests : StartTransferCopyTestBase
3535
StorageTestEnvironment>
3636
{
3737
private readonly AccessTier _defaultAccessTier = AccessTier.Cold;
38-
private const string _defaultContentType = "text/plain";
38+
private const string _defaultContentType = "image/jpeg";
3939
private const string _defaultContentLanguage = "en-US";
4040
private const string _defaultContentDisposition = "inline";
4141
private const string _defaultCacheControl = "no-cache";
@@ -212,6 +212,7 @@ protected override async Task VerifyPropertiesCopyAsync(
212212
Assert.IsNull(destinationProperties.ContentLanguage);
213213
Assert.IsNull(destinationProperties.CacheControl);
214214
Assert.AreEqual(_defaultAccessTier.ToString(), destinationProperties.AccessTier);
215+
Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType));
215216

216217
GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync();
217218
Assert.IsEmpty(destinationTags.Tags);

sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobToAppendBlobTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class BlockBlobToAppendBlobTests : StartTransferCopyTestBase
3636
StorageTestEnvironment>
3737
{
3838
private readonly AccessTier _defaultAccessTier = AccessTier.Cold;
39-
private const string _defaultContentType = "text/plain";
39+
private const string _defaultContentType = "image/jpeg";
4040
private const string _defaultContentLanguage = "en-US";
4141
private const string _defaultContentDisposition = "inline";
4242
private const string _defaultCacheControl = "no-cache";
@@ -233,6 +233,7 @@ protected override async Task VerifyPropertiesCopyAsync(
233233
Assert.IsNull(destinationProperties.ContentDisposition);
234234
Assert.IsNull(destinationProperties.ContentLanguage);
235235
Assert.IsNull(destinationProperties.CacheControl);
236+
Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType));
236237

237238
GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(cancellationToken: cancellationToken);
238239
Assert.IsEmpty(destinationTags.Tags);

sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobToPageBlobTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class BlockBlobToPageBlobTests : StartTransferCopyTestBase
3636
StorageTestEnvironment>
3737
{
3838
private readonly AccessTier _defaultAccessTier = AccessTier.Cold;
39-
private const string _defaultContentType = "text/plain";
39+
private const string _defaultContentType = "image/jpeg";
4040
private const string _defaultContentLanguage = "en-US";
4141
private const string _defaultContentDisposition = "inline";
4242
private const string _defaultCacheControl = "no-cache";
@@ -234,6 +234,7 @@ protected override async Task VerifyPropertiesCopyAsync(
234234
Assert.IsNull(destinationProperties.ContentDisposition);
235235
Assert.IsNull(destinationProperties.ContentLanguage);
236236
Assert.IsNull(destinationProperties.CacheControl);
237+
Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType));
237238

238239
GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync();
239240
Assert.IsEmpty(destinationTags.Tags);

sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobStartTransferCopyTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class PageBlobStartTransferCopyTests : StartTransferCopyTestBase
3636
StorageTestEnvironment>
3737
{
3838
private readonly AccessTier _defaultAccessTier = AccessTier.Cool;
39-
private const string _defaultContentType = "application/octet-stream";
39+
private const string _defaultContentType = "image/jpeg";
4040
private const string _defaultContentLanguage = "en-US";
4141
private const string _defaultContentDisposition = "inline";
4242
private const string _defaultCacheControl = "no-cache";
@@ -224,6 +224,7 @@ protected override async Task VerifyPropertiesCopyAsync(
224224
Assert.IsNull(destinationProperties.ContentDisposition);
225225
Assert.IsNull(destinationProperties.ContentLanguage);
226226
Assert.IsNull(destinationProperties.CacheControl);
227+
Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType));
227228

228229
GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync();
229230
Assert.IsEmpty(destinationTags.Tags);

sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobToAppendBlobTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class PageBlobToAppendBlobTests : StartTransferCopyTestBase
3636
StorageTestEnvironment>
3737
{
3838
private readonly AccessTier _defaultAccessTier = AccessTier.Cold;
39-
private const string _defaultContentType = "text/plain";
39+
private const string _defaultContentType = "image/jpeg";
4040
private const string _defaultContentLanguage = "en-US";
4141
private const string _defaultContentDisposition = "inline";
4242
private const string _defaultCacheControl = "no-cache";
@@ -241,6 +241,7 @@ protected override async Task VerifyPropertiesCopyAsync(
241241
Assert.IsNull(destinationProperties.ContentDisposition);
242242
Assert.IsNull(destinationProperties.ContentLanguage);
243243
Assert.IsNull(destinationProperties.CacheControl);
244+
Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType));
244245

245246
GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(cancellationToken: cancellationToken);
246247
Assert.IsEmpty(destinationTags.Tags);

sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobToBlockBlobTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class PageBlobToBlockBlobTests : StartTransferCopyTestBase
3636
StorageTestEnvironment>
3737
{
3838
private readonly AccessTier _defaultAccessTier = AccessTier.Cold;
39-
private const string _defaultContentType = "text/plain";
39+
private const string _defaultContentType = "image/jpeg";
4040
private const string _defaultContentLanguage = "en-US";
4141
private const string _defaultContentDisposition = "inline";
4242
private const string _defaultCacheControl = "no-cache";
@@ -232,6 +232,7 @@ protected override async Task VerifyPropertiesCopyAsync(
232232
Assert.IsNull(destinationProperties.ContentDisposition);
233233
Assert.IsNull(destinationProperties.ContentLanguage);
234234
Assert.IsNull(destinationProperties.CacheControl);
235+
Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType));
235236

236237
GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync();
237238
Assert.IsEmpty(destinationTags.Tags);

0 commit comments

Comments
 (0)