Skip to content

Commit 260ac84

Browse files
authored
Merge pull request Azure#9114 from pranavpnair/bugfixes
Adding warning to privatedns zones created (with New-AzPrivateDnsZone cmdlet) with .local as suffix
2 parents a80fa10 + 9414149 commit 260ac84

File tree

7 files changed

+1185
-0
lines changed

7 files changed

+1185
-0
lines changed

src/PrivateDns/PrivateDns.Test/ScenarioTests/ZoneTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ public void TestZoneNewAlreadyExists()
9191
PrivateDnsTestsBase.NewInstance.RunPowerShellTest(_logger, "Test-ZoneNewAlreadyExists");
9292
}
9393

94+
[Fact]
95+
[Trait(Category.AcceptanceType, Category.CheckIn)]
96+
public void TestZoneNewWithLocalSuffix()
97+
{
98+
PrivateDnsTestsBase.NewInstance.RunPowerShellTest(_logger, "Test-ZoneNewWithLocalSuffix");
99+
}
100+
94101
[Fact()]
95102
[Trait(Category.AcceptanceType, Category.CheckIn)]
96103
public void TestZoneSetEtagMismatch()

src/PrivateDns/PrivateDns.Test/ScenarioTests/ZoneTests.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,26 @@ function Test-ZoneNewAlreadyExists
187187
Remove-AzResourceGroup -Name $resourceGroupName -Force
188188
}
189189

190+
<#
191+
.SYNOPSIS
192+
Test zone creation with .local suffix.
193+
#>
194+
function Test-ZoneNewWithLocalSuffix
195+
{
196+
$zoneName = Get-RandomZoneName
197+
$zoneName = $zoneName + ".local"
198+
$resourceGroup = TestSetup-CreateResourceGroup
199+
$resourceGroupName = $resourceGroup.ResourceGroupName
200+
$createdZone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroupName -WarningVariable warnings
201+
202+
Assert-NotNull $createdZone
203+
$message = "Please be aware that DNS names ending with .local are reserved for use with multicast DNS and may not work as expected with some operating systems. For details refer to your operating systems documentation."
204+
Assert-AreEqual $message $warnings
205+
206+
$createdZone | Remove-AzPrivateDnsZone -PassThru -Confirm:$false
207+
Remove-AzResourceGroup -Name $resourceGroupName -Force
208+
}
209+
190210
<#
191211
.SYNOPSIS
192212
Test zone update when etags mismatch

0 commit comments

Comments
 (0)