Skip to content

Commit d62b66d

Browse files
committed
Merge branch 'master' of github.com:/azure/azure-powershell into net472tests
2 parents e24b2ec + 9f4a6a5 commit d62b66d

File tree

41 files changed

+12717
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+12717
-4
lines changed

src/Accounts/Authentication.Test/LongRunningCmdletTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,20 @@ public void CanHandleShouldProcessExceptionForConfirm()
144144
});
145145
}
146146

147+
[Fact]
148+
[Trait(Category.AcceptanceType, Category.CheckIn)]
149+
public void CanHandleConfirmSetToFalse()
150+
{
151+
Mock<ICommandRuntime> mockRuntime;
152+
var cmdlet = SetupCmdlet(true, false, out mockRuntime);
153+
cmdlet.MyInvocation.BoundParameters["Confirm"] = new SwitchParameter(false);
154+
var job = cmdlet.ExecuteAsJob("Test Job") as AzureLongRunningJob<AzureStreamTestCmdlet>;
155+
WaitForCompletion(job, j =>
156+
{
157+
ValidateCompletedCmdlet(job);
158+
});
159+
}
160+
147161
[Fact]
148162
[Trait(Category.AcceptanceType, Category.CheckIn)]
149163
public void CanHandleShouldProcessExceptionForWhatIf()

src/Cdn/Cdn/help/Az.Cdn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Cdn
3-
Module Guid: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
3+
Module Guid: 91832aaa-dc11-4583-8239-bce5fd531604
44
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.cdn
55
Help Version: 4.2.2.0
66
Locale: en-US
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<PsModuleName>GuestConfiguration</PsModuleName>
5+
</PropertyGroup>
6+
7+
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.Test.props" />
8+
9+
<PropertyGroup>
10+
<RootNamespace>$(LegacyAssemblyPrefix)$(PsModuleName)$(AzTestAssemblySuffix)</RootNamespace>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="Microsoft.Azure.Management.GuestConfiguration" Version="1.0.0" />
15+
</ItemGroup>
16+
17+
</Project>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Reflection;
17+
using System.Runtime.InteropServices;
18+
using Xunit;
19+
20+
[assembly: AssemblyTitle("Microsoft Azure Powershell - Guest Configuration Tests")]
21+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
22+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
23+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
24+
25+
[assembly: ComVisible(false)]
26+
[assembly: CLSCompliant(false)]
27+
[assembly: Guid("840516AC-34D7-4F12-925B-37509D240277")]
28+
29+
[assembly: AssemblyVersion("1.0.0")]
30+
[assembly: AssemblyFileVersion("1.0.0")]
31+
32+
[assembly: CollectionBehavior(DisableTestParallelization = true)]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Validates a string is not null or empty
18+
#>
19+
function Assert-NotNullOrEmpty
20+
{
21+
param([string]$value)
22+
23+
Assert-False { [string]::IsNullOrEmpty($value) }
24+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.ServiceManagement.Common.Models;
16+
17+
namespace Microsoft.Azure.Commands.GuestConfiguration.Test.ScenarioTests
18+
{
19+
using Microsoft.Azure.Commands.ScenarioTest;
20+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
21+
using Xunit;
22+
23+
24+
public class GetVmGuestPolicyReportTests
25+
{
26+
private readonly XunitTracingInterceptor _logger;
27+
28+
public GetVmGuestPolicyReportTests(Xunit.Abstractions.ITestOutputHelper output)
29+
{
30+
_logger = new XunitTracingInterceptor(output);
31+
XunitTracingInterceptor.AddToContext(_logger);
32+
TestExecutionHelpers.SetUpSessionAndProfile();
33+
}
34+
35+
[Fact]
36+
[Trait(Category.AcceptanceType, Category.CheckIn)]
37+
public void VmNameScope()
38+
{
39+
TestController.NewInstance.RunPowerShellTest(_logger, "Get-AzVMGuestPolicyReport-VmNameScope");
40+
}
41+
42+
[Fact]
43+
[Trait(Category.AcceptanceType, Category.CheckIn)]
44+
public void InitiativeIdScope()
45+
{
46+
TestController.NewInstance.RunPowerShellTest(_logger, "Get-AzVMGuestPolicyReport-InitiativeIdScope");
47+
}
48+
49+
[Fact]
50+
[Trait(Category.AcceptanceType, Category.CheckIn)]
51+
public void InitiativeNameScope()
52+
{
53+
TestController.NewInstance.RunPowerShellTest(_logger, "Get-AzVMGuestPolicyReport-InitiativeNameScope");
54+
}
55+
56+
[Fact]
57+
[Trait(Category.AcceptanceType, Category.CheckIn)]
58+
public void ReportIdScope()
59+
{
60+
TestController.NewInstance.RunPowerShellTest(_logger, "Get-AzVMGuestPolicyReport-ReportIdScope");
61+
}
62+
}
63+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Get guest configuration policy report by Vm name scope
18+
#>
19+
function Get-AzVMGuestPolicyReport-VmNameScope
20+
{
21+
$rgName = "vivga"
22+
$vmName = "vivga0"
23+
24+
$reports = Get-AzVMGuestPolicyReport -ResourceGroupName $rgName -VMName $vmName
25+
Assert-NotNull $reports
26+
Assert-True { $reports.Count -gt 0 }
27+
}
28+
29+
<#
30+
.SYNOPSIS
31+
Get guest configuration policy report by Initiative id scope
32+
#>
33+
function Get-AzVMGuestPolicyReport-InitiativeIdScope
34+
{
35+
$rgName = "vivga"
36+
$vmName = "vivga0"
37+
$initiativeId = "/providers/Microsoft.Authorization/policySetDefinitions/25ef9b72-4af2-4501-acd1-fc814e73dde1"
38+
39+
$reports = Get-AzVMGuestPolicyReport -ResourceGroupName $rgName -VMName $vmName -InitiativeId $initiativeId
40+
Assert-NotNull $reports
41+
Assert-True { $reports.Count -gt 0 }
42+
}
43+
44+
<#
45+
.SYNOPSIS
46+
Get guest configuration policy report by Initiative name scope
47+
#>
48+
function Get-AzVMGuestPolicyReport-InitiativeNameScope
49+
{
50+
$rgName = "vivga"
51+
$vmName = "vivga0"
52+
$initiativeName = "25ef9b72-4af2-4501-acd1-fc814e73dde1"
53+
54+
$reports = Get-AzVMGuestPolicyReport -ResourceGroupName $rgName -VMName $vmName -InitiativeName $initiativeName
55+
Assert-NotNull $reports
56+
Assert-True { $reports.Count -gt 0 }
57+
}
58+
59+
<#
60+
.SYNOPSIS
61+
Get guest configuration policy by reportId scope
62+
#>
63+
function Get-AzVMGuestPolicyReport-ReportIdScope
64+
{
65+
$rgName = "vivga"
66+
$vmName = "vivga0"
67+
$initiativeName = "25ef9b72-4af2-4501-acd1-fc814e73dde1"
68+
$reports = Get-AzVMGuestPolicyReport -ResourceGroupName $rgName -VMName $vmName -InitiativeName $initiativeName
69+
Assert-NotNull $reports
70+
Assert-True { $reports.Count -gt 0 }
71+
72+
$reportId= $reports[0].LatestReportId;
73+
74+
$report = Get-AzVMGuestPolicyReport -ReportId $reportId
75+
Assert-NotNull $report
76+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.ServiceManagement.Common.Models;
16+
17+
namespace Microsoft.Azure.Commands.GuestConfiguration.Test.ScenarioTests
18+
{
19+
using Microsoft.Azure.Commands.ScenarioTest;
20+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
21+
using Xunit;
22+
23+
24+
public class GetVmGuestPolicyStatusHistoryTests
25+
{
26+
private readonly XunitTracingInterceptor _logger;
27+
28+
public GetVmGuestPolicyStatusHistoryTests(Xunit.Abstractions.ITestOutputHelper output)
29+
{
30+
_logger = new XunitTracingInterceptor(output);
31+
XunitTracingInterceptor.AddToContext(_logger);
32+
TestExecutionHelpers.SetUpSessionAndProfile();
33+
}
34+
35+
[Fact]
36+
[Trait(Category.AcceptanceType, Category.CheckIn)]
37+
public void VmNameScope()
38+
{
39+
TestController.NewInstance.RunPowerShellTest(_logger, "Get-AzVMGuestPolicyStatusHistory-VmNameScope");
40+
}
41+
42+
[Fact]
43+
[Trait(Category.AcceptanceType, Category.CheckIn)]
44+
public void InitiativeIdScope()
45+
{
46+
TestController.NewInstance.RunPowerShellTest(_logger, "Get-AzVMGuestPolicyStatusHistory-InitiativeIdScope");
47+
}
48+
49+
[Fact]
50+
[Trait(Category.AcceptanceType, Category.CheckIn)]
51+
public void InitiativeNameScope()
52+
{
53+
TestController.NewInstance.RunPowerShellTest(_logger, "Get-AzVMGuestPolicyStatusHistory-InitiativeNameScope");
54+
}
55+
56+
[Fact]
57+
[Trait(Category.AcceptanceType, Category.CheckIn)]
58+
public void ShowOnlyChangeSwitchVmNameScope()
59+
{
60+
TestController.NewInstance.RunPowerShellTest(_logger, "Get-AzVMGuestPolicyStatusHistory-ShowOnlyChangeSwitch-VmNameScope");
61+
}
62+
}
63+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Get guest configuration policy status history by Vm name scope
18+
#>
19+
function Get-AzVMGuestPolicyStatusHistory-VmNameScope
20+
{
21+
$rgName = "vivga"
22+
$vmName = "vivga0"
23+
24+
$historicalStatuses = Get-AzVMGuestPolicyStatusHistory -ResourceGroupName $rgName -VMName $vmName
25+
Assert-NotNull $historicalStatuses
26+
Assert-True { $historicalStatuses.Count -gt 0 }
27+
}
28+
29+
<#
30+
.SYNOPSIS
31+
Get guest configuration policy status history by Initiative id scope
32+
#>
33+
function Get-AzVMGuestPolicyStatusHistory-InitiativeIdScope
34+
{
35+
$rgName = "vivga"
36+
$vmName = "vivga0"
37+
$initiativeId = "/providers/Microsoft.Authorization/policySetDefinitions/25ef9b72-4af2-4501-acd1-fc814e73dde1"
38+
39+
$historicalStatuses = Get-AzVMGuestPolicyStatusHistory -ResourceGroupName $rgName -VMName $vmName -InitiativeId $initiativeId
40+
Assert-NotNull $historicalStatuses
41+
Assert-True { $historicalStatuses.Count -gt 0 }
42+
}
43+
44+
<#
45+
.SYNOPSIS
46+
Get guest configuration policy status history by Initiative name scope
47+
#>
48+
function Get-AzVMGuestPolicyStatusHistory-InitiativeNameScope
49+
{
50+
$rgName = "vivga"
51+
$vmName = "vivga0"
52+
$initiativeName = "25ef9b72-4af2-4501-acd1-fc814e73dde1"
53+
54+
$historicalStatuses = Get-AzVMGuestPolicyStatusHistory -ResourceGroupName $rgName -VMName $vmName -InitiativeName $initiativeName
55+
Assert-NotNull $historicalStatuses
56+
Assert-True { $historicalStatuses.Count -gt 0 }
57+
}
58+
59+
<#
60+
.SYNOPSIS
61+
Get guest configuration policy by vmName scope, using ShowOnlyChange switch
62+
#>
63+
function Get-AzVMGuestPolicyStatusHistory-ShowOnlyChangeSwitch-VmNameScope
64+
{
65+
$rgName = "vivga"
66+
$vmName = "vivga0"
67+
68+
$historicalStatuses = Get-AzVMGuestPolicyStatusHistory -ResourceGroupName $rgName -VMName $vmName -ShowOnlyChange
69+
Assert-NotNull $historicalStatuses
70+
Assert-True { $historicalStatuses.Count -gt 0 }
71+
}

0 commit comments

Comments
 (0)