Skip to content

Commit c31c231

Browse files
authored
[Storage][DataMovement] NFS File-to-File Copy Transfer Preservation (Azure#49266)
* NFS File-to-File Copy Transfer Preservation * fixed tests * create always sets fileType to Regular * Added back assert for FileType + rerecord test * Cleaned code to address comment * Changes based on feedback * Added Uri to StorageResourceItemProperties * small fix * small fix * fixed tests * removed linkCount and fileType
1 parent f51ddd9 commit c31c231

27 files changed

+370
-226
lines changed

sdk/storage/Azure.Storage.DataMovement.Blobs/src/AppendBlobStorageResource.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ protected override async Task<StorageResourceItemProperties> GetPropertiesAsync(
244244
// The properties could be populated during construction (from enumeration)
245245
if (ResourceProperties != default)
246246
{
247+
ResourceProperties.Uri = Uri;
247248
return ResourceProperties;
248249
}
249250
else
@@ -252,6 +253,7 @@ protected override async Task<StorageResourceItemProperties> GetPropertiesAsync(
252253
StorageResourceItemProperties resourceProperties = blobProperties.ToStorageResourceProperties();
253254

254255
ResourceProperties = resourceProperties;
256+
ResourceProperties.Uri = Uri;
255257
return ResourceProperties;
256258
}
257259
}

sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlockBlobStorageResource.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ protected override async Task<StorageResourceItemProperties> GetPropertiesAsync(
269269
// The properties could be populated during construction (from enumeration)
270270
if (ResourceProperties != default)
271271
{
272+
ResourceProperties.Uri = Uri;
272273
return ResourceProperties;
273274
}
274275
else
@@ -277,6 +278,7 @@ protected override async Task<StorageResourceItemProperties> GetPropertiesAsync(
277278
StorageResourceItemProperties resourceProperties = blobProperties.ToStorageResourceProperties();
278279

279280
ResourceProperties = resourceProperties;
281+
ResourceProperties.Uri = Uri;
280282
return ResourceProperties;
281283
}
282284
}

sdk/storage/Azure.Storage.DataMovement.Blobs/src/PageBlobStorageResource.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ protected override async Task<StorageResourceItemProperties> GetPropertiesAsync(
255255
// The properties could be populated during construction (from enumeration)
256256
if (ResourceProperties != default)
257257
{
258+
ResourceProperties.Uri = Uri;
258259
return ResourceProperties;
259260
}
260261
else
@@ -263,6 +264,7 @@ protected override async Task<StorageResourceItemProperties> GetPropertiesAsync(
263264
StorageResourceItemProperties resourceProperties = blobProperties.ToStorageResourceProperties();
264265

265266
ResourceProperties = resourceProperties;
267+
ResourceProperties.Uri = Uri;
266268
return ResourceProperties;
267269
}
268270
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,7 @@ public async Task GetPropertiesAsync_NotCached()
15601560
Assert.That(metadata, Is.EqualTo(metadataResult));
15611561
mock.Verify(b => b.GetPropertiesAsync(It.IsAny<BlobRequestConditions>(), It.IsAny<CancellationToken>()),
15621562
Times.Once());
1563+
mock.Verify(b => b.Uri, Times.Once());
15631564
mock.VerifyNoOtherCalls();
15641565
}
15651566

@@ -1602,6 +1603,7 @@ public async Task GetPropertiesAsync_Cached()
16021603
Assert.That(rawProperties, Is.EqualTo(result.RawProperties));
16031604
mock.Verify(b => b.GetPropertiesAsync(It.IsAny<BlobRequestConditions>(), It.IsAny<CancellationToken>()),
16041605
Times.Never());
1606+
mock.Verify(b => b.Uri, Times.Once());
16051607
mock.VerifyNoOtherCalls();
16061608
}
16071609

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,6 +1272,7 @@ public async Task GetPropertiesAsync_NotCached()
12721272
Assert.That(metadata, Is.EqualTo(metadataResult));
12731273
mock.Verify(b => b.GetPropertiesAsync(It.IsAny<BlobRequestConditions>(), It.IsAny<CancellationToken>()),
12741274
Times.Once());
1275+
mock.Verify(b => b.Uri, Times.Once());
12751276
mock.VerifyNoOtherCalls();
12761277
}
12771278

@@ -1315,6 +1316,7 @@ public async Task GetPropertiesAsync_Cached()
13151316
Assert.That(rawProperties, Is.EqualTo(result.RawProperties));
13161317
mock.Verify(b => b.GetPropertiesAsync(It.IsAny<BlobRequestConditions>(), It.IsAny<CancellationToken>()),
13171318
Times.Never());
1319+
mock.Verify(b => b.Uri, Times.Once());
13181320
mock.VerifyNoOtherCalls();
13191321
}
13201322

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,7 @@ public async Task GetPropertiesAsync_NotCached()
16151615
Assert.That(metadata, Is.EqualTo(metadataResult));
16161616
mock.Verify(b => b.GetPropertiesAsync(It.IsAny<BlobRequestConditions>(), It.IsAny<CancellationToken>()),
16171617
Times.Once());
1618+
mock.Verify(b => b.Uri, Times.Once());
16181619
mock.VerifyNoOtherCalls();
16191620
}
16201621

@@ -1657,6 +1658,7 @@ public async Task GetPropertiesAsync_Cached()
16571658
Assert.That(rawProperties, Is.EqualTo(result.RawProperties));
16581659
mock.Verify(b => b.GetPropertiesAsync(It.IsAny<BlobRequestConditions>(), It.IsAny<CancellationToken>()),
16591660
Times.Never());
1661+
mock.Verify(b => b.Uri, Times.Once());
16601662
mock.VerifyNoOtherCalls();
16611663
}
16621664

sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net6.0.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public ShareFileStorageResourceOptions() { }
4040
public System.DateTimeOffset? FileLastWrittenOn { get { throw null; } set { } }
4141
public System.Collections.Generic.IDictionary<string, string> FileMetadata { get { throw null; } set { } }
4242
public bool? FilePermissions { get { throw null; } set { } }
43+
public bool IsNfs { get { throw null; } set { } }
4344
public Azure.Storage.Files.Shares.Models.ShareFileRequestConditions SourceConditions { get { throw null; } set { } }
4445
}
4546
}

sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net8.0.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public ShareFileStorageResourceOptions() { }
4040
public System.DateTimeOffset? FileLastWrittenOn { get { throw null; } set { } }
4141
public System.Collections.Generic.IDictionary<string, string> FileMetadata { get { throw null; } set { } }
4242
public bool? FilePermissions { get { throw null; } set { } }
43+
public bool IsNfs { get { throw null; } set { } }
4344
public Azure.Storage.Files.Shares.Models.ShareFileRequestConditions SourceConditions { get { throw null; } set { } }
4445
}
4546
}

sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.netstandard2.0.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public ShareFileStorageResourceOptions() { }
4040
public System.DateTimeOffset? FileLastWrittenOn { get { throw null; } set { } }
4141
public System.Collections.Generic.IDictionary<string, string> FileMetadata { get { throw null; } set { } }
4242
public bool? FilePermissions { get { throw null; } set { } }
43+
public bool IsNfs { get { throw null; } set { } }
4344
public Azure.Storage.Files.Shares.Models.ShareFileRequestConditions SourceConditions { get { throw null; } set { } }
4445
}
4546
}

sdk/storage/Azure.Storage.DataMovement.Files.Shares/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.Files.Shares",
5-
"Tag": "net/storage/Azure.Storage.DataMovement.Files.Shares_e47ef7b37a"
5+
"Tag": "net/storage/Azure.Storage.DataMovement.Files.Shares_a13e75f487"
66
}

0 commit comments

Comments
 (0)