Skip to content

huangpf PR: dev <- Azure:dev #631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Oct 13, 2016
Merged
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
4 changes: 4 additions & 0 deletions setup/azurecmdfiles.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -1916,6 +1916,9 @@
<Component Id="cmp17459EC3296F82D03FEF8C426C8DA7EA" Guid="*">
<File Id="filF30732FD3174ABEC7D2103467F25E8E5" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\AzureRM.OperationalInsights.psd1" />
</Component>
<Component Id="cmpC77B4F6D332144EDAE5C8E2997F313F1" Guid="*">
<File Id="filD2FB04719F134FB9BF2BC1EE41908381" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\OperationalInsightsStartup.ps1" />
</Component>
<Component Id="cmp7CE9821E11931CE1140ACA06CF2D38B4" Guid="*">
<File Id="filD490745C6F4007A53448F93D7655F3D4" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\Hyak.Common.dll" />
</Component>
Expand Down Expand Up @@ -6074,6 +6077,7 @@
<ComponentRef Id="cmp275E5D23204FF3DB5A484691FFA2C6F5" />
<ComponentRef Id="cmp5E9A44B7330C75772463CB17D6D24AA6" />
<ComponentRef Id="cmp17459EC3296F82D03FEF8C426C8DA7EA" />
<ComponentRef Id="cmpC77B4F6D332144EDAE5C8E2997F313F1" />
<ComponentRef Id="cmp7CE9821E11931CE1140ACA06CF2D38B4" />
<ComponentRef Id="cmp6D68CAF3787D43356F3C2CB592699D2D" />
<ComponentRef Id="cmp20FBC1203D91D529F69E519C9C2F78B8" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestAddNetworkInterface.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestEffectiveRoutesAndNsg.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestSingleNetworkInterfaceDnsSettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void TestAddNetworkInterface()
}


[Fact(Skip ="to be recorded after fixing compute test proj")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestEffectiveRoutesAndNsg()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,12 @@ function Test-EffectiveRoutesAndNsg
Assert-AreEqual $getnic.Primary true;
Assert-NotNull $getnic.MacAddress;

# Get Effective route
# Get Effective route by name
$effectiveRoute = Get-AzureRmEffectiveRouteTable -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name
Assert-NotNull $effectiveRoute[0].Source

# Get Effective NSG
$effectiveNsgs = Get-AzureRmEffectiveNetworkSecurityGroup -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name

# Get Effective NSG by name
$effectiveNsgs = Get-AzureRmEffectiveNetworkSecurityGroup -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name
}
finally
{
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class PSEffectiveRoute
[JsonProperty(Order = 1)]
public string State { get; set; }

[JsonProperty(Order = 1)]
public string Source { get; set; }

[JsonProperty(Order = 1)]
public List<string> AddressPrefix { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public override void Execute()
var psEffectiveNsgs = Mapper.Map<List<PSEffectiveNetworkSecurityGroup>>(getEffectiveNsgs.Value);

WriteObject(psEffectiveNsgs, true);

if (psEffectiveNsgs.Count == 0)
{
WriteWarning(Microsoft.Azure.Commands.Network.Properties.Resources.EmptyEffectiveNetworkSecurityGroupOnNic);
}
}
}
}

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 @@ -255,4 +255,7 @@
<data name="UltraPerformanceGatewayWarningMessage" xml:space="preserve">
<value>Please check the availability of UltraPerformance gateway on https://azure.microsoft.com/en-us/documentation/articles/expressroute-about-virtual-network-gateways/. You will be billed for this gateway once this command succeeds.</value>
</data>
<data name="EmptyEffectiveNetworkSecurityGroupOnNic" xml:space="preserve">
<value>The effective network security group list is empty because the specified network interface is not associated with a network security group or the subnet that is referenced by the network interface is also not associated with a network security group.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ CmdletsToExport = '*'
VariablesToExport = '*'

# Aliases to export from this module
AliasesToExport = @()
AliasesToExport = @(
'New-AzureRmOperationalInsightsAzureAuditDataSource'
)

# List of all modules packaged with this module
ModuleList = @()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ function Test-DataSourceCreateUpdateDelete
$workspace = New-AzureRmOperationalInsightsWorkspace -ResourceGroupName $rgname -Name $wsname -Location $wslocation -Force

# Create a data source
$dataSource = New-AzureRmOperationalInsightsAzureAuditDataSource -Workspace $workspace -Name $dsName -SubscriptionId $subId1
$dataSource = New-AzureRmOperationalInsightsAzureActivityLogDataSource -Workspace $workspace -Name $dsName -SubscriptionId $subId1
Assert-AreEqual $dsName $dataSource.Name
Assert-NotNull $dataSource.ResourceId
Assert-AreEqual $rgname $dataSource.ResourceGroupName
Assert-AreEqual $wsname $dataSource.WorkspaceName
Assert-AreEqual $subId1 $dataSource.Properties.SubscriptionId
Assert-AreEqual "AzureAuditLog" $dataSource.Kind
Assert-AreEqual "AzureActivityLog" $dataSource.Kind

# Get the data source that was created
$dataSource = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Name $dsName
Expand All @@ -46,27 +46,26 @@ function Test-DataSourceCreateUpdateDelete
Assert-AreEqual $rgname $dataSource.ResourceGroupName
Assert-AreEqual $wsname $dataSource.WorkspaceName
Assert-AreEqual $subId1 $dataSource.Properties.SubscriptionId
Assert-AreEqual "AzureAuditLog" $dataSource.Kind
Assert-AreEqual "AzureActivityLog" $dataSource.Kind

# Create a second data source for list testing
# Create a second data source for list testing, also cover the alias.
$daNametwo = Get-ResourceName
$dataSource = New-AzureRmOperationalInsightsAzureAuditDataSource -Workspace $workspace -Name $daNametwo -SubscriptionId $subId2

# List the data source in the workspace (both param sets)
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureAuditLog
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureActivityLog
Assert-AreEqual 2 $dataSources.Count
Assert-AreEqual 1 ($dataSources | Where {$_.Name -eq $dsName}).Count
Assert-AreEqual 1 ($dataSources | Where {$_.Name -eq $daNametwo}).Count

$dataSources = Get-AzureRmOperationalInsightsDataSource -ResourceGroupName $rgname -WorkspaceName $wsname -Kind AzureAuditLog
$dataSources = Get-AzureRmOperationalInsightsDataSource -ResourceGroupName $rgname -WorkspaceName $wsname -Kind AzureActivityLog
Assert-AreEqual 2 $dataSources.Count
Assert-AreEqual 1 ($dataSources | Where {$_.Name -eq $dsName}).Count
Assert-AreEqual 1 ($dataSources | Where {$_.Name -eq $daNametwo}).Count

# Delete one of the data sources
Remove-AzureRmOperationalInsightsDataSource -Workspace $workspace -Name $daNametwo -Force
Assert-ThrowsContains { Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Name $daNametwo } "NotFound"
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureAuditLog
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureActivityLog
Assert-AreEqual 1 $dataSources.Count
Assert-AreEqual 1 ($dataSources | Where {$_.Name -eq $dsName}).Count
Assert-AreEqual 0 ($dataSources | Where {$_.Name -eq $daNametwo}).Count
Expand All @@ -75,13 +74,12 @@ function Test-DataSourceCreateUpdateDelete
$dataSource = $dataSources[0]
$dataSource.Properties.SubscriptionId = $subId2
$dataSource = Set-AzureRmOperationalInsightsDataSource -DataSource $dataSource
Assert-AreEqual "AzureAuditLog" $dataSource.Kind
Assert-AreEqual "AzureActivityLog" $dataSource.Kind
Assert-AreEqual $subId2 $dataSource.Properties.SubscriptionId

# Delete the remaining data source via piping
Remove-AzureRmOperationalInsightsDataSource -Workspace $workspace -Name $dsName -Force
Assert-ThrowsContains { Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Name $dsName } "NotFound"
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureAuditLog
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureActivityLog
Assert-AreEqual 0 $dataSources.Count
}

Expand All @@ -99,7 +97,7 @@ function Test-DataSourceCreateFailsWithoutWorkspace

New-AzureRmResourceGroup -Name $rgname -Location $wslocation -Force

Assert-ThrowsContains { New-AzureRmOperationalInsightsAzureAuditDataSource -ResourceGroupName $rgname -WorkspaceName $wsname -Name $dsName -SubscriptionId $subId1 } "ResourceNotFound"
Assert-ThrowsContains { New-AzureRmOperationalInsightsAzureActivityLogDataSource -ResourceGroupName $rgname -WorkspaceName $wsname -Name $dsName -SubscriptionId $subId1 } "ResourceNotFound"
}

<#
Expand All @@ -118,8 +116,8 @@ function Test-CreateAllKindsOfDataSource
# Create a workspace to house the data source
$workspace = New-AzureRmOperationalInsightsWorkspace -ResourceGroupName $rgname -Name $wsname -Location $wslocation -Force

# AzureAuditLog data source
$auditLogDataSource = New-AzureRmOperationalInsightsAzureAuditDataSource -Workspace $workspace -Name "myAuditLog" -SubscriptionId $subId1
# AzureActivityLog data source
$auditLogDataSource = New-AzureRmOperationalInsightsAzureActivityLogDataSource -Workspace $workspace -Name "myAuditLog" -SubscriptionId $subId1

# windows event data source
$windowsEventDataSource = New-AzureRmOperationalInsightsWindowsEventDataSource -Workspace $workspace -Name Application -EventLogName "Application" -CollectErrors -CollectWarnings -CollectInformation
Expand Down
Loading