Skip to content
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
8 changes: 8 additions & 0 deletions src/Network/Network.Test/ScenarioTests/PublicIpPrefixTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,13 @@ public void TestPublicIpPrefixAllocatePublicIpAddress()
{
TestRunner.RunTestScript("Test-PublicIpPrefixAllocatePublicIpAddress");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Owner, NrpTeamAlias.sdnnrp)]
public void TestPublicIpPrefixInEdgeZone()
{
TestRunner.RunTestScript("Test-PublicIpPrefixInEdgeZone");
}
}
}
39 changes: 39 additions & 0 deletions src/Network/Network.Test/ScenarioTests/PublicIpPrefixTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,43 @@ function Test-PublicIpPrefixAllocatePublicIpAddress
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Test creating a public IP prefix in an edge zone. Subscriptions need to be explicitly whitelisted for access to edge zones.
#>
function Test-PublicIpPrefixInEdgeZone
{
# Setup
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$pipname = $rname+"pip"
$domainNameLabel = Get-ResourceName
$rglocation = "westus"
$resourceTypeParent = "Microsoft.Network/publicIpPrefixes"
$location = "westus"
$edgeZone = "microsoftlosangeles1"

try
{
# Create the resource group
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" }

# Create publicIpPrefix
New-AzPublicIpPrefix -ResourceGroupName $rgname -name $rname -location $location -Sku Standard -PrefixLength 30 -EdgeZone $edgeZone
$publicIpPrefix = Get-AzPublicIpPrefix -ResourceGroupName $rgname -name $rname

Assert-AreEqual $publicIpPrefix.ExtendedLocation.Name $edgeZone
Assert-AreEqual $publicIpPrefix.ExtendedLocation.Type "EdgeZone"
}
catch [Microsoft.Azure.Commands.Network.Common.NetworkCloudException]
{
Assert-NotNull { $_.Exception.Message -match 'Resource type .* does not support edge zone .* in location .* The supported edge zones are .*' }
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}
Loading