Skip to content

Commit

Permalink
Merge pull request #105 from PowerShell/dev
Browse files Browse the repository at this point in the history
Release of version 1.14.0.0 of xDnsServer
  • Loading branch information
mgreenegit authored Sep 19, 2019
2 parents 38999f4 + 93c8adb commit 8ddabdf
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ function Test-TargetResource
return $false
}
}
if($currentConfiguration.UseRootHint -ne $UseRootHint){
return $false
if ($PSBoundParameters.ContainsKey('UseRootHint'))
{
if ($currentConfiguration.UseRootHint -ne $UseRootHint)
{
return $false
}
}

return $true
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ Requires Windows Server 2016 onwards

### 1.14.0.0

* Fixed: Ignore UseRootHint in xDnsServerForwarder test function if it was not
specified in the resource [Claudio Spizzi (@claudiospizzi)](https://github.com/claudiospizzi)

### 1.14.0.0

* Copied enhancements to Test-DscParameterState from NetworkingDsc
* Put the helper module to its own folder
* Copied enhancements to Test-DscParameterState from NetworkingDsc
Expand Down
14 changes: 14 additions & 0 deletions Tests/Unit/MSFT_xDnsServerForwarder.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,18 @@ try
IPAddresses = $forwarders
UseRootHint = $UseRootHint
}
$testParamLimited = @{
IsSingleInstance = 'Yes'
IPAddresses = $forwarders
}
$fakeDNSForwarder = @{
IPAddress = $forwarders
UseRootHint = $UseRootHint
}
$fakeUseRootHint = @{
IPAddress = $forwarders
UseRootHint = -not $UseRootHint
}
#endregion


Expand Down Expand Up @@ -81,10 +89,16 @@ try
Test-TargetResource @testParams | Should Be $true
}

It 'Passes when forwarders match but root hint do not and are not spcified' {
Mock -CommandName Get-DnsServerForwarder -MockWith {return $fakeUseRootHint}
Test-TargetResource @testParamLimited | Should Be $true
}

It "Fails when forwarders don't match" {
Mock -CommandName Get-DnsServerForwarder -MockWith {return @{IPAddress = @(); UseRootHint = $true}}
Test-TargetResource @testParams | Should Be $false
}

It "Fails when UseRootHint don't match" {
Mock -CommandName Get-DnsServerForwarder -MockWith {return @{IPAddress = $fakeDNSForwarder.IpAddress; UseRootHint = $false}}
Test-TargetResource @testParams | Should Be $false
Expand Down
10 changes: 3 additions & 7 deletions xDnsServer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,8 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Copied enhancements to Test-DscParameterState from NetworkingDsc
* Put the helper module to its own folder
* Copied enhancements to Test-DscParameterState from NetworkingDsc
* Put the helper module to its own folder
* Added xDnsServerRootHint resource
* Added xDnsServerClientSubnet resource
* Added xDnsServerZoneScope resource
ReleaseNotes = '* Fixed: Ignore UseRootHint in xDnsServerForwarder test function if it was not
specified in the resource [Claudio Spizzi (@claudiospizzi)](https://github.com/claudiospizzi)
'

Expand All @@ -71,3 +66,4 @@ PrivateData = @{




0 comments on commit 8ddabdf

Please sign in to comment.