Skip to content

Commit 948981f

Browse files
Common.Compute switched to TestFramework
1 parent 92bdf2f commit 948981f

File tree

7 files changed

+372
-27
lines changed

7 files changed

+372
-27
lines changed

src/Common/Commands.Common.Compute.Tests/Commands.Common.Compute.Tests.csproj

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,39 @@
3434
<WarningLevel>4</WarningLevel>
3535
</PropertyGroup>
3636
<ItemGroup>
37+
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
38+
<SpecificVersion>False</SpecificVersion>
39+
<HintPath>..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.8.1\lib\net452\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
40+
<Private>True</Private>
41+
</Reference>
3742
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
3843
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
3944
<Private>True</Private>
4045
</Reference>
4146
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4247
<SpecificVersion>False</SpecificVersion>
43-
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.2.3.11\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
48+
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.2.3.7\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
4449
<Private>True</Private>
4550
</Reference>
4651
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4752
<SpecificVersion>False</SpecificVersion>
4853
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.12\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
4954
<Private>True</Private>
5055
</Reference>
56+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
57+
<SpecificVersion>False</SpecificVersion>
58+
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.3.0\lib\net452\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
59+
<Private>True</Private>
60+
</Reference>
61+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework">
62+
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.7.2\lib\net452\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
63+
<Private>True</Private>
64+
</Reference>
65+
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
66+
<SpecificVersion>False</SpecificVersion>
67+
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
68+
<Private>True</Private>
69+
</Reference>
5170
<Reference Include="System" />
5271
<Reference Include="System.Core" />
5372
<Reference Include="System.Net.Http" />
@@ -90,6 +109,18 @@
90109
</ItemGroup>
91110
<ItemGroup>
92111
<None Include="packages.config" />
112+
<None Include="SessionRecords\Microsoft.Azure.Commands.Common.Compute.Tests.Version2016_04_preview.ComputeManagementClientShould\ListDisks.json">
113+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
114+
</None>
115+
<None Include="SessionRecords\Microsoft.Azure.Commands.Common.Compute.Tests.Version2016_04_preview.ComputeManagementClientShould\ListVirtualMachine.json">
116+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
117+
</None>
118+
<None Include="SessionRecords\Microsoft.Azure.Commands.Common.Compute.Tests.Version2016_04_preview.ComputeManagementClientShould\ListVirtualMachineImagePublishers.json">
119+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
120+
</None>
121+
<None Include="SessionRecords\Microsoft.Azure.Commands.Common.Compute.Tests.Version2016_04_preview.ComputeManagementClientShould\ListVirtualMachineSizes.json">
122+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
123+
</None>
93124
</ItemGroup>
94125
<ItemGroup>
95126
<Analyzer Include="..\..\packages\xunit.analyzers.0.7.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/providers/Microsoft.Compute/disks?api-version=2016-04-30-preview",
5+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9kaXNrcz9hcGktdmVyc2lvbj0yMDE2LTA0LTMwLXByZXZpZXc=",
6+
"RequestMethod": "GET",
7+
"RequestBody": "",
8+
"RequestHeaders": {
9+
"x-ms-client-request-id": [
10+
"a99916df-037b-48a0-9535-4ff28b5d5815"
11+
],
12+
"accept-language": [
13+
"en-US"
14+
],
15+
"User-Agent": [
16+
"FxVersion/4.7.3110.0",
17+
"OSName/Windows10Enterprise",
18+
"OSVersion/6.3.17134",
19+
"Microsoft.Azure.Commands.Common.Compute.Version2016_04_preview.ComputeManagementClient/1.0.0.0"
20+
]
21+
},
22+
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"accountType\": \"Standard_LRS\",\r\n \"osType\": \"Windows\",\r\n \"creationData\": {\r\n \"createOption\": \"FromImage\",\r\n \"imageReference\": {\r\n \"id\": \"/Subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/Providers/Microsoft.Compute/Locations/eastus2/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2008-R2-SP1/Versions/2.127.20170628\"\r\n }\r\n },\r\n \"diskSizeGB\": 127,\r\n \"timeCreated\": \"2018-07-11T12:20:46.928697-07:00\",\r\n \"ownerId\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/crptestps7596/providers/Microsoft.Compute/virtualMachines/vmcrptestps7596\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Attached\"\r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"eastus2\",\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/CRPTESTPS7596/providers/Microsoft.Compute/disks/vmcrptestps7596_OsDisk_1_978dd480e37c4bacb0d31416324bf793\",\r\n \"name\": \"vmcrptestps7596_OsDisk_1_978dd480e37c4bacb0d31416324bf793\"\r\n },\r\n {\r\n \"properties\": {\r\n \"accountType\": \"Premium_LRS\",\r\n \"osType\": \"Linux\",\r\n \"creationData\": {\r\n \"createOption\": \"FromImage\",\r\n \"imageReference\": {\r\n \"id\": \"/Subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/Providers/Microsoft.Compute/Locations/westus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/16.04-LTS/Versions/16.04.201807030\"\r\n }\r\n },\r\n \"diskSizeGB\": 30,\r\n \"timeCreated\": \"2018-07-11T11:30:39.3771097-07:00\",\r\n \"ownerId\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/tjp-rg/providers/Microsoft.Compute/virtualMachines/vm1\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Attached\"\r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/TJP-RG/providers/Microsoft.Compute/disks/vm1_OsDisk_1_59e4de3d8570465985cb158dc5fc5492\",\r\n \"name\": \"vm1_OsDisk_1_59e4de3d8570465985cb158dc5fc5492\"\r\n }\r\n ]\r\n}",
23+
"ResponseHeaders": {
24+
"Content-Length": [
25+
"1803"
26+
],
27+
"Content-Type": [
28+
"application/json; charset=utf-8"
29+
],
30+
"Expires": [
31+
"-1"
32+
],
33+
"Pragma": [
34+
"no-cache"
35+
],
36+
"x-ms-original-request-ids": [
37+
"34f04a89-7957-4db4-b050-ed7bd92bd4d2",
38+
"faa58b26-5fa4-4255-a9dc-854f4c4e86d6"
39+
],
40+
"x-ms-ratelimit-remaining-subscription-reads": [
41+
"14999"
42+
],
43+
"x-ms-request-id": [
44+
"32f6cbf6-80c3-4352-b0fd-02dffd2cb476"
45+
],
46+
"x-ms-correlation-request-id": [
47+
"32f6cbf6-80c3-4352-b0fd-02dffd2cb476"
48+
],
49+
"x-ms-routing-request-id": [
50+
"WESTUS2:20180711T192723Z:32f6cbf6-80c3-4352-b0fd-02dffd2cb476"
51+
],
52+
"Strict-Transport-Security": [
53+
"max-age=31536000; includeSubDomains"
54+
],
55+
"X-Content-Type-Options": [
56+
"nosniff"
57+
],
58+
"Cache-Control": [
59+
"no-cache"
60+
],
61+
"Date": [
62+
"Wed, 11 Jul 2018 19:27:22 GMT"
63+
]
64+
},
65+
"StatusCode": 200
66+
}
67+
],
68+
"Names": {},
69+
"Variables": {
70+
"SubscriptionId": "c9cbd920-c00c-427c-852b-8aaf38badaeb"
71+
}
72+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/providers/Microsoft.Compute/virtualMachines?api-version=2016-04-30-preview",
5+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS92aXJ0dWFsTWFjaGluZXM/YXBpLXZlcnNpb249MjAxNi0wNC0zMC1wcmV2aWV3",
6+
"RequestMethod": "GET",
7+
"RequestBody": "",
8+
"RequestHeaders": {
9+
"x-ms-client-request-id": [
10+
"96f4af86-d1b0-4a99-a6f5-0af7f54dc28b"
11+
],
12+
"accept-language": [
13+
"en-US"
14+
],
15+
"User-Agent": [
16+
"FxVersion/4.7.3110.0",
17+
"OSName/Windows10Enterprise",
18+
"OSVersion/6.3.17134",
19+
"Microsoft.Azure.Commands.Common.Compute.Version2016_04_preview.ComputeManagementClient/1.0.0.0"
20+
]
21+
},
22+
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"vmId\": \"101b7f2e-e501-4de3-94f6-80d050b571c5\",\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_A4\"\r\n },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"WindowsServer\",\r\n \"sku\": \"2008-R2-SP1\",\r\n \"version\": \"2.127.20170628\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \"name\": \"vmcrptestps7596_OsDisk_1_978dd480e37c4bacb0d31416324bf793\",\r\n \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/crptestps7596/providers/Microsoft.Compute/disks/vmcrptestps7596_OsDisk_1_978dd480e37c4bacb0d31416324bf793\"\r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"test\",\r\n \"adminUsername\": \"Foo12\",\r\n \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\": false\r\n },\r\n \"secrets\": []\r\n },\r\n \"networkProfile\": {\r\n \"networkInterfaces\": [\r\n {\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/crptestps7596/providers/Microsoft.Network/networkInterfaces/niccrptestps7596\",\r\n \"properties\": {\r\n \"primary\": true\r\n }\r\n }\r\n ]\r\n },\r\n \"diagnosticsProfile\": {\r\n \"bootDiagnostics\": {\r\n \"enabled\": true,\r\n \"storageUri\": \"https://stocrptestps7596.blob.core.windows.net/\"\r\n }\r\n },\r\n \"provisioningState\": \"Updating\"\r\n },\r\n \"resources\": [\r\n {\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/CRPTESTPS7596/providers/Microsoft.Compute/virtualMachines/vmcrptestps7596/extensions/BGInfo\"\r\n }\r\n ],\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"eastus2\",\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/CRPTESTPS7596/providers/Microsoft.Compute/virtualMachines/vmcrptestps7596\",\r\n \"name\": \"vmcrptestps7596\"\r\n },\r\n {\r\n \"properties\": {\r\n \"vmId\": \"445871d2-a782-41f4-bc1f-c25bd029924c\",\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": \"Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\": \"16.04-LTS\",\r\n \"version\": \"latest\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": \"vm1_OsDisk_1_59e4de3d8570465985cb158dc5fc5492\",\r\n \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/tjp-rg/providers/Microsoft.Compute/disks/vm1_OsDisk_1_59e4de3d8570465985cb158dc5fc5492\"\r\n },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"vm1\",\r\n \"adminUsername\": \"trpresco\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n \"path\": \"/home/trpresco/.ssh/authorized_keys\",\r\n \"keyData\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLkUy/BFb7o47gQqFcMiioYD4w3Tu/7bpy7t/3pQVhjmsEEaWk09dA1Ju1UbukKaLpOprch/r9bgUWu1oTEP7E5evwaJl0TvLX0gsxGGItfPc58bbQ77uxuXhMfYEZ6oiS+Ybt5nUjjDUUNhSIrKSLhCHCmQ9JnOd/AObf9G4iR38bsABIAVxmbYT6OQKm4oRwNs1c99B5TsfnREFs7yawCV3hjKVHsD3bRo83bBbBG3d/CHYfcnEbpK4weagw899YodAXDiUh0qYfOy0mGz4zWaQ4rcCitk9od/WSDhLAOy74cqwzKJwoR9DcALxkWVMuJW7xBF9tWEroVvFrh6/N\"\r\n }\r\n ]\r\n }\r\n },\r\n \"secrets\": []\r\n },\r\n \"networkProfile\": {\r\n \"networkInterfaces\": [\r\n {\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/tjp-rg/providers/Microsoft.Network/networkInterfaces/vm1VMNic\"\r\n }\r\n ]\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/TJP-RG/providers/Microsoft.Compute/virtualMachines/vm1\",\r\n \"name\": \"vm1\"\r\n }\r\n ]\r\n}",
23+
"ResponseHeaders": {
24+
"Content-Length": [
25+
"3252"
26+
],
27+
"Content-Type": [
28+
"application/json; charset=utf-8"
29+
],
30+
"Expires": [
31+
"-1"
32+
],
33+
"Pragma": [
34+
"no-cache"
35+
],
36+
"x-ms-original-request-ids": [
37+
"b0656306-378b-4782-bb7f-58957e8c94fb",
38+
"7538a576-d3c7-4795-a506-eca731f4c0af"
39+
],
40+
"x-ms-ratelimit-remaining-subscription-reads": [
41+
"14999"
42+
],
43+
"x-ms-request-id": [
44+
"7a408ec4-7c80-4507-88e0-df04def5605c"
45+
],
46+
"x-ms-correlation-request-id": [
47+
"7a408ec4-7c80-4507-88e0-df04def5605c"
48+
],
49+
"x-ms-routing-request-id": [
50+
"WESTUS2:20180711T192729Z:7a408ec4-7c80-4507-88e0-df04def5605c"
51+
],
52+
"Strict-Transport-Security": [
53+
"max-age=31536000; includeSubDomains"
54+
],
55+
"X-Content-Type-Options": [
56+
"nosniff"
57+
],
58+
"Cache-Control": [
59+
"no-cache"
60+
],
61+
"Date": [
62+
"Wed, 11 Jul 2018 19:27:29 GMT"
63+
]
64+
},
65+
"StatusCode": 200
66+
}
67+
],
68+
"Names": {},
69+
"Variables": {
70+
"SubscriptionId": "c9cbd920-c00c-427c-852b-8aaf38badaeb"
71+
}
72+
}

src/Common/Commands.Common.Compute.Tests/SessionRecords/Microsoft.Azure.Commands.Common.Compute.Tests.Version2016_04_preview.ComputeManagementClientShould/ListVirtualMachineImagePublishers.json

Lines changed: 75 additions & 0 deletions
Large diffs are not rendered by default.

src/Common/Commands.Common.Compute.Tests/SessionRecords/Microsoft.Azure.Commands.Common.Compute.Tests.Version2016_04_preview.ComputeManagementClientShould/ListVirtualMachineSizes.json

Lines changed: 78 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)