// Verify restore point properties. // Verify disk exclusion by verifying that the returned restore point contains the id of the // excluded disk in 'ExcludeDisks' property and did not create diskRestorePoint // of the excluded data disk. // For RestorePoint created via cross-region copy scenario, sourceRestorePoint.Id is verified. // For GET instance view of RestorePoint created via cross-region copy scenario, instanceView is verified. void VerifyRestorePointDetails(RestorePoint restorePoint, string restorePointName, OSDisk osDisk, int excludeDisksCount, string excludeDiskId, string vmSize, bool isRemoteCopy = false, string sourceRestorePointId = null, bool isRemoteCopyInstanceView = false) { Assert.Equal(restorePointName, restorePoint.Name); Assert.NotNull(restorePoint.Id); Assert.Equal(ProvisioningState.Succeeded.ToString(), restorePoint.ProvisioningState); Assert.Equal(ConsistencyModeTypes.ApplicationConsistent, restorePoint.ConsistencyMode); RestorePointSourceVMStorageProfile storageProfile = restorePoint.SourceMetadata.StorageProfile; Assert.Equal(osDisk.Name, storageProfile.OsDisk.Name, ignoreCase: true); Assert.Equal(osDisk.ManagedDisk.Id, storageProfile.OsDisk.ManagedDisk.Id, ignoreCase: true); Assert.NotNull(restorePoint.SourceMetadata.VmId); Assert.Equal(vmSize, restorePoint.SourceMetadata.HardwareProfile.VmSize); if (isRemoteCopy) { Assert.Equal(sourceRestorePointId, restorePoint.SourceRestorePoint.Id); if (isRemoteCopyInstanceView) { RestorePointInstanceView restorePointInstanceView = restorePoint.InstanceView; Assert.NotNull(restorePointInstanceView); Assert.Equal(storageProfile.DataDisks.Count + 1, restorePointInstanceView.DiskRestorePoints.Count); Assert.NotNull(restorePointInstanceView.DiskRestorePoints[0].ReplicationStatus.CompletionPercent); } } else { Assert.Equal(excludeDisksCount, restorePoint.ExcludeDisks.Count); Assert.Equal(excludeDiskId, restorePoint.ExcludeDisks[0].Id, ignoreCase: true); } }
internal RestorePointSourceMetadata(HardwareProfile hardwareProfile, RestorePointSourceVMStorageProfile storageProfile, OSProfile osProfile, DiagnosticsProfile diagnosticsProfile, string licenseType, string vmId, SecurityProfile securityProfile, string location) { HardwareProfile = hardwareProfile; StorageProfile = storageProfile; OsProfile = osProfile; DiagnosticsProfile = diagnosticsProfile; LicenseType = licenseType; VmId = vmId; SecurityProfile = securityProfile; Location = location; }
// Verify restore point properties. // Verify disk exclusion by verifying that the returned restore point contains the id of the // excluded disk in 'ExcludeDisks' property and did not create diskRestorePoint // of the excluded data disk. void VerifyRestorePointDetails(RestorePoint restorePoint, string restorePointName, OSDisk osDisk, int excludeDisksCount, string excludeDiskId, string vmSize) { Assert.Equal(restorePointName, restorePoint.Name); Assert.NotNull(restorePoint.Id); Assert.Equal(ProvisioningState.Succeeded.ToString(), restorePoint.ProvisioningState); Assert.Equal(ConsistencyModeTypes.ApplicationConsistent, restorePoint.ConsistencyMode); RestorePointSourceVMStorageProfile storageProfile = restorePoint.SourceMetadata.StorageProfile; Assert.Equal(osDisk.Name, storageProfile.OsDisk.Name, ignoreCase: true); Assert.Equal(osDisk.ManagedDisk.Id, storageProfile.OsDisk.ManagedDisk.Id, ignoreCase: true); Assert.Equal(excludeDisksCount, restorePoint.ExcludeDisks.Count); Assert.Equal(excludeDiskId, restorePoint.ExcludeDisks[0].Id, ignoreCase: true); Assert.NotNull(restorePoint.SourceMetadata.VmId); Assert.Equal(vmSize, restorePoint.SourceMetadata.HardwareProfile.VmSize); }