Skip to content

Adding warning to privatedns zones created (with New-AzPrivateDnsZone cmdlet) with .local as suffix #9114

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 5 commits into from
May 10, 2019
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
7 changes: 7 additions & 0 deletions src/PrivateDns/PrivateDns.Test/ScenarioTests/ZoneTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ public void TestZoneNewAlreadyExists()
PrivateDnsTestsBase.NewInstance.RunPowerShellTest(_logger, "Test-ZoneNewAlreadyExists");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestZoneNewWithLocalSuffix()
{
PrivateDnsTestsBase.NewInstance.RunPowerShellTest(_logger, "Test-ZoneNewWithLocalSuffix");
}

[Fact()]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestZoneSetEtagMismatch()
Expand Down
20 changes: 20 additions & 0 deletions src/PrivateDns/PrivateDns.Test/ScenarioTests/ZoneTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,26 @@ function Test-ZoneNewAlreadyExists
Remove-AzResourceGroup -Name $resourceGroupName -Force
}

<#
.SYNOPSIS
Test zone creation with .local suffix.
#>
function Test-ZoneNewWithLocalSuffix
{
$zoneName = Get-RandomZoneName
$zoneName = $zoneName + ".local"
$resourceGroup = TestSetup-CreateResourceGroup
$resourceGroupName = $resourceGroup.ResourceGroupName
$createdZone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroupName -WarningVariable warnings

Assert-NotNull $createdZone
$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."
Assert-AreEqual $message $warnings

$createdZone | Remove-AzPrivateDnsZone -PassThru -Confirm:$false
Remove-AzResourceGroup -Name $resourceGroupName -Force
}

<#
.SYNOPSIS
Test zone update when etags mismatch
Expand Down
Loading