Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
Provides developers with libraries for the updated compute platform under Azure Resource manager to deploy virtual machine, virtual machine extensions and availability set management capabilities. Launch, restart, scale, capture and manage VMs, VM Extensions and more. Note: This client library is for Virtual Machines under Azure Resource Manager.
Development of this library has shifted focus to the Azure Unified SDK. The future development will be focused on "Azure.ResourceManager.Compute" (https://www.nuget.org/packages/Azure.ResourceManager.Compute/). Please see the package changelog for more information.
</Description>
<Version>38.1.0.0</Version>
<Version>38.1.0</Version>
<AssemblyName>Microsoft.Azure.Management.Compute</AssemblyName>
<PackageTags>management;virtual machine;compute;</PackageTags>
<PackageReleaseNotes>
<![CDATA[
This is a public release of the Azure Compute SDK. Included with this release is the vmHealth property added to the VMInstanceView API.
This is a public release of the Azure Compute SDK. Included with this release is
1. The vmHealth property added to the VMInstanceView API.
2. The patch status is added to the VMInstanceView API.
]]>
</PackageReleaseNotes>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using Compute.Tests;
using Microsoft.Azure.Management.Compute.Models;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;

namespace Microsoft.Azure.Management.Compute.Tests.ScenarioTests
{
public class VMInstanceViewPatchStatusTests : VMTestBase
{
private const string RgName = "PatchStatusRg";
private const string VmName = "testVm";

//How to re-record this test:
// 1. Manually create Resource group and VM
// update the constants for RgName and VmName
// 2. invoke CRP install patch api
// 3. Then run this test
[Fact()]
public void GetVMInstanceViewWithPatchStatus()
{
using (MockContext context = MockContext.Start(this.GetType()))
{
EnsureClientsInitialized(context);
VirtualMachineInstanceView vmInstanceView = m_CrpClient.VirtualMachines.InstanceView(RgName, VmName);

Assert.NotNull(vmInstanceView);
Assert.NotNull(vmInstanceView.PatchStatus);
Assert.NotNull(vmInstanceView.PatchStatus.AvailablePatchSummary);
Assert.Equal(0, vmInstanceView.PatchStatus.AvailablePatchSummary.CriticalAndSecurityPatchCount);
Assert.Equal(1, vmInstanceView.PatchStatus.AvailablePatchSummary.OtherPatchCount);
Assert.True(vmInstanceView.PatchStatus.AvailablePatchSummary.RebootPending);
Assert.NotNull(vmInstanceView.PatchStatus.AvailablePatchSummary.StartTime);
Assert.NotNull(vmInstanceView.PatchStatus.AvailablePatchSummary.LastModifiedTime);
Assert.NotNull(vmInstanceView.PatchStatus.AvailablePatchSummary.AssessmentActivityId);
Assert.NotNull(vmInstanceView.PatchStatus.LastPatchInstallationSummary);
Assert.Equal("Succeeded", vmInstanceView.PatchStatus.LastPatchInstallationSummary.Status);
Assert.Equal(0, vmInstanceView.PatchStatus.LastPatchInstallationSummary.ExcludedPatchCount);
Assert.Equal(0, vmInstanceView.PatchStatus.LastPatchInstallationSummary.FailedPatchCount);
Assert.Equal(0, vmInstanceView.PatchStatus.LastPatchInstallationSummary.NotSelectedPatchCount);
Assert.Equal(2, vmInstanceView.PatchStatus.LastPatchInstallationSummary.InstalledPatchCount);
Assert.Equal(0, vmInstanceView.PatchStatus.LastPatchInstallationSummary.PendingPatchCount);
Assert.NotNull(vmInstanceView.PatchStatus.LastPatchInstallationSummary.InstallationActivityId);
//Assert.False(vmInstanceView.PatchStatus.LastPatchInstallationSummary.MaintenanceWindowExceeded);
Assert.NotNull(vmInstanceView.PatchStatus.LastPatchInstallationSummary.StartTime);
Assert.NotNull(vmInstanceView.PatchStatus.LastPatchInstallationSummary.LastModifiedTime);

//Assert.NotNull(vmInstanceView.PatchStatus.ConfigurationStatusSummary);
//Assert.NotNull(vmInstanceView.PatchStatus.ConfigurationStatusSummary.LastModifiedTime);
//Assert.Equal("Ready", vmInstanceView.PatchStatus.ConfigurationStatusSummary.PatchModeProvisioningState);
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.