-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Compute] Update Compute client version to 23.0.0.
- Loading branch information
Showing
198 changed files
with
60,182 additions
and
22,778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file--> | ||
<PropertyGroup> | ||
<AzureApiTag>Compute_2018-06-01;Compute_2018-04-01;Compute_2017-09-01;ContainerService_2017-01-31;</AzureApiTag> | ||
<AzureApiTag>Compute_2018-10-01;Compute_2018-06-01;Compute_2017-09-01;ContainerService_2017-01-31;</AzureApiTag> | ||
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
src/SDKs/Compute/Compute.Tests/DiskRPTests/DiskRPUltraSSDTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
using System.Net; | ||
using Microsoft.Azure.Management.Compute; | ||
using Microsoft.Azure.Management.Compute.Models; | ||
using Microsoft.Azure.Management.ResourceManager; | ||
using Microsoft.Azure.Management.ResourceManager.Models; | ||
using Microsoft.Rest.Azure; | ||
using Microsoft.Rest.ClientRuntime.Azure.TestFramework; | ||
using Xunit; | ||
using System.Collections.Generic; | ||
|
||
namespace Compute.Tests.DiskRPTests | ||
{ | ||
public class DiskRPUltraSSDTests : DiskRPTestsBase | ||
{ | ||
//direct drive is only enabled in eastus2euap | ||
private static string DiskRPLocation = "eastus2euap"; | ||
|
||
[Fact] | ||
public void UltraSSD_CRUD_EmptyDisk() | ||
{ | ||
using (MockContext context = MockContext.Start(this.GetType().FullName)) | ||
{ | ||
EnsureClientsInitialized(context); | ||
|
||
// Data | ||
var rgName = TestUtilities.GenerateName(TestPrefix); | ||
var diskName = TestUtilities.GenerateName(DiskNamePrefix); | ||
Disk disk = GenerateBaseDisk("Empty"); | ||
disk.Sku = new DiskSku | ||
{ | ||
Name = DiskStorageAccountTypes.UltraSSDLRS | ||
}; | ||
disk.DiskSizeGB = 256; | ||
disk.Zones = new List<string> { "3" }; | ||
disk.DiskMBpsReadWrite = 8; | ||
disk.DiskIOPSReadWrite = 500; | ||
|
||
try | ||
{ | ||
m_ResourcesClient.ResourceGroups.CreateOrUpdate(rgName, new ResourceGroup { Location = DiskRPLocation }); | ||
|
||
// Put | ||
Disk diskOut = m_CrpClient.Disks.CreateOrUpdate(rgName, diskName, disk); | ||
Validate(disk, diskOut, DiskRPLocation); | ||
|
||
// Get | ||
diskOut = m_CrpClient.Disks.Get(rgName, diskName); | ||
Validate(disk, diskOut, DiskRPLocation); | ||
|
||
// Patch | ||
const string tagKey = "tagKey"; | ||
var updatedisk = new DiskUpdate(); | ||
updatedisk.Tags = new Dictionary<string, string>() { { tagKey, "tagValue" } }; | ||
updatedisk.DiskMBpsReadWrite = 9; | ||
updatedisk.DiskIOPSReadWrite = 600; | ||
diskOut = m_CrpClient.Disks.Update(rgName, diskName, updatedisk); | ||
Validate(disk, diskOut, DiskRPLocation, update : true); | ||
Assert.Equal(updatedisk.DiskIOPSReadWrite, diskOut.DiskIOPSReadWrite); | ||
Assert.Equal(updatedisk.DiskMBpsReadWrite, diskOut.DiskMBpsReadWrite); | ||
|
||
// Get | ||
diskOut = m_CrpClient.Disks.Get(rgName, diskName); | ||
Validate(disk, diskOut, DiskRPLocation, update: true); | ||
Assert.Equal(updatedisk.DiskIOPSReadWrite, diskOut.DiskIOPSReadWrite); | ||
Assert.Equal(updatedisk.DiskMBpsReadWrite, diskOut.DiskMBpsReadWrite); | ||
|
||
// Delete | ||
m_CrpClient.Disks.Delete(rgName, diskName); | ||
|
||
try | ||
{ | ||
// Ensure it was really deleted | ||
m_CrpClient.Disks.Get(rgName, diskName); | ||
Assert.False(true); | ||
} | ||
catch (CloudException ex) | ||
{ | ||
Assert.Equal(HttpStatusCode.NotFound, ex.Response.StatusCode); | ||
} | ||
} | ||
finally | ||
{ | ||
// Delete resource group | ||
m_ResourcesClient.ResourceGroups.Delete(rgName); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.