Skip to content

Commit ec2450e

Browse files
committed
Update Dataplane to 16.3.1
1 parent 3ae72a3 commit ec2450e

24 files changed

+283
-661
lines changed

src/Batch/Batch.Test/Batch.Test.csproj

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<PsModuleName>Batch</PsModuleName>
@@ -13,8 +13,8 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.Azure.Batch" Version="16.2.0" />
17-
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
16+
<PackageReference Include="Microsoft.Azure.Batch" Version="16.3.1" />
17+
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
1818
</ItemGroup>
1919

2020
<ItemGroup>
@@ -29,5 +29,15 @@
2929
<ItemGroup>
3030
<ProjectReference Include="..\..\Network\Network.Management.Sdk\Network.Management.Sdk.csproj" />
3131
</ItemGroup>
32+
33+
<ItemGroup>
34+
<PackageReference Update="Azure.Core" Version="1.48.0" />
35+
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.14.1" />
36+
<PackageReference Update="Newtonsoft.Json" Version="13.0.4" />
37+
<PackageReference Update="xunit.runner.visualstudio" Version="3.1.4">
38+
<PrivateAssets>all</PrivateAssets>
39+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
40+
</PackageReference>
41+
</ItemGroup>
3242

3343
</Project>

src/Batch/Batch.Test/BatchTestHelpers.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -842,17 +842,6 @@ public static AzureOperationResponse<
842842
return response;
843843
}
844844

845-
/// <summary>
846-
/// Builds a NodeFileGetPropertiesResponse object
847-
/// </summary>
848-
public static AzureOperationResponse<Stream, ProxyModels.ComputeNodeGetRemoteDesktopHeaders> CreateGetRemoteDesktOperationResponse()
849-
{
850-
var response = new AzureOperationResponse<Stream, ProxyModels.ComputeNodeGetRemoteDesktopHeaders>();
851-
response.Headers = new ProxyModels.ComputeNodeGetRemoteDesktopHeaders();
852-
response.Body = new MemoryStream();
853-
return response;
854-
}
855-
856845
/// <summary>
857846
/// Builds a NodeFileGetPropertiesFromTaskResponse object
858847
/// </summary>

src/Batch/Batch.Test/Files/GetBatchRemoteDesktopProtocolFileCommandTests.cs

Lines changed: 0 additions & 85 deletions
This file was deleted.

src/Batch/Batch.Test/Jobs/NewBatchJobCommandTests.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,15 @@ public void NewBatchJobPoolUserAccountsGetPassedToRequest()
181181
PoolLifetimeOption = Azure.Batch.Common.PoolLifetimeOption.Job,
182182
PoolSpecification = new PSPoolSpecification
183183
{
184-
CloudServiceConfiguration = new PSCloudServiceConfiguration("4", "*"),
184+
VirtualMachineConfiguration = new PSVirtualMachineConfiguration(
185+
new PSImageReference
186+
{
187+
Publisher = "Canonical",
188+
Offer = "UbuntuServer",
189+
Sku = "18.04-LTS",
190+
Version = "latest"
191+
},
192+
"batch.node.ubuntu 18.04"),
185193
UserAccounts = new List<PSUserAccount>() { adminUser, nonAdminUser, sshUser }
186194
}
187195
}

src/Batch/Batch.Test/Pools/GetBatchPoolNodeCountsCommandTests.cs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ public void WhenGetBatchPoolNodeCountsCommandIsCalledWithoutFilter_ShouldReturnA
7575
unusable: 12,
7676
waitingForStartTask: 13,
7777
total: 91,
78-
upgradingOS: 1), // Total
78+
upgradingOS: 1,
79+
deallocated: 1,
80+
deallocating: 1), // Total
7981
LowPriority = new ProxyModels.NodeCounts(
8082
creating: 1,
8183
idle: 2,
@@ -91,7 +93,9 @@ public void WhenGetBatchPoolNodeCountsCommandIsCalledWithoutFilter_ShouldReturnA
9193
unusable: 12,
9294
waitingForStartTask: 13,
9395
total: 91,
94-
upgradingOS: 1), // Total
96+
upgradingOS: 1,
97+
deallocated: 1,
98+
deallocating: 1), // Total
9599
};
96100

97101
var poolNodeCounts2 = new ProxyModels.PoolNodeCounts()
@@ -112,7 +116,9 @@ public void WhenGetBatchPoolNodeCountsCommandIsCalledWithoutFilter_ShouldReturnA
112116
unusable: 22,
113117
waitingForStartTask: 23,
114118
total: 221,
115-
upgradingOS: 1), // Total
119+
upgradingOS: 1,
120+
deallocated: 1,
121+
deallocating: 1), // Total
116122
LowPriority = new ProxyModels.NodeCounts(
117123
creating: 11,
118124
idle: 12,
@@ -128,7 +134,9 @@ public void WhenGetBatchPoolNodeCountsCommandIsCalledWithoutFilter_ShouldReturnA
128134
unusable: 22,
129135
waitingForStartTask: 23,
130136
total: 221,
131-
upgradingOS: 1), // Total
137+
upgradingOS: 1,
138+
deallocated: 1,
139+
deallocating: 1), // Total
132140
};
133141

134142
// Simulate node state counts for two pools are returned
@@ -251,6 +259,8 @@ public void WhenPSNodeCountsFormatObjectIsCalled_ShouldSerlializeNodeCountsToStr
251259
const int waitingForStartTask = 13;
252260
const int total = 91;
253261
const int upgradingOS = 1;
262+
const int deallocated = 1;
263+
const int deallocating = 1;
254264

255265
var poolNodeCounts = new ProxyModels.PoolNodeCounts()
256266
{
@@ -271,7 +281,9 @@ public void WhenPSNodeCountsFormatObjectIsCalled_ShouldSerlializeNodeCountsToStr
271281
unusable: unusable,
272282
waitingForStartTask: waitingForStartTask,
273283
total: total,
274-
upgradingOS: upgradingOS), // Total
284+
upgradingOS: upgradingOS,
285+
deallocated: deallocated,
286+
deallocating: deallocating), // Total
275287
// all zero properties
276288
LowPriority = new ProxyModels.NodeCounts(
277289
creating: 0,
@@ -288,7 +300,9 @@ public void WhenPSNodeCountsFormatObjectIsCalled_ShouldSerlializeNodeCountsToStr
288300
unusable: 0,
289301
waitingForStartTask: 0,
290302
total: 0,
291-
upgradingOS: 0), // Total
303+
upgradingOS: 0,
304+
deallocated: 0,
305+
deallocating: 0), // Total
292306
};
293307

294308
BatchAccountContext context = BatchTestHelpers.CreateBatchContextWithKeys();

src/Batch/Batch.Test/Pools/NewBatchPoolCommandTests.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public void NewBatchPoolParametersGetPassedToRequestTest()
9191
Visibility = Azure.Batch.Common.CertificateVisibility.StartTask
9292
}
9393
};
94-
cmdlet.CloudServiceConfiguration = new PSCloudServiceConfiguration("4", "*");
9594
cmdlet.DisplayName = "display name";
9695
cmdlet.InterComputeNodeCommunicationEnabled = true;
9796
cmdlet.TaskSlotsPerNode = 4;
@@ -138,14 +137,11 @@ public void NewBatchPoolParametersGetPassedToRequestTest()
138137
cmdlet.ExecuteCmdlet();
139138

140139
// Verify the request parameters match the cmdlet parameters
141-
Assert.Equal(cmdlet.ApplicationLicenses[0], requestParameters.ApplicationLicenses[0]);
142-
Assert.Equal(cmdlet.ApplicationLicenses[1], requestParameters.ApplicationLicenses[1]);
143140
Assert.Equal(cmdlet.CertificateReferences.Length, requestParameters.CertificateReferences.Count);
144141
Assert.Equal(cmdlet.CertificateReferences[0].StoreName, requestParameters.CertificateReferences[0].StoreName);
145142
Assert.Equal(cmdlet.CertificateReferences[0].Thumbprint, requestParameters.CertificateReferences[0].Thumbprint);
146143
Assert.Equal(cmdlet.CertificateReferences[0].ThumbprintAlgorithm, requestParameters.CertificateReferences[0].ThumbprintAlgorithm);
147-
Assert.Equal(cmdlet.CloudServiceConfiguration.OSFamily, requestParameters.CloudServiceConfiguration.OsFamily);
148-
Assert.Equal(cmdlet.CloudServiceConfiguration.OSVersion, requestParameters.CloudServiceConfiguration.OsVersion);
144+
Assert.Equal(cmdlet.VirtualMachineConfiguration.ImageReference.Version, requestParameters.VirtualMachineConfiguration.ImageReference.Version);
149145
Assert.Equal(cmdlet.DisplayName, requestParameters.DisplayName);
150146
Assert.Equal(cmdlet.InterComputeNodeCommunicationEnabled, requestParameters.EnableInterNodeCommunication);
151147
Assert.Equal(cmdlet.TaskSlotsPerNode, requestParameters.TaskSlotsPerNode);
@@ -263,7 +259,7 @@ public void NewBatchPoolUserAccountsGetPassedToRequest()
263259
cmdlet.BatchContext = context;
264260

265261
cmdlet.Id = "testPool";
266-
cmdlet.CloudServiceConfiguration = new PSCloudServiceConfiguration("4", "*");
262+
cmdlet.VirtualMachineConfiguration = new PSVirtualMachineConfiguration(new PSImageReference("offer", "publisher", "sku"), "node agent");
267263
cmdlet.TargetDedicatedComputeNodes = 3;
268264

269265
PSUserAccount adminUser = new PSUserAccount("admin", "password1", Azure.Batch.Common.ElevationLevel.Admin);

src/Batch/Batch.Test/ScenarioTests/ScenarioTestHelpers.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
using BatchAccountKeys = Microsoft.Azure.Management.Batch.Models.BatchAccountKeys;
3939
using ApplicationPackage = Microsoft.Azure.Management.Batch.Models.ApplicationPackage;
4040
using System.Security.Policy;
41+
using System.Management.Automation;
4142

4243

4344
namespace Microsoft.Azure.Commands.Batch.Test.ScenarioTests
@@ -215,12 +216,12 @@ public static void CreateTestPool(
215216
psUpgradePolicy = new PSUpgradePolicy(upgradePolicy);
216217
}
217218

218-
PSCloudServiceConfiguration paasConfiguration = new PSCloudServiceConfiguration("4", "*");
219-
219+
PSVirtualMachineConfiguration virtualMachineConfiguration = new PSVirtualMachineConfiguration(new PSImageReference("offer", "publisher", "sku"), "node agent");
220+
220221
NewPoolParameters parameters = new NewPoolParameters(context, poolId)
221222
{
222223
VirtualMachineSize = "standard_d1_v2",
223-
CloudServiceConfiguration = paasConfiguration,
224+
VirtualMachineConfiguration = virtualMachineConfiguration,
224225
TargetDedicatedComputeNodes = targetDedicated,
225226
TargetLowPriorityComputeNodes = targetLowPriority,
226227
CertificateReferences = certReferences,
@@ -510,7 +511,7 @@ public static PSCloudJob WaitForJobCompletion(BatchTestRunner runner, BatchAccou
510511

511512
DateTime timeout = DateTime.Now.AddMinutes(10);
512513

513-
while (job.State != JobState.Completed && DateTime.Now < timeout)
514+
while (job.State != Azure.Batch.Common.JobState.Completed && DateTime.Now < timeout)
514515
{
515516
job = client.ListJobs(new ListJobOptions(context)).First(cloudJob => cloudJob.Id == jobId);
516517

src/Batch/Batch/Batch.csproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<PsModuleName>Batch</PsModuleName>
@@ -12,8 +12,8 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.Azure.Batch" Version="16.2.0" />
16-
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
15+
<PackageReference Include="Microsoft.Azure.Batch" Version="16.3.1" />
16+
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
1717
</ItemGroup>
1818

1919
<ItemGroup>
@@ -26,6 +26,12 @@
2626
</Compile>
2727
</ItemGroup>
2828

29+
<ItemGroup>
30+
<PackageReference Update="Azure.Core" Version="1.48.0" />
31+
<PackageReference Update="Microsoft.ApplicationInsights" Version="2.23.0" />
32+
<PackageReference Update="PowerShellStandard.Library" Version="5.1.1" />
33+
</ItemGroup>
34+
2935
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />
3036

3137
</Project>

src/Batch/Batch/Files/GetBatchRemoteDesktopProtocolFileCommand.cs

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)