Skip to content

Commit 81f6a04

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
2 parents 9a0a93a + 77f543f commit 81f6a04

File tree

58 files changed

+7477
-4606
lines changed

Some content is hidden

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

58 files changed

+7477
-4606
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ You can also find the standalone installers for all the versions at [Downloads](
8080
### Source Code
8181

8282
1. Download the source code from GitHub repo
83-
2. Follow the [Microsoft Azure PowerShell Developer Guide](https://github.com/Azure/azure-powershell/wiki/Microsoft-Azure-PowerShell-Developer-Guide)
83+
2. Follow the [Azure PowerShell Developer Guide](https://github.com/Azure/azure-powershell/wiki/Azure-Powershell-Developer-Guide)
8484

8585
### Supported PowerShell Versions
8686

src/ResourceManager/Cdn/Commands.Cdn.Test/Commands.Cdn.Test.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<Private>True</Private>
5858
</Reference>
5959
<Reference Include="Microsoft.Azure.Management.Cdn">
60-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Cdn.1.1.0\lib\portable-net45+win+wpa81\Microsoft.Azure.Management.Cdn.dll</HintPath>
60+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Cdn.2.0.0\lib\net45\Microsoft.Azure.Management.Cdn.dll</HintPath>
6161
</Reference>
6262
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6363
<SpecificVersion>False</SpecificVersion>
@@ -168,6 +168,9 @@
168168
<None Include="SessionRecords\Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest.EndpointTests\TestEndpointPipeline.json">
169169
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
170170
</None>
171+
<None Include="SessionRecords\Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest.EndpointTests\TestEndpointGeoFilters.json">
172+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
173+
</None>
171174
<None Include="SessionRecords\Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest.OriginTests\TestOriginGetSetWhenEndpointDoesnotExist.json">
172175
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
173176
</None>

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/CustomDomainTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest;
1516
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1617
using Xunit;
1718

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/CustomDomainTests.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ Gets and removes custom domain with running endpoint.
1919
function Test-CustomDomainGetRemoveWithRunningEndpoint
2020
{
2121
# Hard-coding host and endpoint names due to requirement for DNS CNAME
22-
$endpointName = "sdktest-3d96e37e-79bd-440d-a84b-d71a8bb3bed6"
23-
$hostName = "sdktest-aef2f35e-01ca-4230-add5-5075b1506915.azureedge-test.net"
22+
$endpointName = "sdktest-c83c1e8f-343e-4ce8-873b-f6e5ddcdc53f"
23+
$hostName = "sdktest-716d4572-627f-4dfe-8128-1df163647ae2.azureedge-test.net"
2424

2525
$customDomainName = getAssetName
2626

2727
$profileName = getAssetName
2828
$resourceGroup = TestSetup-CreateResourceGroup
2929
$resourceLocation = "EastUS"
30-
$profileSku = "StandardVerizon"
30+
$profileSku = "Standard_Verizon"
3131
$tags = @{"tag1" = "value1"; "tag2" = "value2"}
3232
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku -Tags $tags
3333

@@ -66,15 +66,15 @@ Gets and removes custom domain with stopped endpoint
6666
function Test-CustomDomainGetRemoveWithStoppedEndpoint
6767
{
6868
# Hard-coding host and endpoint names due to requirement for DNS CNAME
69-
$endpointName = "sdktest-b0939e74-75ba-4558-afe6-edc5c19ea713"
70-
$hostName = "sdktest-d8163a47-2912-4b95-8453-1588ca2d014f.azureedge-test.net"
69+
$endpointName = "sdktest-cbc4e6fa-da15-4f37-9511-6b7df122c1de"
70+
$hostName = "sdktest-34a59412-9044-4166-b055-d777e111e810.azureedge-test.net"
7171

7272
$customDomainName = getAssetName
7373

7474
$profileName = getAssetName
7575
$resourceGroup = TestSetup-CreateResourceGroup
7676
$resourceLocation = "EastUS"
77-
$profileSku = "StandardVerizon"
77+
$profileSku = "Standard_Verizon"
7878
$tags = @{"tag1" = "value1"; "tag2" = "value2"}
7979
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku -Tags $tags
8080

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/EndpointTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest;
1516
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1617
using Xunit;
1718

@@ -61,5 +62,12 @@ public void TestEndpointPipeline()
6162
{
6263
TestController.NewInstance.RunPowerShellTest(_logger, "Test-EndpointPipeline");
6364
}
65+
66+
[Fact]
67+
[Trait(Category.AcceptanceType, Category.CheckIn)]
68+
public void TestEndpointGeoFilters()
69+
{
70+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-EndpointGeoFilters");
71+
}
6472
}
6573
}

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/EndpointTests.ps1

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Test-EndpointCrudAndAction
2121
$profileName = getAssetName
2222
$resourceGroup = TestSetup-CreateResourceGroup
2323
$resourceLocation = "EastUS"
24-
$profileSku = "StandardVerizon"
24+
$profileSku = "Standard_Verizon"
2525
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku
2626

2727
$endpointName = getAssetName
@@ -77,7 +77,7 @@ function Test-EndpointCrudAndActionWithPiping
7777
$profileName = getAssetName
7878
$resourceGroup = TestSetup-CreateResourceGroup
7979
$resourceLocation = "EastUS"
80-
$profileSku = "StandardVerizon"
80+
$profileSku = "Standard_Verizon"
8181
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku
8282

8383
$endpointName = getAssetName
@@ -142,7 +142,7 @@ function Test-EndpointCrudAndActionWithAllProperties
142142
$profileName = getAssetName
143143
$resourceGroup = TestSetup-CreateResourceGroup
144144
$resourceLocation = "EastUS"
145-
$profileSku = "StandardVerizon"
145+
$profileSku = "Standard_Verizon"
146146
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku
147147

148148
$endpointName = getAssetName
@@ -221,7 +221,7 @@ function Test-EndpointCrudAndActionWithAllPropertiesWithPiping
221221
$profileName = getAssetName
222222
$resourceGroup = TestSetup-CreateResourceGroup
223223
$resourceLocation = "EastUS"
224-
$profileSku = "StandardVerizon"
224+
$profileSku = "Standard_Verizon"
225225
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku
226226

227227
$endpointName = getAssetName
@@ -306,7 +306,7 @@ function Test-EndpointCrudAndActionWithStoppedEndpoint
306306
$profileName = getAssetName
307307
$resourceGroup = TestSetup-CreateResourceGroup
308308
$resourceLocation = "EastUS"
309-
$profileSku = "StandardVerizon"
309+
$profileSku = "Standard_Verizon"
310310
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku
311311

312312
$endpointName = getAssetName
@@ -366,7 +366,7 @@ function Test-EndpointPipeline
366366
$profileName = getAssetName
367367
$resourceGroup = TestSetup-CreateResourceGroup
368368
$resourceLocation = "EastUS"
369-
$profileSku = "StandardVerizon"
369+
$profileSku = "Standard_Verizon"
370370
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku
371371

372372
$endpointName1 = getAssetName
@@ -388,5 +388,44 @@ function Test-EndpointPipeline
388388

389389
Assert-True {$deletedEndpoints.Count -eq 0}
390390

391+
Remove-AzureRmResourceGroup -Name $resourceGroup.ResourceGroupName -Force
392+
}
393+
394+
<#
395+
.SYNOPSIS
396+
Endpoint geo filters exercise
397+
#>
398+
function Test-EndpointGeoFilters
399+
{
400+
$profileName = getAssetName
401+
$resourceGroup = TestSetup-CreateResourceGroup
402+
$resourceLocation = "EastUS"
403+
$profileSku = "Standard_Akamai"
404+
$GeoFilter_1 = New-Object -TypeName Microsoft.Azure.Commands.Cdn.Models.Endpoint.PsGeoFilter -Prop(@{'RelativePath'="/mycar";'Action'="Block"})
405+
$GeoFilter_1.CountryCodes = @("GA", "AT")
406+
407+
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku
408+
409+
$endpointName1 = getAssetName
410+
$originName = getAssetName
411+
$originHostName = "www.microsoft.com"
412+
413+
$createdProfile | New-AzureRmCdnEndpoint -EndpointName $endpointName1 -OriginName $originName -OriginHostName $originHostName -GeoFilters @($GeoFilter_1)
414+
415+
$endpoint = Get-AzureRmCdnEndpoint -EndpointName $endpointName1 -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName
416+
417+
Assert-True {$endpoint.GeoFilters.Count -eq 1}
418+
Assert-True {$endpoint.GeoFilters[0].Action -eq "Block"}
419+
Assert-True {$endpoint.GeoFilters[0].CountryCodes.Count -eq 2}
420+
421+
$GeoFilter_2 = New-Object -TypeName Microsoft.Azure.Commands.Cdn.Models.Endpoint.PsGeoFilter -Prop(@{'RelativePath'="/mypicture";'Action'="Block"})
422+
$GeoFilter_2.CountryCodes = @("GA", "AT")
423+
424+
$endpoint.GeoFilters.Add($GeoFilter_2)
425+
426+
$updatedEndpoint = Set-AzureRmCdnEndpoint -CdnEndpoint $endpoint
427+
428+
Assert-True {$updatedEndpoint.GeoFilters.Count -eq 2}
429+
391430
Remove-AzureRmResourceGroup -Name $resourceGroup.ResourceGroupName -Force
392431
}

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/OriginTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest;
1516
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1617
using Xunit;
1718

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/OriginTests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Test-OriginGetSetWithRunningEndpoint
2121
$profileName = getAssetName
2222
$resourceGroup = TestSetup-CreateResourceGroup
2323
$resourceLocation = "EastUS"
24-
$profileSku = "StandardVerizon"
24+
$profileSku = "Standard_Verizon"
2525
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku
2626

2727
$endpointName = getAssetName
@@ -60,7 +60,7 @@ function Test-OriginGetSetWithStoppedEndpoint
6060
$profileName = getAssetName
6161
$resourceGroup = TestSetup-CreateResourceGroup
6262
$resourceLocation = "EastUS"
63-
$profileSku = "StandardVerizon"
63+
$profileSku = "Standard_Verizon"
6464
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku
6565

6666
$endpointName = getAssetName
@@ -100,7 +100,7 @@ function Test-OriginGetSetWhenEndpointDoesnotExist
100100
$profileName = getAssetName
101101
$resourceGroup = TestSetup-CreateResourceGroup
102102
$resourceLocation = "EastUS"
103-
$profileSku = "StandardVerizon"
103+
$profileSku = "Standard_Verizon"
104104
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -Sku $profileSku
105105

106106
$endpointName = getAssetName

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/ProfileTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest;
1516
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1617
using Xunit;
1718

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/ProfileTests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Test-ProfileCrud
2121
$profileName = getAssetName
2222
$resourceGroup = TestSetup-CreateResourceGroup
2323
$profileLocation = "EastUS"
24-
$profileSku = "StandardVerizon"
24+
$profileSku = "Standard_Verizon"
2525
$tags = @{"tag1" = "value1"; "tag2" = "value2"}
2626
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $profileLocation -Sku $profileSku -Tags $tags
2727

@@ -69,7 +69,7 @@ function Test-ProfileDeleteWithEndpoints
6969
$endpointName = getAssetName
7070
$resourceGroup = TestSetup-CreateResourceGroup
7171
$profileLocation = "EastUS"
72-
$profileSku = "StandardVerizon"
72+
$profileSku = "Standard_Akamai"
7373

7474
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $profileLocation -Sku $profileSku
7575

@@ -92,7 +92,7 @@ function Test-ProfileDeleteAndSsoWithPiping
9292
$profileName = getAssetName
9393
$resourceGroup = TestSetup-CreateResourceGroup
9494
$profileLocation = "EastUS"
95-
$profileSku = "StandardVerizon"
95+
$profileSku = "Standard_Verizon"
9696
$tags = @{"tag1" = "value1"; "tag2" = "value2"}
9797
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $profileLocation -Sku $profileSku -Tags $tags
9898

@@ -119,7 +119,7 @@ function Test-ProfilePipeline
119119
$profileName2 = getAssetName
120120
$resourceGroup = TestSetup-CreateResourceGroup
121121
$profileLocation = "EastUS"
122-
$profileSku = "StandardVerizon"
122+
$profileSku = "Standard_Verizon"
123123
$tags = @{"tag1" = "value1"; "tag2" = "value2"}
124124
$createdProfile1 = New-AzureRmCdnProfile -ProfileName $profileName1 -ResourceGroupName $resourceGroup.ResourceGroupName -Location $profileLocation -Sku $profileSku -Tags $tags
125125

0 commit comments

Comments
 (0)